GeoJson To TopoJSon Conversion

Viewed 1702

I am trying to convert Shapefile to Topojson. currently i am using npm version 2.15.11.

I am using the following steps:

1.Shapefile to GeoJson:

ogr2ogr -f GeoJSON -s_srs epsg:4326 -t_srs epsg:4326 geo_json.json geo_shape.shp 

2.Geojson to Topojson:

geo2topo -o geo_topo.json levels=geo_json.json 

This command is running successfully but in 'transform' object is not creating inside the topojson file. So i can't load topojson inside map.

Please help me if i am using any wrong commands.

1 Answers

Using npm (vers 3.10.10), I installed topojson using npm install topojson

I usually use QGIS to convert a shapefile to a geojson file. But ogr2ogr should work.

To convert GeoJSON to TopoJSON, I run the following command (using topojson vers 3.0.2)
geo2topo path_to_geojson_file > path_to_topojson_file

Related