topojson/topojson-client

toposcale

mbostock opened this issue · 1 comments

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

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.