Streaming Shapefile
✓ Published0🌍 Public
Mmbostock
Last edited Mar 9, 2019
Created on Sep 7, 2016
This example streams a 12.9MB shapefile of US county boundaries directly from a remote URL, rendering each feature to a Canvas as it downloads. The map uses an Albers USA projection with a 0.5-pixel stroke, and parsing is handled incrementally by the shapefile library’s `open` and `read` promise chain. The `d3.geoPath` generator draws the geometry, and the browser’s streaming fetch support enables the full map to appear before the download completes.
AI-generated descriptionThis is a 12.9MB shapefile! If your browser supports streaming fetch, it will start being displayed even before it has finished downloading. Streaming in-browser parsing is new in shapefile 0.5.
gpl-3.0 Licensed