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

bbox and proj:bbox are incorrect for antimeridian-crossing scenes #66

Open
philvarner opened this issue Dec 8, 2023 · 0 comments
Open
Labels
bug Something isn't working

Comments

@philvarner
Copy link

Describe the bug
bbox and proj:bbox are incorrect for antimeridian-crossing scenes

For example, this item https://earth-search.aws.element84.com/v1/collections/landsat-c2-l2/items/LC09_L2SR_074069_20231202_02_T2

has geometry

{
"type": "MultiPolygon",
"coordinates": [
[
[
[
-180,
-13.959297847971616
],
[
-179.52630375390157,
-14.05925204290674
],
[
-179.1508548158289,
-12.324431209402446
],
[
-180,
-12.146105277305576
],
[
-180,
-13.959297847971616
]
]
],
[
[
[
180,
-12.146105277305576
],
[
179.16755667528403,
-11.97128684276108
],
[
178.7800788630643,
-13.701883447644253
],
[
180,
-13.959297847971616
],
[
180,
-12.146105277305576
]
]
]
]
}

but bbox

[
110.735828,
-14.081215,
-111.134293,
-11.948248
],

This bbox correctly has a SW longitude that is to the east of the NE longitude, as the bbox should cross the antimeridian. The bbox does cover the geometry (I think?), however, the bbox spans ~222 deg longitude, when it should span ~3 deg.

I don't have an example of the proj:bbox for this, but I can see from the code that it's wrong, since it does a simple min/max calculation, not accounting for the SW-east-of-NE longitude issue with antimeridian-spanning scenes.

def proj_bbox(self) -> List[float]:
  ...
 return [min(xs), min(ys), max(xs), max(ys)]

To reproduce

  1. Generate metadata for a scene over the antimeridain
  2. see that bbox and proj:bbox and geometry don't match

Expected behavior

The bbox and proj:bbox compactly represent the antimeridian-spanning scene geometry.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant