Christian Madsen a écrit :
My goal is to display a GridCoverage2D (and benefit from the zoom/rotate/pane viewmenu)

[...snip...]

But I experience problem when trying to display a GridCoverage2D in a StyledMapPane:


My code:
------------------------------------
[...]
BufferedImage bi = new BufferedImage(width, height,
        BufferedImage.TYPE_INT_RGB);
[...]
GridCoverage2D gc = new GridCoverage2D("My colored coverage",
        bi,
        DefaultGeographicCRS.WGS84,
        envelope, null, null, null);
[...]

The error I get:
------------------------------------
java.lang.IllegalStateException: Some categories use non-integer sample values.
at org.geotools.coverage.GridSampleDimension.getCategoryNames(GridSampleDimension.java:686)


Did you tried with an indexed color model instead of RGB? I mean:

BufferedImage bi = new BufferedImage(width, height,
        BufferedImage.TYPE_BYTE_INDEXED);

        Martin.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users

Reply via email to