topojson / topojson-client

Manipulate TopoJSON, such as to merge shapes, and convert it back to GeoJSON.
ISC License
213 stars 63 forks source link

toposcale #4

Closed mbostock closed 7 years ago

mbostock commented 7 years ago

It’d be nice to have a binary for taking projected, planar TopoJSON as input and then modifying the transform (or computing the transformed coordinates, if there is no transform) so that the TopoJSON fits in the desired bounding box. It should also support --invert for flipping the y-dimension, as Proj4 and other projection systems typically use the other y direction than Canvas and SVG.

https://github.com/topojson/topojson/blob/v1.6.27/lib/topojson/scale.js

mbostock commented 7 years ago

I think it’d be slightly more flexible to do this in GeoJSON space as geoscale. TopoJSON has the advantage that you can just modify the transform rather than modifying the coordinates… but geoscale lets you rescale and flip GeoJSON without converting to TopoJSON.