Closed scottyhq closed 1 year ago
Thanks for the report! IIUC, proj:shape
should be reversed ([21758, 28793]
for this item). What's the expected proj:bbox
?
@TomAugspurger that's correct. For bbox I expect the proj:xxxx metadata to match rasterio outputs:
Also see: https://github.com/stac-extensions/projection#projbbox # left, down, right, up
with rasterio.open(url) as src:
left = src.transform[2]
top = src.transform[5]
right, bottom = src.transform * (src.width, src.height)
# equivalent to list(src.bounds)
bbox = [left, bottom, right, top]
# [519100.0, 5236570.0, 807030.0, 5454150.0]
We've fixed the proj:shape
issue:
In [4]: pystac.read_file("https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-1-rtc/items/S1A_IW_GRDH_1SDV_20220805T015427_20220805T015452_044411_054CC1_rtc").properties["proj:shape"]
Out[4]: [21758, 28793]
Our partners at Catalyst are also looking into the proj:bbox
issue.
The proj:bbox
issues has been fixed as well now.
In [1]: import pystac
In [2]: pystac.read_file("https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-1-rtc/items/S1A_IW_GRDH_1SDV_20220805T015427_20220805T015452_044411_054CC1_rtc").properties["proj:shape"]
Out[2]: [21758, 28793]
In [3]: pystac.read_file("https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-1-rtc/items/S1A_IW_GRDH_1SDV_20220805T015427_20220805T015452_044411_054CC1_rtc").properties["proj:bbox"]
Out[3]: [519100.0, 5236570.0, 807030.0, 5454150.0]
(previously that was [523650.0, 5237390.0, 804660.0, 5453770.0]
)
Thanks again for the report and let us know how things go!
I noticed recently that
proj:shape
andproj:bbox
are incorrect for some S1 RTC products. According to https://github.com/stac-extensions/projection#projshape shape should be in Y,X order, but s1-rtc has it flipped:https://planetarycomputer.microsoft.com/api/stac/v1/collections/sentinel-1-rtc/items/S1A_IW_GRDH_1SDV_20220805T015427_20220805T015452_044411_054CC1_rtc
As a consequence it appears
proj:bbox
is also off (proj:transform
is fine):possibly related: https://github.com/gjoseph92/stackstac/issues/196