To complete the example,
in case you want to write the coverage down as a png + pgw+ prj you'd
need to add:
final CoordinateReferenceSystem crs=... //the crs you are
working with
final RenderedImage image=... //your image
final GridCoverage2D gc=
CoverageFactoryFinder.getGridCoverageFactory(null).create("coverage",
image, crs, mt, null); //it should work even if you //provide null for
the sample dimension parameter
final StringBuffer buff = new
StringBuffer("./write/temp").append(".").append("png");
final File tempFile =TestData.temp(this, buff.toString());
// getting a writer
final WorldImageWriter wiWriter = new
WorldImageWriter(tempFile);
// writing parameters for png
final Format writerFormat = wiWriter.getFormat();
// setting write parameters
final ParameterValueGroup params =
writerFormat.getWriteParameters();
params.parameter(WorldImageFormat.FORMAT.getName().toString())
.setValue("png");
final GeneralParameterValue[] gpv = { params
.parameter(WorldImageFormat.FORMAT.getName().toString()) };
// writing
wiWriter.write(gc, gpv);
wiWriter.dispose();
Note that I have not tested this code with real data, so if you have
some problems please, report back to us.
Simone.
-------------------------------------------------------
Ing. Simone Giannecchini
GeoSolutions S.A.S.
Owner - Software Engineer
Via Carignoni 51
55041 Camaiore (LU)
Italy
phone: +39 0584983027
fax: +39 0584983027
mob: +39 333 8128928
http://www.geo-solutions.it
http://simboss.blogspot.com/
http://www.linkedin.com/in/simonegiannecchini
-------------------------------------------------------
On Tue, May 26, 2009 at 5:26 AM, Michael Bedward
<[email protected]> wrote:
> mt
------------------------------------------------------------------------------
Register Now for Creativity and Technology (CaT), June 3rd, NYC. CaT
is a gathering of tech-side developers & brand creativity professionals. Meet
the minds behind Google Creative Lab, Visual Complexity, Processing, &
iPhoneDevCamp asthey present alongside digital heavyweights like Barbarian
Group, R/GA, & Big Spaceship. http://www.creativitycat.com
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users