From: Martin D. <mar...@no...> - 2005-06-05 02:44:46
|
Alession is right; LiteRenderer do not yet reproject rasters as far as I=20 know. J2D implements that, but the real work is actually done by the=20 GridCoverage "Resample" operation. J2D renderer doesn't do much more=20 than just invoking this "Resample" operation and cache the result. The "Resample" operation is documented here: http://modules.geotools.org/main/apidocs/org/geotools/coverage/processing= /package-summary.html#Resample There is an example about how to reproject a raster to targetCRS: GridCoverage2D raster =3D ... CoordinateReferenceSystem targetCRS =3D ... GridCoverageProcessor2D processor =3D GridCoverageProcessor2D.getDefault(= ); GridCoverage2D projected =3D processor.doOperation("Resample", raster,=20 "CoordinateReferenceSystem", targetCRS); You can have more control if you also provide the "GridGeometry"=20 argument. If you don't, a default GridGeometry will be infered from the=20 source raster. You may also try to play with the "InterpolationType" argument and see=20 if it improves the projection quality. Jody Garnett a =E9crit : >> Another problem is : is it correct to reproject raster on the fly? >=20 > I am fairly sure it is - after all the alternative would be to load the= =20 > whole image into memory - and we have the occasional 60 meg image file=20 > to play with. JAI (which is used for most GridCoverage2D operations) splits images in=20 tiles. Only the required tiles will be loaded and computed. However, it=20 will work only if GridCoverageExchange (or Format, or whatever code is=20 used for loading images) take tiles in account. I have not yet looked at=20 the GridCoverageExchange code to see if it is the case, but we should be=20 able to improve the code in that direction. Martin. |