stactools-packages / landsat

stactools package for working with LANDSAT data
Other
4 stars 6 forks source link

EPSG codes incorrect for southern hemisphere #12

Closed scottyhq closed 2 years ago

scottyhq commented 2 years ago

https://planetarycomputer.microsoft.com/api/stac/v1/collections/landsat-8-c2-l2/items/LC08_L2SP_232082_20210918_02_T1 shows "proj:epsg": 32719

It's a bit surprising the asset geotiffs are actually stored with UTM North CRS as explained here https://www.usgs.gov/faqs/why-do-landsat-scenes-southern-hemisphere-display-negative-utm-values?qt-news_science_products=0#qt-news_science_products , so it should be "proj:epsg": 32619

AWS_REQUEST_PAYER=requester gdalinfo /vsis3/usgs-landsat/collection02/level-2/standard/oli-tirs/2021/232/082/LC08_L2SP_232082_20210918_20210925_02_T1/LC08_L2SP_232082_20210918_20210925_02_T1_SR_B4.TIF

Driver: GTiff/GeoTIFF
Files: /vsis3/usgs-landsat/collection02/level-2/standard/oli-tirs/2021/232/082/LC08_L2SP_232082_20210918_20210925_02_T1/LC08_L2SP_232082_20210918_20210925_02_T1_SR_B4.TIF
Size is 7741, 7811
Coordinate System is:
PROJCRS["WGS 84 / UTM zone 19N",
...

The discrepancy causes issues when opening assets with libraries like stackstac that rely on reading proj:epsg rather than opening and getting metadata from the tif files themselves.

@lossyrob @TomAugspurger is this the correct place to report issues with metadata for the planetary computer? https://planetarycomputer.microsoft.com/dataset/landsat-8-c2-l2#overview

lossyrob commented 2 years ago

Thanks for reporting! We'll work on getting a fix for this.

The fix will make it's way here before the planetary computer API, so I feel like this is a good venue to report these types of issues.

pjhartzell commented 2 years ago

Fixed in #13.