U.S. Census data gives our modeling a good predictive boost, and it's a robust quality assurance tool for all the third-party data we've got flowing through our wires.
The Census offers its geographic data in easy-to get, familiar formats via the TIGER portal, but distribution is split up by state for the largest datasets: blocks and block groups. There's a pretty simple reason for this: they're big. The census block shapefile for Indiana alone is 116MB compressed.
Ours is probably not a common use case, but we need all of the blocks and block groups in our database - merged, indexed and queryable. It took a significant amount of work to get them there, so in case anyone else needs them too, we're sharing national 2015 datasets in PostGIS dumpfile format, downloadable and ready to use here:
### Census block groups [`.pg_dump`](https://s3.amazonaws.com/faraday-science/usa_census_block_groups.6b343e6d6f33264f683c4432467c3c48.pg_dump) (426MB) | [`.sql`](https://s3.amazonaws.com/faraday-science/usa_census_block_groups.7d36216a423d233367776e4247.sql) (1.2GB) ![bg](/blog/content/images/2016/07/Screenshot-2016-06-29-16-49-49.png)
### Census blocks [`.pg_dump`](https://s3.amazonaws.com/faraday-science/usa_census_blocks.766c344c76756752203b552a7d644b72.pg_dump) (4.7GB) | [`.sql`](https://s3.amazonaws.com/faraday-science/usa_census_blocks.6f58314a4c46664c786e765951.sql) (12GB) ![b](/blog/content/images/2016/07/Screenshot-2016-07-01-14-03-02.png)
Add these to your local PostgreSQL database like so:
pg_restore --no-owner --no-privileges --dbname <dbname> <filename>.pg_dump # OR psql <dbname> -f <filename>.sql
Side note: I can't recommend censusreporter.org enough for census-based sanity checks.