4

Am operating on OSX(latest) have gdal installed and rasterio (both from conda versions 2.1.3 and 1.0xxx. I can read tiff perfectly but jp2 files (aka from Sentinel-2 sat).

When I search for installed gdal drivers the ones for jp2 are on the list. I have attempted to remove gdal via conda and reinstall with no luck. Am not looking to use brew as it has a pre 2.0 version and i need 2.1 functionality.

How can i install this driver?

0

2 Answers 2

2

The GDAL installed by conda is broken and does not include the OpenJPEG JPEG2000 driver. You need to install the GDAL packaged by conda-forge Either uninstall GDAL and then reinstall using the conda-forge channel or create a fresh environment. If you choose to uninstall/reinstall, you will almost certainly get lots of dependency conflicts and have to mess around resolving them. It's much easier to create a fresh conda environment:

conda create -n mynewenv -c conda-forge gdal rasterio
2
  • Suspect that somehow the jp2000 driver within gdal got hosed. As other programs that read jp2 with gdal are also not working correctly. Tried as above but (new environment), have the same problem...
    – Rob Wade
    Aug 3, 2017 at 2:06
  • Update....got it working with the virtual environment! Thanks for the quick and clear help!
    – Rob Wade
    Aug 3, 2017 at 2:30
0

If someone uses macports to install GDAL, use the openjpeg variant which is not added by default. Note that it will probably trigger a build from source (might take a few minutes).

sudo port install gdal +openjpeg

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.