stewart715
stewart715

Reputation: 5647

'presimplification' of GeoJSON

As you know, topojson.presimplify adds a z value to each of the coordinates to demonstrate its significance at certain zoom levels, so that the renderer isn't wasting time rendering points that the human eye isn't likely to see anyways.

http://bl.ocks.org/mbostock/7755778

I have some topojson I've loaded into the browser. Problem is: I need to parse that TopoJSON (which converts it to GeoJSON) before rendering and so that I can apply an algorithm to make some manipulations which adds some interpolated coordinates. This makes topojson.presimplify impossible. And even if I presimplify it before parsing the features, they are lost after my manipulations (because of the new data points).

Since topojson.presimplify uses its shared arcs system to determine the z value, I can't retro fit that code to work with GeoJSON. Is there any way to determine the Z value on GeoJSON data short of converting back to TopoJSON after manipulating it?

Upvotes: 1

Views: 132

Answers (1)

am_
am_

Reputation: 2418

Might be a late answer, but you can take a look at https://github.com/mapbox/geojson-vt and https://www.mapbox.com/blog/introducing-geojson-vt/ which filters and simplifies GeoJSON data on the fly.

Upvotes: 1

Related Questions