Shell script to import data into Postgres from https://www.nhgis.org. If you use this, you'll need to edit line 14 to include the census data you're importing.
✓ Published0🌍 Public
CCaged
Last edited Oct 11, 2013
Created on Oct 11, 2013
This script sets up a Postgres database to hold U.S. Census block-group data, combining demographic race counts with spatial geometries. It first imports CSV race data into a table, then converts shapefiles to a uniform projection (EPSG:4326) using `ogr2ogr` and appends them via `shp2pgsql`. The code uses PostGIS for geometry support and creates a spatial index on the `geom` column. It relies on command-line tools like `dropdb`, `createdb`, and `psql`, processing files from the NHGIS source archive. The final output enables querying joined attribute and spatial data.
AI-generated description