isce-framework / isce-framework/isce3
Improvement on Antimeridian handling logic
@gmgunter is already working on this.
Since Aug 27, 2025.
- Dominant language
- Python
- Stars
- 239
- Forks
- 90
- Avg merge
- 13d 1h
- Merged PRs (30d)
- 5
Description
What is the background?
The basic assumption on ISCE3 for antimeridian handling is that the width of a bounding box is no larger than 180 degrees in geographic coordinates. Let's say we have a case that [MinX, MaxX] = [-178, 178]. The difference between MaxX MinX is 356, which is larger than 180. As if violates the "180-degree" assumption, therefore the current antimeridian handling logic recognized MinX as East, and MaxX is West. In other words, [West, East] = [178, -178]. Wrapping them to [0, 360] becomes [178, 182] that satisfies the maximum longitudinal length.
What is the issue?
The internal PR discussion for #104 has raised a concern about the uni-intuitiveness of about which of MinX and MaxX are on west and east boundary respectively, which can be an issue when a polygon or bounding box crosses antimeridian. The "wrapping" routine do exist throughout the code, but they are rather scattered, and we need a better structure to handle the antimeridian handling logic.
Suggested solution
@gmgunter has suggested the antimeridian handling strategy as below to improve ISCE3:
- Add a wrapper for
Perimeter::getEnvelope()similar to this wrapper forBoundingBox::Merge()that takes care of unwrapping discontinuities at the antimeridian and swapping the endpoints so thatMinXis always the left edge andMaxXis always the right edge. - Add documentation to BoundingBox that clarifies that
MinXis always the left edge andMaxXis always the right edge, andMinX <= MaxX. - Remove the kludge from
getGeoBoundingBox(),_addMarginToBoundingBox(), andBoundingBox::Merge()that exists to work around this issue withPerimeter::getEnvelope().
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.