topojson / topojson-server

Convert GeoJSON to TopoJSON.
ISC License
115 stars 32 forks source link

Reconverting topojson that was outputted by topojson-client #12

Open salmankhann opened 6 years ago

salmankhann commented 6 years ago

Hi,

I have a geojson object that was converted from a topjson using the topojson-client's feature method. When I try to reconvert the same object using the topology method of the topojson-server, I get all objects as undefined.

How can I reconvert a geojson that was outputted by the feature method back to topojson? I want to do so to use the merge method to merge certain paths from the topojson-client.

tiagozc commented 6 years ago

I was having a similar problem as you and I took a long time (almost a day actually) to understand that we have to pass the geojson object as the value of a key in another object in topology method (the {foo: geojson} in docs), as this key (foo) will be a reference for the geojson data in topology.objects.foo. Just warning you in case your problem is the same as mine.