You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The item https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-1-grd/items/S1B_IW_GRDH_1SDV_20211221T183044_20211221T183109_030127_0398F3 crosses the antimeridian. The geometry is appropriately a "split" MultiPolygon. However, the bbox is incorrect, as spans the entire glob instead of crossing the antimeridan:
I've been using the following code to deal with this (for GeoDataFrames), but would love a more robust fix
defgpdf_bounds(gpdf: GeoDataFrame) ->List[float]:
"""Returns the bounds for the give GeoDataFrame, and makes sure it doesn't cross the antimeridian."""bbox=gpdf.to_crs("EPSG:4326").bounds.values[0]
bbox_crosses_antimeridian=bbox[0] <0andbbox[2] >0ifbbox_crosses_antimeridian:
bbox[0] =-179.9999999999bbox[2] =179.9999999999returnbbox
The item
https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-1-grd/items/S1B_IW_GRDH_1SDV_20211221T183044_20211221T183109_030127_0398F3
crosses the antimeridian. The geometry is appropriately a "split" MultiPolygon. However, the bbox is incorrect, as spans the entire glob instead of crossing the antimeridan:A fix and/or inspiration for a fix can be found in the antimeridan library, which correctly splits antimeridian-spanning polygons into multipolygons and fixes the bbox in https://antimeridian.readthedocs.io/en/stable/api.html#antimeridian.fix_geojson (similar code also exists in the stactools.core.utils.meridian package).
The text was updated successfully, but these errors were encountered: