Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

STAC to eo3 conversions fails when CRS is not an EPSG code (rasterio 1.4.2+) #622

Open
omad opened this issue Nov 26, 2024 · 0 comments
Open

Comments

@omad
Copy link
Member

omad commented Nov 26, 2024

Some of the dc_tools use a built in STAC to eo3 converter in the apps/dc_tools/_stac.py. In particular, the tools for indexing the Copernicus DEM and ESA Worldcover products.

This conversion function doesn't handle CRSs in any form that isn't an EPSG code.

In rasterio 1.4.2+ it's not returning a dataset CRS as WKT2, whereas older versions returned it as a CRS.

rasterio 1.4.2

(Pdb) dataset.crs
CRS.from_wkt('GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]]')

rasterio 1.4.1

(Pdb) dataset.crs
CRS.from_epsg(4326)
(Pdb) interact
*interactive*
>>> import rasterio
>>> rasterio.__version__
'1.4.1'

This can be fixed by either updating the stac_transform() function, which shouldn't be too hard.

The better long term option is to use a different conversion function from odc-stac or eo-datasets. See: #615

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant