[gdal-dev] Tilesize in JPEG2000 and gdalinfo
Rahkonen Jukka (MML)
jukka.rahkonen at maanmittauslaitos.fi
Tue Sep 5 02:20:14 PDT 2017
Thanks, Even.
This information may be less interesting once we have a released OpenJPEG driver that can handle big tiles properly.
The reason for my question was this error message that I got from my colleague who is cutting excerpts from a big VRT
Input file size is 1332094, 2304162
0...10...20...30...ERROR 1: Cannot decode tile, memory error
ERROR 1: opj_decode() failed
ERROR 1:
/vsicurl/http://kartat.kapsi.fi/files/orto/etrs-tm35fin/mara_v_25000_50/2013/N53/02m/1/N5144H.jp2,
band 1: IReadBlock failed at X offset 0, Y offset 0: opj_decode() failed
My guess is that error is due to this single tiled image. Most JPEG2000 images in the VRT are written with tilesize 1024x1024.
-Jukka-
Lähettäjä: Even Rouault [mailto:even.rouault at spatialys.com]
Lähetetty: 5. syyskuuta 2017 12:09
Vastaanottaja: gdal-dev at lists.osgeo.org
Kopio: Rahkonen Jukka (MML) <jukka.rahkonen at maanmittauslaitos.fi>
Aihe: Re: [gdal-dev] Tilesize in JPEG2000 and gdalinfo
Hi Jukka,
>
> If I run gdalinfo against the JPEG2000 image in
> http://kartat.kapsi.fi/files/orto/etrs-tm35fin/mara_v_25000_50/2013/N53/02m
> /1/N5144H.jp2 the JP2ECW driver reports the blocksize as (256x256) and
> JPEG2000OpenJPEG driver reports that the block size is (1024x1024).
Yes for single tiled images, all JPEG2000 drivers will report a block size
of much smaller dimension to avoid GDAL consuming too much memory.
>
> What interests me would be to know the fact that this image has only one
> JPEG2000 tile with a tilesize of (11754x11754). Is there any
> driver-independent way for getting this information?
You can use the opj_dump utility from openjpeg, or a GDAL Python script
https://svn.osgeo.org/gdal/trunk/gdal/swig/python/samples/dump_jp2.py
$ python swig/python/samples/dump_jp2.py /vsicurl/http://kartat.kapsi.fi/files/orto/etrs-tm35fin/mara_v_25000_50/2013/N53/02m/1/N5144H.jp2 | grep "siz\""
<Field name="Rsiz" type="uint16" description="Unrestricted profile">0</Field>
<Field name="Xsiz" type="uint32">11754</Field> <-- image width
<Field name="Ysiz" type="uint32">11754</Field> <-- image height
<Field name="XOsiz" type="uint32">0</Field>
<Field name="YOsiz" type="uint32">0</Field>
<Field name="XTsiz" type="uint32">11754</Field> <-- tile width
<Field name="YTsiz" type="uint32">11754</Field> <-- tile height
<Field name="Csiz" type="uint16">3</Field>
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170905/6b818812/attachment-0001.html>
More information about the gdal-dev
mailing list