[gdal-dev] JPEG 2000 change geotransform via Python bindinds Gdal 3.2.0

Bucek, Lubomir lubomir.bucek at eox.at
Wed Nov 25 10:53:38 PST 2020


Dear all,
I did not want to file the following question as an issue, as I am not sure
if I am just not missing anything in configuration, so putting it as a
question here:

I am trying to change the geotransform of a JPEG2000 file and then save
back the content via Python bindings on Ubuntu 20.04 - gdal 3.2.0 (based on
osgeo/gdal:ubuntu-full-latest -
sha256:6a82b53f12945a3ba8ac168a7488d1cf5ecb351020f67c88abc6691275a70b68)

Following code:
ds = gdal.Open(input_filename, gdal.GA_Update)
ulx, xres, xskew, uly, yskew, yres = ds.GetGeoTransform()
... do something with geotransform
ds.SetGeoTransform(geotransform_new)
del ds
Throws me into this exception "USE_SRC_CODESTREAM=YES specified, but no
codestream found":
https://github.com/OSGeo/gdal/blob/master/gdal/frmts/openjpeg/openjpegdataset.cpp#L3718-L3722

How does this creationOption by default being False according to
https://gdal.org/drivers/raster/jp2openjpeg.html#creation-options come into
play while opening and saving an already existing file?
Using a workaround by saving the ds to a .vrt by gdal.Warp('output.vrt',ds)
works fine for me. I was just curious if I can disable the
USE_SRC_CODESTREAM after opening the JPEG2000 anyhow?

Thank you,
Best regards,


-- 
*Lubomir Bucek*

Geospatial IT Engineer

EOX IT Services GmbH
1090 Vienna, Thurngasse 8/4, Austria
T +43 (0) 660 369 7514, lubomir.bucek at eox.at <gerhard.triebnig at eox.at>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20201125/61fcff22/attachment.html>


More information about the gdal-dev mailing list