On mercredi 15 février 2017 07:04:06 CET CGA wrote: > Dear all, > > I'm struggling with the Python bindings of GDAL + Kakadu. I'm trying to clip > a small part of an input image in .jp2 and write it inside another .jp2 > file. > > I read that the JP2KAK images can only be created using the CreateCopy() > method. Here is my workflow : > - Open input dataset > - Clip image using ReadAsArray (load into a numpy array) > - Create a new dataset (using MEM or GTiff driver) > - Write clipped array in new dataset > - Convert created dataset to JP2 using JP2KAK driver CreateCopy() method > > As a result, I get a JP2 image that contains only one value : 32768 .... > When using the intermediate GTiff driver, I confirmed that the intermediate > dataset is valid. > > Here is the code used : > > > I also tried the following simple script that seems to be working fine (the > script only CreateCopy of an existing JP2 dataset) : > > > Is there anything wrong in the way I'm creating the JP2 clipped dataset in > the first script ?
Does a simple gdal_translate in.jp2 out.jp2 -of JP2KAK work ? I believe there is (or was) signedness issues with 16 bit integers. -- Spatialys - Geospatial professional services http://www.spatialys.com
_______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
