rasterio / rasterio-wheels

MIT License
11 stars 16 forks source link

Can't read rasters with LERC compression #120

Closed chandley564 closed 5 months ago

chandley564 commented 6 months ago

Expected behavior and actual behavior.

While opening a raster compressed using LERC encoding I get the following error 'Cannot open TIFF file due to missing codec LERC.' The raster opens with no issue using rasterio version 1.2.10.

Steps to reproduce the problem.

import rasterio as rio

path_to_lerc_encoded_raster = ...

rio.open(path_to_lerc_encoded_raster)

For example: a brief script with required inputs.

Environment Information

rasterio info: rasterio: 1.3.9 GDAL: 3.6.4 PROJ: 9.0.1 GEOS: 3.11.2 PROJ DATA: C:\Users\...\.venv\Lib\site-packages\rasterio\proj_data GDAL DATA: C:\Users\...\.venv\Lib\site-packages\rasterio\gdal_data

System: python: 3.11.5 (tags/v3.11.5:cce6ba9, Aug 24 2023, 14:38:34) [MSC v.1936 64 bit (AMD64)] executable: C:\Users\...\.venv\Scripts\python.exe machine: Windows-10-10.0.19045-SP0

Python deps: affine: 2.4.0 attrs: 23.1.0 certifi: 2024.02.02 click: 8.1.7 cligj: 0.7.2 cython: None numpy: 1.26.4 snuggs: 1.4.7 click-plugins: None setuptools: 65.5.0

Installation Method

"""pip install rasterio"""

sgillies commented 6 months ago

@chandley564 For Windows wheels, Rasterio is relying on vcpkg. I just checked the version of vcpkg that was used for the 1.3.9 wheels and it looks like the LERC extension for TIFF was not be enabled: https://github.com/microsoft/vcpkg/blob/b40de44891dc1cab11d4722094ae44807a837b98/ports/tiff/vcpkg.json.

In https://github.com/microsoft/vcpkg/pull/35471, I do see that LERC support is available now. Thus we should be able to provide it for the 1.4.0 release, or maybe even in one of the next 1.4 pre-releases.

Rasterio didn't provide 1.2.10 binaries for Windows: https://pypi.org/project/rasterio/1.2.10/#files. I'm 99% sure we've never provided a Windows wheel that supports LERC.

sgillies commented 5 months ago

Fixed. Windows wheels for 1.3.10 have TIFF with LERC compression.