Hello,
My name is Andrei, and I recently started working on the 2D raster
rendering part of deegree3, that is going to be used in particular in WMS.
I think I found a off-by-1 bug in the RasterFactory or ImageIO classes.
The test applet (module core)
org.deegree.rendering.r2d.RasterRendererApplet loads an image (car.jpg)
as an AbstractRaster object and tries to apply a Categorize function on
it. The loop over all the pixels reveals an error when trying to
retrieve the last "pixel" of the raster, from the lower-right corner.
Here is a stack trace:
[12:20:35] DEBUG: [Raster2RawData] Raster has size 308 x 400
[12:20:35] ERROR: [Raster2RawData] Error while parsing raster data, @
row=307, col=399
java.lang.IndexOutOfBoundsException
at java.nio.Buffer.checkIndex(Buffer.java:520)
at java.nio.HeapByteBuffer.getShort(HeapByteBuffer.java:289)
at
org.deegree.coverage.raster.data.nio.ByteBufferRasterData.getShortSample(ByteBufferRasterData.java:559)
at
org.deegree.coverage.raster.data.nio.ByteBufferRasterData.getShortPixel(ByteBufferRasterData.java:553)
at
org.deegree.rendering.r2d.utils.Raster2RawData.parse(Raster2RawData.java:133)
at
org.deegree.rendering.r2d.Java2DRasterRenderer.render(Java2DRasterRenderer.java:123)
I am stuck with this. Any ideas? And btw, if I convert the raster to a
BufferedImage and then back to a raster, the error above disappears. So
this is might be a bug in the ImageIO classes or in RasterFactory.
I also have a conceptual question. The SE spec describes that it is
possible to apply a Categorize function to a raster. If the raster has
only one band, then it's simple. But if the raster contains multiple
bands (from a RGB image), what value should I use to search in the
lookup table? (I wrote org.deegree.raster.r2d.utils.Raster2RawData
class, that converts a Raster to a Float matrix)
Cheers,
Andrei
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf_______________________________________________
deegree-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/deegree-devel