Shapefile to TopoJSON Converter
The data-prep step before building a D3-geo choropleth or any topology-aware visualisation.
Convert Shapefile to TopoJSON now
Common issues converting Shapefile to TopoJSON
- TopoJSON compression works best on adjacent polygons (county / admin boundaries) — typical savings 70–90%. Isolated features (city points) get minimal benefit.
- DBF attribute data is preserved as properties on each feature in the resulting topology. UTF-8 fidelity depends on the .cpg sidecar; a missing .cpg falls back to Latin-1.
- TopoJSON requires identical coordinates on shared borders for arc-sharing — sub-millimetre vertex precision differences will silently break topology. Pre-snap vertices in QGIS if your source is messy.
- Quantization is applied by default at level 1e4 — sub-meter changes are rounded out. Increase quantization or skip it if your map requires sub-meter precision.
Frequently asked questions
Will the output have a single 'objects' member?
Yes — one named per shapefile, taken from the base filename of the .shp inside the ZIP. Multi-shp bundles produce multiple objects in the same topology.
Is topology auto-detected from the geometry?
Yes — adjacent polygons that share vertices get shared arcs. If your shapefile has slightly-mismatched borders (common with separately-digitised features), they won't share arcs and you'll lose the compression benefit.
What about attribute types — do they survive?
Yes. DBF Numeric becomes JSON number, Character becomes string, Logical becomes boolean, Date becomes ISO-8601 string.
Can D3-geo render it directly?
Yes. Use `topojson.feature(topology, topology.objects.<name>)` to recover a GeoJSON FeatureCollection that d3.geoPath() consumes.