Skip to content

Commit

Permalink
Merge pull request #76 from nvkelso/nvkelso/add-kentucky-2016
Browse files Browse the repository at this point in the history
add kentucky 2016 precincts
  • Loading branch information
nvkelso authored Mar 12, 2017
2 parents 54a2175 + e068c21 commit 4cdac85
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
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.

0 comments on commit 4cdac85

Please sign in to comment.