Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add kentucky 2016 precincts #76

Merged
merged 3 commits into from
Mar 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ out/nation.gpkg: \
out/13-georgia/state.gpkg \
out/18-indiana/state.gpkg \
out/20-kansas/state.gpkg \
out/21-kentucky/state.gpkg \
out/24-maryland/state.gpkg \
out/26-michigan/state.gpkg \
out/37-north-carolina/state.gpkg \
Expand All @@ -21,6 +22,7 @@ out/nation.gpkg: \
ogr2ogr -f GPKG -nln nation -nlt MultiPolygon -overwrite $@ out/13-georgia/state.gpkg
ogr2ogr -f GPKG -nln nation -append $@ out/18-indiana/state.gpkg
ogr2ogr -f GPKG -nln nation -append $@ out/20-kansas/state.gpkg
ogr2ogr -f GPKG -nln nation -append $@ out/21-kentucky/state.gpkg
ogr2ogr -f GPKG -nln nation -append $@ out/24-maryland/state.gpkg
ogr2ogr -f GPKG -nln nation -append $@ out/26-michigan/state.gpkg
ogr2ogr -f GPKG -nln nation -append $@ out/37-north-carolina/state.gpkg
Expand Down Expand Up @@ -55,6 +57,17 @@ out/20-kansas/state.gpkg: data/20-kansas/2016/20045-douglas/precincts.geojson
-t_srs EPSG:4326 -overwrite -f GPKG out/20-kansas/045-douglas/county.gpkg data/20-kansas/2016/20045-douglas/precincts.geojson
ogr2ogr -f GPKG -nln state -overwrite $@ out/20-kansas/045-douglas/county.gpkg

out/21-kentucky/state.gpkg: data/21-kentucky/statewide/2016/kyprecinctsmergedfinal.zip
mkdir -p out/21-kentucky/source
unzip -d out/21-kentucky/source data/21-kentucky/statewide/2016/kyprecinctsmergedfinal.zip
# Write to temporary GeoJSON because OGR SQL and GPKG driver
# don't like spaces in shapefile layer name.
rm -f out/21-kentucky/source/temporary.geojson
ogr2ogr -sql "SELECT '2016' AS year, 'Kentucky' AS state, COUNTY AS county, VTD AS precinct, 'polygon' AS accuracy FROM "'"KY Precincts Merged Final"' \
-t_srs EPSG:4326 -overwrite -f GeoJSON out/21-kentucky/source/temporary.geojson 'out/21-kentucky/source/KY Precincts Merged Final.shp'
ogr2ogr -overwrite -f GPKG $@ out/21-kentucky/source/temporary.geojson
rm -rf out/21-kentucky/source

out/24-maryland/state.gpkg: data/24-maryland/statewide/2010/maryland.geojson
mkdir -p out/24-maryland
ogr2ogr -sql "SELECT '2010' AS year, 'Maryland' AS state, COUNTY AS county, VTD AS precinct, 'polygon' AS accuracy FROM OGRGeoJSON" \
Expand Down
5 changes: 5 additions & 0 deletions data/21-kentucky/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Kentucky

Data is available for 2016 sourced from KY Board of Elections April 2016, [via the data.civicdataalliance.org](http://data.civicdataalliance.org/en/dataset/ky-voting-precinct-geographic-outlines/resource/18e47ffd-cfb1-40a8-8029-4e262ad1ada5):

- http://data.civicdataalliance.org/dataset/667f02ea-5b83-4399-a269-52bb024e2255/resource/18e47ffd-cfb1-40a8-8029-4e262ad1ada5/download/kyprecinctsmergedfinal.zip
Binary file not shown.