Hello,
 
I have some big, on-fly generated 16 bit raster images (color model is 
DirectColorModel) from another service which I use as source images for 
GridCoverage2D. Their BufferedImage type is BufferedImage.TYPE_USHORT_555_RGB.
 
However creating grid coverage fails:
 
BufferedImage image = ImageIO.read(filename);
GridCoverage2D grid = factory.create("results", image, new 
ReferencedEnvelope(y1, y2, x1, x2, crs));

->
 
Exception in thread "BackgroundImageRenderer-0" 
java.lang.IllegalArgumentException: Illegal argument: "type=null".
        at org.geotools.coverage.TypeMap.map(TypeMap.java:407)
        at org.geotools.coverage.TypeMap.isFloatingPoint(TypeMap.java:362)
        at 
org.geotools.coverage.grid.RenderedSampleDimension.create(RenderedSampleDimension.java:252)
        at 
org.geotools.coverage.grid.RenderedSampleDimension.create(RenderedSampleDimension.java:138)
        at 
org.geotools.coverage.grid.GridCoverage2D.<init>(GridCoverage2D.java:233)
        at 
org.geotools.coverage.grid.GridCoverageFactory.create(GridCoverageFactory.java:590)
        at 
org.geotools.coverage.grid.GridCoverageFactory.create(GridCoverageFactory.java:514)
        at 
org.geotools.coverage.grid.GridCoverageFactory.create(GridCoverageFactory.java:455)
 
BufferedImage.TYPE_BYTE_INDEXED and BufferedImage.TYPE_INT_RGB work fine, but 
the native format of the picture is TYPE_USHORT_555. Conversion takes time and 
BYTE_INDEXED loses quality and TYPE_INT_RGB takes too much memory.
 
>From the code of TypeMap it seems that it should support 16 bit images.
 
    Markus
 
    

------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to