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

Antimeridian support #243

Closed
twelch opened this issue Nov 14, 2023 · 0 comments · Fixed by #248
Closed

Antimeridian support #243

twelch opened this issue Nov 14, 2023 · 0 comments · Fixed by #248
Assignees

Comments

@twelch
Copy link
Contributor

twelch commented Nov 14, 2023

Background can be found here:

Assumptions:

  • When a polygon has coordinates that are on both sides of -180 or 180, then the polygon crosses the antimeridian.
  • When coordinates are on both ends of the antimeridian, they are always meant to connect by the shortest distance which is across the antimeridian, and not across the world the long way.
  • A polygon will never span the entire globe in the longitudinal direction (more than 360 degrees)

From that we can say:
If the distance between any two coordinates is greater than 180 degrees, then it has been crossed. This is true for the exterior ring of a polygon, and any interior ring (hole).

Proper split in QGIS:
image

Proper split in geojson.io:
image

SeaSketch Behavior

When drawing in SeaSketch using mapbox-gl-js, crossing the antimeridian in all cases I've found produces longitude values greater than 180 (right side):

                [
                    186.381385397,
                    -14.390078131
                ]

And there will be longitude values less than 180 (left side):

                [
                    170.387412007,
                    -14.240489787
                ]

Requirements

  • Antimeridian handling should be built-in. No need to enable for a project.
  • Always split vector geometries that cross the antimeridian into pieces
    • Vector datasources should be split on import (use -wrapdateline option)
    • Sketches should be split at runtime in geoprocessing functions using splitSketchAntimeridian(). This will also clean coordinates to be within -180 to 180, as well as the bounding box property.
    • The bounding box of the split sketch should be used to fetch features for other datasources
  • Upgrade fiji-reports to test this functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging a pull request may close this issue.

1 participant