|
From: Andrea A. <and...@al...> - 2004-03-06 19:43:27
|
Hi Martin,
I was playing a bit with a couple of gererenced images (tiff + world file) and wanted to create a map
displayin a couple of them (20MB of tiff files in total) and a vector map. To my disappointment, the
images where properly placed, but were grayscale and the rendering was quite slow compared to
the ImageDisplay class provided along with the JAI samples. I discovered that this was due to
reprojection, since it removes all the bands but one, supposedly the visible one, but in my
case, it effectively reduced the image to a gray scale one. Removing the band select operation
did the trick (and made things a lot more faster), but I wonder, how do we handle the general case,
that is, how do we recognize that images that need all of the bands from the ones that work with
just one? Maybe by looking at the color model of the non geophysics image?
Best regards
Andrea Aime
PS: oh, to make it work I also had to add a special case for handling coordinate transformations
that involve a CARTESIAN coordinate system by adding the following code at the end of
CoordinateTrasformationFactory.createFromCoordinateSystems:
///////////////////////////////////////////
//// ////
//// Cartesian --> various CS ////
//// Various CS --> Cartesian ////
//// ////
///////////////////////////////////////////
if(sourceCS == LocalCoordinateSystem.CARTESIAN || targetCS == LocalCoordinateSystem.CARTESIAN) {
final int dimSource = sourceCS.getDimension();
MathTransform step = factory.createIdentityTransform(dimSource);
return createFromMathTransform(sourceCS, targetCS, step);
}
can I commit it? It makes it possible to live with the current situation, in which vector data still has no
coordinate system information at all.
|