[gdal-dev] unable to create jpeg200 files with self compiled gdal and openjpeg

Even Rouault even.rouault at spatialys.com
Tue Jul 12 01:33:44 PDT 2016


> This code works for geotiff, but not for jpeg2000. There I'm getting the
> error: ERROR 6: GDALDriver::Create() ... no create method implemented
> for this format.

You cannot directly use Create() for any of the JPEG2000 drivers as Create() 
assumes random writing capabilities which the JPEG2000 format doesn't offer. So 
the solution is to create a temporary dataset (for example with the MEM driver 
if it fits into RAM, or with an intermediate GeoTIFF otherwise) and then 
CreateCopy() it to JPEG2000

Something like:

tmp_ds = 
# here I 
rb = tmp_ds.GetRasterBand(1)
dr.CreateCopy(fn, tmp_ds)
tmp_ds = None


Spatialys - Geospatial professional services

More information about the gdal-dev mailing list