Simone Giannecchini ha scritto:
> Ciao Gabriella,
> I understand you are trying to create a GridCoverage2D from a
> worldimage whose raster is a jpeg image.
>
> If this guess is correct then the code you are using is incorrect.
>
> A correct snippet of code to cope with your needs would be as follows:
>
> // get a reader
> final WorldImageReader wiReader = new WorldImageReader(new
> File("data/nz2_2.jpg"));
>
> // get the coverage
> final GridCoverage2D gc = (GridCoverage2D) wiReader.read(null);
>
Btw, if you're setting up a MapContext for map display, don't forget to use
the new
DefaultMapContext.addLayer(AbstractGridCoverage2DReader reader, Style
style) {
method that, as you can see, accepts a reader instead of a grid coverage.
This is in general much faster than loading the grid coverage because
the rendering
subsystem can communicate directly with the storage subsystem, allowing for
extra optimizations.
Cheers
Andrea
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users