[gdal-dev] Outside of Image Area Warnings gdal_translate
Even Rouault
even.rouault at mines-paris.org
Wed May 21 06:41:11 PDT 2014
Le mercredi 21 mai 2014 15:34:40, David Fawcett a écrit :
> Thank you Even.
>
> My input images came from an external source, so I have no control over
> them. Are you suggesting that I tile the output? I don't see a creation
> option of TILED=YES for OpenJPEG, it looks like I would have to use one of
> the commercial libraries.
That's controlled by the BLOCKXSIZE and BLOCKYSIZE options. They imply tiling.
But, by default, the openjpeg driver will tile the images with a tile size of
1024.
On the contrary if you wanted a single-tile image, you would have to set
BLOCKXSIZE and BLOCKYSIZE to the dimensions of the raster.
>
> David.
>
>
> On Wed, May 21, 2014 at 7:21 AM, Even Rouault
>
> <even.rouault at mines-paris.org>wrote:
> > Le mercredi 21 mai 2014 13:39:43, David Fawcett a écrit :
> > > I am running gdal_translate to composite image tiles in a vrt and
> > > reduce the output image size. I ran it at outsize 50% 50% and
> > > received no warnings. When I bumped the outsize up to 75%, I got
> > > quite a few
> >
> > warnings
> >
> > > like the one below.
> > >
> > > Warning 1: Right position of the decoded area (region_x1=5120) is
> > > outside the image area (Xsiz=5000).
> > >
> > > This one gave no warnings:
> > > gdal_translate img_index.vrt mpls50.jp2 -outsize 50% 50% -of
> > > JP2OpenJPEG -co QUALITY=25 --config GDAL_MAX_DATASET_POOL_SIZE 10
> > >
> > > This one produced warnings
> > > gdal_translate img_index.vrt mpls7575.jp2 -outsize 75% 75% -of
> >
> > JP2OpenJPEG
> >
> > > -co QUALITY=75 --config GDAL_MAX_DATASET_POOL_SIZE 10
> > >
> > > GDAL version is 1.10
> > >
> > > Any suggestions on how to avoid the warnings?
> >
> > The warning come from the openjpeg library and suggests that the GDAL
> > driver
> > issue an invalid query extending over the right of an image. Which is
> > indeed
> > the case. I've just fixed it with http://trac.osgeo.org/gdal/ticket/5480
> >
> > Looking at the openjpeg code, it looks like it should properly adjust the
> > request to what expects the GDAL driver, so the end result should be OK.
> >
> > The fact that you get the warning at some subsampling ratio and not at
> > others
> > come from the fact that the overview dimensions are not the same and the
> > GDAL
> > driver adjusts its strategy how to work with openjpeg API (there's a tile
> > API
> > and a window API. The last one was the one that issued the warning)
> >
> > Another thing I wanted to mention is that the fact you ran into this
> > issue reveals that your JPEG2000 images are mono-tile. Which is OK per
> > se. The OpenJPEG library just doesn't work very efficiently with such
> > images (basically
> > even if you need one pixel, it will decode the whole image). Other
> > JPEG2000 libraries are able to use other JPEG2000 mechanisms to operate
> > more efficiently.
> >
> > > Thanks,
> > >
> > > David.
> >
> > --
> > Geospatial professional services
> > http://even.rouault.free.fr/services.html
--
Geospatial professional services
http://even.rouault.free.fr/services.html
More information about the gdal-dev
mailing list