conda-forge / rasterio-feedstock

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

Is there a way to install rasterio with WEBP support? #154

Closed d3netxer closed 3 years ago

d3netxer commented 4 years ago

Is there a way to install rasterio with WEBP driver?

ocefpaf commented 4 years ago

The support is in the gdal library used to build rasterio. Do you have a minimal example case that we can try to reproduce?

d3netxer commented 4 years ago

@ocefpaf maybe you can take a look at how I am trying to install it?

conda create --name rasterio_w_webp_test1 python=3.7

conda config --add channels conda-forge

conda install gdal libgdal

conda install rasterio

pip install rio-cogeo

Then I am using the rio cogeo command that uses WebP:

rio cogeo create -p webp input.tif output.tif

but I get the following error:

File "rasterio/shutil.pyx", line 139, in rasterio.shutil.copy
  File "rasterio/_err.pyx", line 205, in rasterio._err.exc_wrap_pointer
rasterio._err.CPLE_AppDefinedError: Cannot create TIFF file due to missing codec for WEBP.

I don't understand. If I use the command 'gdalinfo --formats' I see WEBP as a format.

xylar commented 3 years ago

I was able to run your test command. I already have conda-forge added to my channels and strict channel priority set.

$ conda create -y -n test python=3.7 gdal libgdal rasterio rio-cogeo boto3
$ conda activate test
$ rio cogeo create -p webp input.tif output.tif
/home/xylar/miniconda3/envs/test/lib/python3.7/site-packages/rio_cogeo/profiles.py:183: UserWarning: Non-standard compression schema: webp. The output COG might not be fully supported by software not build against latest libtiff.
  " supported by software not build against latest libtiff.".format(key)
Reading input: /home/xylar/Desktop/input.tif
Adding overviews...
Updating dataset tags...
Writing output to: /home/xylar/Desktop/output.tif

For my input.tif, I used https://github.com/mapbox/rasterio/blob/master/tests/data/cogeo.tif

I don't know enough about the expected result to know if my result was successful. eog shows a blank file but that may be its limitation.

@d3netxer, could you let me know if this is still an ongoing issue for you or if it can be closed?

xylar commented 3 years ago

I'm going to close this for now but it could be re-opened with some more details if it's still an ongoing issue.