[gdal-dev] Re: GeoJasper 1.4 beta suggested patch

David Fuhry dfuhry at acm.org
Sun Feb 10 15:25:50 EST 2008


Dmitry,

    Note: I've CCed gdal-dev at lists.osgeo.org , who may find this of
interest, or have some other JPEG2000 decoding thoughts.

Dmitry Fedorov wrote:
 > Hey David,
 >
 > That is true, jasper does not have any interface for partial decoding,
 > although it is not in any way a difficult thing to add with little c
 > knowledge (basically you would have to limit a number of wavelet levels
 > to decode), the problem is that no one wanted to contribute that for a
 > number of years. You might be interested to check out other jpeg2000
 > open source libraries, i know of at least two other projects.

That is good news.  Besides a lower-resolution rendering, we may only be
interested in only some sub-region (say, the upper-right corner) of the
original image.  The general query question is:
Given the (pixel) coordinates of a rectangle R = [minx,miny,maxx,maxy]
inside the image I, and the (pixel) dimensions* [width,height] of an
output canvas C, render subregion R of I onto C, without losing quality.

* (The canvas "dimensions" could alternatively be just a single scalar
value; the width & height of R will always be proportional to the width
& height of C)

I guess the subregion optimization can be achieved by just discarding a
tile from rendering if its bounds do not intersect R.  Would this be
relatively easy to implement also?

If geojasper could answer that query efficiently, then it could be put
into the same realm as Kakadu and ER SDK for geospatial applications.  I
noticed the OpenJPEG decoder [1] has parameters for "Reduce factor" and
"Layer number", but nothing for subregion bounds.  So my guess is that
while some open-source decoders do partial wavelet-level decoding, none
do tile discarding based on a query rectangle.

 > Frank's modification is more like a hack that gives one entry point to
 > write geotiff uuid box into jpeg2000 stream. geojasper is more of an
 > enhancement of jasper that provides standard way for metadata exchange,
 > fixes several decoding issues of jasper and adds geotiff support, both
 > modifications were made approximately at the same time and Frank's
 > tailors specifically inclusion of jasper into gdal framework, geojasper
 > tailors direct copy of tiff tags into jpeg2000. Therefore I don't see
 > much need in merging the two projects they are intrinsically different.

Thanks for the clarification.  (Eventual) gdal support is important to
me because mapserver uses the gdal interfaces to render raster images.
For example, currently, gdal doesn't recognize geojasper as
GeoJp2-capable, although it could (/should), since your interfaces are
there.  If geojasper could implement efficient rectangle querying,
geojasper would (I presume) replace Frank's hacked jasper in gdal,
increase geojasper's visibility, and maybe improve the chances of your
hard work making it back into jasper.  This is along the lines of a
vision expressed by Frank in a 2001 freegis-list posting [2].

Thanks,

Dave

[1] http://www.openjpeg.org/index.php?menu=doc
[2] http://intevation.de/pipermail/freegis-list/2001-September/000605.html



More information about the gdal-dev mailing list