stactools-packages / sentinel2

stactools package for Sentinel-2
Other
16 stars 5 forks source link

bbox for antimeridian-crossing scenes is incorrect #149

Closed philvarner closed 7 months ago

philvarner commented 7 months ago

The scene in sentinel2/tests/data-files/S2A_MSIL2A_20230625T234621_N0509_R073_T01WCS_20230626T022157.SAFE/expected_output.json represents an antimeridian-crossing scene. This is two multipolygons, on on each side of the antimeridian. This would ideally have a bbox with a SW longitude of about -179 and NE longitude of about 179. However, it actually has a bbox:

"bbox": [
    -179.93085,
    68.372483,
    180.0,
    69.394461
  ]

which both doesn't actually cover the longitude of the data, because it stops short to the west of -180. This also isn't the "inverse" longitude, which is a common mistake when an antimerdian-crossing polygon is misinterpreted as an incorrectly-wound polygon that spans nearly all longitude.