I am reading in a world image PNG, reprojecting it, and writing it out. The
process, when I use
GridFormatFinder, takes about a minute or so. If I use WorldImageReader, it
takes twice as long.
In either case, it is unacceptably long. Perhaps I am not setting some
parameters correctly?
The file is 383KB
My code below.
try {
File rasterFile = new File("TestData/heathcote_max_vel.png");
/*
WorldImageFormat format = (WorldImageFormat)
GridFormatFinder.findFormat( rasterFile );
AbstractGridCoverage2DReader reader = format.getReader(rasterFile);
*/
WorldImageReader reader = new WorldImageReader(rasterFile, null);
GridCoverage2D myGridCov = reader.read(null);
GridCoverage2D reprojected = (GridCoverage2D)
Operations.DEFAULT.resample(myGridCov, CRS.decode("EPSG:2193"));
WorldImageWriter wiw = new WorldImageWriter(new
File("TestData/NZTM/heathcote_max_vel.png"));
ParameterValueGroup params =
reader.getFormat().getWriteParameters();
params.parameter(WorldImageFormat.FORMAT.getName().toString()).setValue("png");
GeneralParameterValue[] gpv =
{params.parameter(WorldImageFormat.FORMAT.getName().toString()) };
wiw.write(reprojected, gpv);
wiw.dispose();
} catch (IOException e) {
e.printStackTrace();
} catch (CoverageProcessingException e) {
e.printStackTrace();
} catch (NoSuchAuthorityCodeException e) {
e.printStackTrace();
} catch (FactoryException e) {
e.printStackTrace();
}
Thanx
Gaby
--
View this message in context:
http://osgeo-org.1560.x6.nabble.com/Why-does-writing-out-a-world-image-takes-minutes-tp5068335.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
GeoTools-GT2-Users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users