🚧 Under Construction 🚧
Block equivalency files (BEFs) are a common file format used in legislative redistricting. They’re produced by software like DistrictBuilder, Maptitude, and Dave’s Redistricting App. The U.S. Census publishes nationwide district BEFs. To use a BEF in geospatial software, you first need to convert it from a list of (identifier, district) pairs to polygons. PlanScore’s experimental District Graphs API is here to help.
-
Find a BEF to experiment with. For example, Pennsylvania published their 2018 remedial U.S. House plan Census Block Equivalency File.
-
Get a pair of URLs from the District Graphs API. Use the
layer
parameter to specify a geographic subdivision to assign, one oftract
(Census tract),bg
(block group), ortabblock
(Census block).HTTP GET https://dgraphs.planscore.org/upload_file?layer=tract
Response:
{ "assignments_url": "https://districtgraphs.s3.amazonaws.com/assignments/...", "districts_url": "https://dgraphs.planscore.org/read_file?upload=..." }
-
Upload your BEF to the
assignments_url
:HTTP PUT {assignments_url} Body: Contents of equivalency file
-
Poll the
districts_url
URL untilstatus
iscomplete
:HTTP GET https://dgraphs.planscore.org/read_file?upload=...
Initial response:
{ "state": "started", "token": "...", "district_ids": [ ... ], "geojson_url": null }
Again:
HTTP GET https://dgraphs.planscore.org/read_file?upload=...
Completed response:
{ "state": "complete", "token": "...", "district_ids": [ ... ], "geojson_url": "https://districtgraphs.s3.amazonaws.com/.../districts.geojson" }
-
The
geojson_url
will contain a GeoJSON file with outlines for each legislative district which can be used in GIS software like ArcGIS and QGIS or uploaded to PlanScore to get its predicted partisan behavior. -
If you’re editing your BEF you can re-use these same two URLs repeatedly. The
assignments_url
will be valid for re-use for approximately one hour.