to-topojson
Most geo converters stop at GeoJSON, so you need to multiple codes together to convert to TopoJSON. This eliminates the extra step.
Helps with:
- Detecting file formats
- Best TopoJSON settings (including: keeping GeoJSON properties)
- Adding labels (using MapBox Turf.js)
Supports:
- GeoJSON using Mike Bostock's topojson module
- KML and GPX using MapBox's togeojson module
- Shapefiles using Calvin Metcalf's shpjs module
Functions
// detect file format and output TopoJSON; // optional_logger can be console.log or another function for updates // set format and output TopoJSON;// acceptable strings: GeoJSON, SHP, KML, GPX (default is GeoJSON) ; ;
License
MIT License