GridCoverage(WritableRaster, ...) constructors fails for anything else than TYPE_FLOAT

Description

The following program:

org.geotools.demos.gc.FloatRasterDemo

work as expected when the raster's data type is TYPE_FLOAT. For all other types, it produces unexpected results or throws exception:

  • For TYPE_DOUBLE, it throws the following (simplified) exception,
    which sound like a bug in a Geotools's class:

IllegalArgumentException: Raster is incompatible with ComponentColorModelJAI
at java.awt.image.BufferedImage.<init>(BufferedImage.java:549)
at org.geotools.gc.GridCoverage.<init>(GridCoverage.java:445)
at org.geotools.gc.GridCoverage.<init>(GridCoverage.java:383)
at org.geotools.gc.GridCoverage.<init>(GridCoverage.java:334)
at org.geotools.gc.FloatRasterDemo.main(FloatRasterDemo.java:55)

  • For TYPE_INT and TYPE_SHORT, it throws the following (simplified)
    exception:

IllegalArgumentException: Raster is incompatible with IndexColorModel
at java.awt.image.BufferedImage.<init>(BufferedImage.java:549)
at org.geotools.gc.GridCoverage.<init>(GridCoverage.java:445)
at org.geotools.gc.GridCoverage.<init>(GridCoverage.java:383)
at org.geotools.gc.GridCoverage.<init>(GridCoverage.java:334)
at org.geotools.gc.FloatRasterDemo.main(FloatRasterDemo.java:55)

  • For TYPE_SHORT, an image is produced with the wrong color map.

  • For TYPE_BYTE, the following (simplified) exception is throws at
    rendering time:

ImagingOpException: Unable to transform src image
at AffineTransformOp.filter(AffineTransformOp.java:263)
at GraphicsJAI.drawRenderedImage(GraphicsJAI.java:473)
at RenderedGridCoverage.paint(RenderedGridCoverage.java:767)

Environment

None

Activity

Show:
codehaus
April 10, 2015, 3:14 PM

CodeHaus Comment From: desruisseaux - Time: Sat, 7 Jul 2007 05:49:56 -0500
---------------------
Changed "fix version" from 2.4 to "unknown" since this issue depends partially on JAI capabilities, and also on available resources on GeoTools side.

codehaus
April 10, 2015, 3:14 PM

CodeHaus Comment From: mbedward - Time: Sat, 22 May 2010 03:31:28 -0500
---------------------
closing old issue

Assignee

Unassigned

Reporter

codehaus

Triage

None

Components

Affects versions

Priority

Medium
Configure