topojson
topojson copied to clipboard
Converting TopoJson to a GeoJSon object_name not changing
I can't do the conversion to GeoJson file using the .to_geojson() with a different object_name parameter other than default (data).
I have objects with different names (e.g. example)
{ "type": "Topology", "transform": { "scale": [0.0005000500050005, 0.00010001000100010001], "translate": [100, 0] }, "objects": { "example": { "type": "GeometryCollection", "geometries": [ { "type": "Point", "properties": { "prop0": "value0" }, "coordinates": [4000, 5000] }, { "type": "LineString", "properties": { "prop0": "value0", "prop1": 0 }, "arcs": [0] }, { "type": "Polygon", "properties": { "prop0": "value0", "prop1": { "this": "that" } }, "arcs": [[1]] } ] } }, "arcs": [ [[4000, 0], [1999, 9999], [2000, -9999], [2000, 9999]], [[0, 0], [0, 9999], [2000, 0], [0, -9999], [-2000, 0]] ] }
if a pass as object_name='example',
topo = Topology(topojson_data) geojson_data = topo.to_geojson(object_name="example")
it still does not read the file and send the error:
'data' is not an object name in your topojson file
I could only read my file by editing the topojson and changing "example" to "data"