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

reading a zipped raster does not return the CRS #803

Open
sgascoin opened this issue Sep 27, 2024 · 1 comment
Open

reading a zipped raster does not return the CRS #803

sgascoin opened this issue Sep 27, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@sgascoin
Copy link

I was happy to find out that rioxarray is able to read a zipped GeoTIFF file using the same syntax as rasterio

xda = xarray.open_dataarray('zip:file.zip/image.tif')

However, the CRS is empty in the returned dataarray. This does not happen when I read a (non-zipped) GeoTIFF file.

I do get the CRS from the same zipped file when I use rasterio. Then, I can set the CRS using write_crs as a workaround.

import rasterio as rio
with rio.open('zip:file.zip/image.tif') as src:
    crs = src.crs
xda.rio.write_crs(crs, inplace=True)

Installation method

conda

Conda environment information (if you installed with conda):

gdal 3.5.0 py39hc691d54_1 conda-forge
libgdal 3.5.0 hd0aedcd_1 conda-forge
rasterio 1.2.10 py39h20899d1_6 conda-forge
rioxarray 0.10.2 pyhd8ed1ab_0 conda-forge
xarray 2022.3.0 pyhd8ed1ab_0 conda-forge

@sgascoin sgascoin added the bug Something isn't working label Sep 27, 2024
@snowman2
Copy link
Member

You are using outdated versions of all libraries. Please update to the latest and check if it is still an issue.
Also, please provide a minimal file that can re-produce this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants