|
From: Martin D. <mar...@no...> - 2005-10-11 23:37:12
|
Martin Schmitz a =E9crit : > In the vertical direction everything is exactly correct. The problem is= =20 > the horizontal. >=20 > As I found out just a minute ago, the reason seems not to be the method= =20 > GeoMouseEvent.getMapCoordinate(.) because if I move the cursor in the=20 > lower left corner, it returns the correct lat/lon position of my raster= !=20 > So the problem must be GridCoverage.evaluate(Point2D,.). >=20 > Is there a bug in the transformation from the lat/lon to raster=20 > coordinates? Rounding problems? Not as far as I know. It seems to work correctly on my own software (but=20 I may be wrong - more tests would be better). There is no separated=20 processing for the horizontal and the vertical axis. Most=20 transformations are handled by java.awt.geom.AffineTransform, which=20 handle both axis simultaneously. An error may occurs while setting up=20 the AffineTransform however. I suggest to try the following: MathTransform tr =3D=20 gridCoverage.getGridGeometry().getGridToCoordinateSystem(); System.out.println(tr); Make sure that the affine transform coefficients are the expected one. The AffineTransform can be setup by GridCoverage2D at construction time=20 from the image size and an user-supplied Envelope. Make sure that the=20 envelope is correct. If the envelope is correct but GridCoverage2D setup=20 an incorrect AffineTransform, please let me know. Martin. |