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

interrupted projections sometimes have partially undefined inverse #204

Open cambecc opened 3 years ago

cambecc commented 3 years ago

Using d3-geo-projection 3.0.0, an interrupted projection's inverse is sometimes partially undefined, depending on the shape of the interruption.

For an example, see https://bl.ocks.org/cambecc/eb1380f8cb0da3d4142e870a3a6b623b.

Screen Shot 2021-01-17 at 13 04 19

The first projection is "Interrupted Mollweide Oceans" from https://observablehq.com/@d3/interrupted-mollweide-oceans. The blue pixels represent the screen coordinates where the projection's inverse is defined. Note that only part of the globe is colored blue.

The second projection is a slightly modified "Interrupted Mollweide Oceans", where the lobes are adjusted to land on the equator rather than ±5° lat. In this case, the globe is fully blue because the projection's inverse is now defined for all screen coordinates inside the bounds of the globe.

I do not know if this is expected behavior or not, but it seems close enough to raise as an issue.

Fil commented 3 years ago

Confirmed. And it reminds me that the forward projection is wrong too (#178).

Fil commented 3 years ago

Related issue: when the connection between lobes is not made on the Equator, the map is wrong. The following video demonstrates an (exaggerated) view of the problem: the connections between the two lobes on the left should be a vertex in projected space, not a segment (like they are on the right).

https://user-images.githubusercontent.com/7001/104856498-4a41a980-5913-11eb-89ee-8f4c8af970f3.mov

Remarks: