conda-forge / rasterio-feedstock

A conda-smithy repository for rasterio.
BSD 3-Clause "New" or "Revised" License
43 stars 23 forks source link

rasterio 1.1.3 does not preserve CRS information, older version installed with pip does #158

Closed rbavery closed 4 years ago

rbavery commented 4 years ago

I originally reported this issue on the rasterio github but the maintainer tested this out and indicated that it was an issue with conda package or my environment since pip installed rasterio was able to keep the CRS info.

See this issue: https://github.com/mapbox/rasterio/issues/1897

Expected behavior and actual behavior.

rasterio version 1.0.23 (installed from pypi) can correctly read in a Landsat ARD geotiff with the CRS info

import rasterio
src = rasterio.open('/home/rave/solaris/solaris/data/nebraska_landsat5_with_nodata_wgs84.tif')
src
<open DatasetReader name='/home/rave/solaris/solaris/data/nebraska_landsat5_with_nodata_wgs84.tif' mode='r'>
src.crs
CRS.from_epsg(4326)

But with the newest version, 1.1.3 (installed from conda), rasterio.open does not read the CRS info. The crs is None.

import rasterio
src = rasterio.open('/home/rave/solaris/solaris/data/nebraska_landsat5_with_nodata_wgs84.tif')
src
<open DatasetReader name='/home/rave/solaris/solaris/data/nebraska_landsat5_with_nodata_wgs84.tif' mode='r'>
src.crs
None

The file is linked here: https://ucsb.box.com/s/wyda693k599g2fww2ybrnf7c45mxk55s

rbavery commented 4 years ago

After installing and reinstalling the same version of rasterio with conda, I get a different error related to CRSs when I try to run rasterio.warp.calculate_default_transform

rasterio.errors.CRSError: Unable to open EPSG support file gcs.csv.  Try setting the GDAL_DATA environment variable to point to the directory containing EPSG csv files.
rbavery commented 4 years ago

It turns out this issue was from the VSCode debugger terminal not reading some GDAL configs properly. Running pytest in a regular terminal solves the issue.

ocefpaf commented 4 years ago

Can you fill required info for the issue? It is in the issue template, you probably pasted over it when posting this.