Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WRAPDATELINE=YES skips geometries with vertices that have longitude = +/- 180 values. #8645

Closed
edzer opened this issue Nov 1, 2023 · 1 comment · Fixed by #8650
Closed
Assignees

Comments

@edzer
Copy link
Contributor

edzer commented Nov 1, 2023

Expected behavior and actual behavior.

This came up here: r-spatial/sf#2250

I expect OGRGeometryFactory::transformWithOptions() with option WRAPDATELINE=YES to wrap a geometry such that it does not cross +/- 180. The actual (undocumented?) behavior is that geometries that have vertices with longitude exactly equal to +/- 180 are assumed to have been wrapped, and are skipped (see here). We noticed this using polygons generated by the s2geometry library, which intentionally cross the dateline (they should). For plotting such polygons on plate carree one needs to wrap at the dateline. I think the assumption made in the comment linked above is wrong.

Steps to reproduce the problem.

see above, but it also shows when wrapping LINESTRING(-179 0,-180 0,179 0)

Operating system

Ubuntu 22.04

GDAL version and provenance

GDAL 3.6.2

@rouault rouault self-assigned this Nov 2, 2023
rouault added a commit to rouault/gdal that referenced this issue Nov 2, 2023
…euristics about points exactly at +/- 180 (fixes OSGeo#8645)

This heuristics had been added in cef50ff, but it doesn't seem to
be any longer needed since the added test case in that commit still pass
without it.
rouault added a commit to rouault/gdal that referenced this issue Nov 2, 2023
…euristics about points exactly at +/- 180 (fixes OSGeo#8645)

This heuristics had been added in cef50ff, but it doesn't seem to
be any longer needed since the added test case in that commit still pass
without it.
@edzer
Copy link
Contributor Author

edzer commented Nov 3, 2023

Confirmed - thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants