Context: geoProject rewinds polygons to put them in the correct order as [outer ring, …holes], creating MultiPolygons as necessary. This is the desired (and semi-documented) behavior, however it precludes using geoProject with transforms that map spherical geometries to the sphere.
This change allows to specify, with an optional spherical boolean flag, that the transform returns spherical coordinates. We can then call the relevant polygon winding algorithms: geoContains and a test on geoArea replace the planar contains and clockwise functions to determine is a ring is an outer ring or a hole.
For clarity, the change is kept minimal in this commit, but before we merge I will reformat it (whitespace).
Context: geoProject rewinds polygons to put them in the correct order as [outer ring, …holes], creating MultiPolygons as necessary. This is the desired (and semi-documented) behavior, however it precludes using geoProject with transforms that map spherical geometries to the sphere.
This change allows to specify, with an optional spherical boolean flag, that the transform returns spherical coordinates. We can then call the relevant polygon winding algorithms: geoContains and a test on geoArea replace the planar contains and clockwise functions to determine is a ring is an outer ring or a hole.
For clarity, the change is kept minimal in this commit, but before we merge I will reformat it (whitespace).
An older tentative was at: https://github.com/d3/d3-geo-projection/pull/146