Techniques used to split Minnesota voting precincts into higher level district boundaries. The Minnesota Secretary of State released Voting Precinct data on the MN Legislature site. The dataset includes higher level boundaries like district courts, but we need to group them together to get new datasets (shapefiles). This codebase is a simple collection of what was done to make that happen.
Instruction assume a Mac (sorry).
Install PostGIS with homebrew (a quick search will find you some good instructions). Make sure to install GDAL with Postgres support.
- Create a PostGIS database named
minnpost
. - Extract shapefile:
cd data && unzip vtd2012_primary_rev20120720.zip; cd -;
- Import the shapefile into the database (change
psql
credentials as need):shp2pgsql -d -I -D -s 26915 -g the_geom data/vtd2012_primary_rev20120720.shp mn_voting_precincts | psql -U postgres -h localhost minnpost
- Run the following to create the data subsets in the
data/subsets
directory, update Postgres credentials as needed:bash data-processing/create-subsets.sh