Skip to content

Latest commit

 

History

223 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Congressional District Interactive Mapping Tool

Embed

Include this tag in the taxfoundation.org post:

<div id="biden-plan-map-2021"></div>

Include these scripts on the taxfoundation.org post page:

https://biden-plan-map-2021.netlify.app/pym.js
https://biden-plan-map-2021.netlify.app/pymSetup.js

Data Sources

Cartographic Boundary Files - Shapefile. Use 500k for state-level maps, 20m for national.

To create the national-level district map:

mapshaper -i cb_2019_us_cd116_20m.shp name='' -proj wgs84 -rename-fields district=CD116FP,state=STATEFP -filter-fields district,state -simplify 30% -o districts.json format=topojson

To create the individual state topojson files, the mapshaper tool was used with the following configuration:

mapshaper -i cb_2019_us_cd116_500k.shp name='' -proj wgs84 -rename-fields district=CD116FP,state=STATEFP -filter-fields district,state -split state -o format=geojson
mapshaper -i *.json -o format=topojson force
mapshaper -i 02.json -simplify 10% -o force

Splitting directly to topojson does not create separate files, so you must first split to geojson and then convert to topojson. D3 expects WGS84 coordinate system, from which it will then apply whatever other projection (in this case, Mercator). Failing to project to WGS84 will result in computer generated art, not a map.

For Alaska specifically, which was 1mb originally, it was simplified with the -simplify 10% argument in mapshaper.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages