stactools-packages / sentinel2

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

use antimeridian package for creating bbox #150

Closed philvarner closed 7 months ago

philvarner commented 7 months ago

Related issues

Description

For antimeridian-crossing scenes, the bbox calculation from shapely was incorrect, such that the bbox was both too large (e.g., spanning almost the entire globe), and didn't quite actually cover the scene (e.g., missing a bit of longitude along the AM). This fixes that, and rounds the values to the standard 6 decimal places.

For example, a bbox like

"bbox": [
    -179.72957,
    -17.25485,
    180.0,
    -16.247763
  ],

is obviously wrong, because it spans nearly the entire longitude, from -179.7 to 180, but misses -180 to -179.7 -- so it both covers too much area (e.g, about 356 degrees too much!) and misses the 0.3 degrees to the east of the antimeridian. This bbox should have a SW lon coordinate that's like 178 and a NE lon coordinate that's like -178, which indicates that it actually does cross the AM, rather than spanning the entire globe.

Checklist