Borealis
Borealis

Reputation: 8480

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.

Upvotes: 4

Views: 5574

Answers (2)

Yu Tao
Yu Tao

Reputation: 798

This is because the jasper jp2 driver in gdal cannot handle big jp2 files. Also, there is no easy way of changing the jp2 driver of gdal.

So, simply install Kakadu from: http://kakadusoftware.com/downloads/

Then convert your large jp2000 file to geotiff using Kakadu: kdu_expand -i input.JP2 -o output.tif -num_threads 4

Then you can use your gdal functions with the converted geotiff.

Upvotes: 2

Mark Setchell
Mark Setchell

Reputation: 207748

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)

Upvotes: 4

Related Questions