FOSS4G 2022 general tracks

Daniel McGlone

Daniel McGlone is a Product Manager & Senior GIS Analyst at the geospatial software company Azavea.


Sessions

08-25
09:00
30min
DistrictBuilder, or how TopoJSON was the cause of and solution to all of our problems
Michael Maurizi, Daniel McGlone

DistrictBuilder (districtbuilder.org) is a web-based, open-source tool for collaborative political boundary redistricting or redistribution.

In order to support creating legally valid districts, DistrictBuilder allows advocates and legislators to define districts using geometries as small as a single census block, which are very numerous – a medium-sized state will have hundreds of thousands of them. Users can create districts from any combination of geometries, and we need to be able to generate statistics and dissolve them into district geometries in near real-time.

By reformatting our data as TopoJSON, a file format and Node.js library for working with topological data, we are able to dissolve over half a million census blocks into legislative districts in only a few seconds!

I’ll discuss how we use TopoJSON in DistrictBuilder; the issues we encountered when using it at scale in production and how we were able to overcome them; and the other tools we considered instead of TopoJSON and how they compared in terms of performance.

I’ll also go over our strategy for displaying and calculating metrics in real-time in the browser, using typed arrays and web-workers in combination with Mapbox vector tiles to do real-time aggregation of statistics from hundreds of thousands of features.

Use cases & applications
Room 4