Skip to content

Improve "full 360" handling in BoundingBox and normalize_west_east_longitude - #566

Open
soxofaan wants to merge 3 commits into
masterfrom
ogd1974-normalize-full-longitude-range
Open

soxofaan wants to merge 3 commits into
masterfrom
ogd1974-normalize-full-longitude-range

Conversation

@soxofaan

Copy link
Copy Markdown
Member

Represent "full 360" longitude spans as [-180,180] (which is only valid, normalized representation of that case)

for #Open-EO/openeo-geopyspark-driver#1974 alternative to #564

…ngitude

Represent "full 360" longitude spans as [-180,180] (which is only valid, normalized representation of that case)

refs #Open-EO/openeo-geopyspark-driver#1974, #564

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The user-visible full-globe bounding-box change lacks the required changelog entry describing the full-360° normalization fix and its handling of floating-point imprecision.

1 open issue
What changed in this PR

This PR improves longitude normalization for full-globe bounding boxes, addressing shifted global raster extents such as AGERA5.

Changes:

  • Normalize spans of 360° or positive multiples to [-180, 180].
  • Allow small floating-point discrepancies when detecting full-globe spans.
  • Add regression tests for shifted extents, normalization boundaries, and geometry conversion.
File Description
tests/​util/​test_geometry.py Adds full-globe normalization and bounding-box regression tests.
openeo_driver/​util/​geometry.py Detects full-globe longitude spans and documents their canonical representation.

Review effort: Balanced

Comment thread openeo_driver/util/geometry.py Resolved
Comment thread openeo_driver/util/geometry.py Outdated
@@ -430,9 +430,20 @@ class CrsRequired(BoundingBoxException):
def normalize_west_east_longitude(west: float, east: float) -> Tuple[float, float]:

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This method is also defined in openeo-python-client. @dsamaey Should we delete it from python driver, and work further in python client?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was aware that normalize_west_east_longitude is in openeo-python-client too, but I would avoid over-coupling here. I'm even considering to make normalize_west_east_longitude private in python driver, as it becoming quite specific to the bounding box handling with this PR

Comment thread openeo_driver/util/geometry.py Resolved

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

There are no active review issues for the full-world longitude normalization change.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants