Search code examples
macosrastergdaldata-conversiongeotiff

How to convert jp2000 to geotiff using GDAL?


I'm trying to convert Sentinel-2 imagery in jp2000 (.jp2) format to geotiff format using gdal_translate. However, it appears .jp2 format is not recognized. What method should I use to convert jp2000 format to geotiff?

$ gdal_translate B02.jp2 B02.tif
ERROR 4: `B02.jp2' not recognised as a supported file format.

GDALOpen failed - 4
`B02.jp2' not recognised as a supported file format.

Solution

  • If you are on macOS and want JP2000 with GDAL, one option is to use homebrew to install it like this:

    brew install gdal --with-complete
    

    Then you get this:

    gdalinfo --formats | grep -i jp
    
      JPEG (rwv): JPEG JFIF
      JPEG2000 (rwv): JPEG-2000 part 1 (ISO/IEC 15444-1)