KML to TopoJSON Converter
Compact KML polygon data for shipping to a browser-side D3 or custom map.
Common issues converting KML to TopoJSON
- KML is first parsed to GeoJSON internally, then topologized. Any quirks of the KML→GeoJSON step (dropped styles, expanded MultiGeometries) apply.
- Shared boundaries produce the compactness wins, so the saving is dramatic for administrative polygons and minor for isolated shapes.
- Point-only KMLs don't benefit from TopoJSON — keep them as GeoJSON.
- Styling and icons don't survive round-tripping. TopoJSON, like GeoJSON, has no style layer.
Frequently asked questions
Why TopoJSON instead of GeoJSON?
Smaller file size for dense polygon networks — typically 70–90%. That matters when shipping boundary maps to the browser in a page bundle.
Is this conversion lossy?
Quantization rounds coordinates to a grid. For country/state/county maps rendered above street level, the loss is imperceptible.
What libraries render the output?
D3-geo directly. Leaflet, Mapbox, and OpenLayers need topojson-client to expand to GeoJSON first (<10KB gzipped).
Should I topologize a KML of points?
No — TopoJSON's savings come from shared boundaries between polygons. Pure point datasets should stay as GeoJSON.