d3-geo
d3-geo copied to clipboard
projection.prepreclip?
It’d be nice to be able to use d3.geoClipPolygon prior to rotation for clipping in geographic coordinates (as opposed to using rotated coordinates with projection.preclip, as is suitable for the outline of an interrupted projection).
If what we want is to clip a geojson with a polygon, this is a geometric operation that should happen on the sphere. It’s not clear to me why this would be tied to the projection.
Related:
- https://github.com/d3/d3-geo-polygon/issues/22 (almost a solution)
- https://observablehq.com/@d3/spherical-clipping (a use case)
Also that particular use case is arguably better served by planar post-clipping projection.clipExtent https://observablehq.com/d/c613d80805786986
but of course this currently allows only rectangle extents. It would be cool to allow arbitrary geometry planar post-clipping.
See also https://github.com/d3/d3-polygon/issues/4