d3 / d3-geo-projection

Extended geographic projections for d3-geo.
https://observablehq.com/collection/@d3/d3-geo-projection
Other
1.1k stars 201 forks source link

geoquantize (#122) #148

Closed Fil closed 6 years ago

Fil commented 6 years ago

We do need geoquantize as a separate script if we want to quantize spherical GeoJSON.

TL;DR: geoproject 'd3.geoIdentity()' -p 3 does not work properly because geoproject reorders the projected polygons+holes based on their planar coordinates, but this is the case where the output is in spherical coordinates and the polygons should not be reordered (at all), or, if we want to reorder them, not based on the test in src/project/clockwise.js (which is testing winding order for planar polygons).

To test, just project South Africa with the hole around Lesotho.

(Cleaned up the mess in PR #140.)