Matthias Basler a écrit :
If I have a DirectPosition with a CRS, should
double[] getCoordinates()
and
double getOrdinate(int dimension)
return the ordinates in the order specified by the CRS or always in a "fixed"
order such as west-east axis (X), north-south axis (Y), elevation (Z).
It should always be in the order specified by the CRS.
I have a 2D lat/long CRS, so I would expect the values to be returned as [Y,X].
However when I tried a coordinate transformation using
public DirectPosition transform(
final DirectPosition ptSrc, DirectPosition ptDst)
in AbstractMathTransform, it returned weird results. When I switched x and y, it
worked.
It should work with (y,x) order... Could you post the output of
System.out.println(theMathTransform) please?
Basically what I observed is, that said function
transform(final DirectPosition ptSrc, DirectPosition ptDst)
expects that the ordinates returned by "getCoordinates()" are actually long/lat,
not lat/long as the CRS suggests.
It should not. This method should always expect the ordinate to be in
the CRS order. Again, a System.out.println(sourceCRS) and
println(targetCRS) may help.
Now, how is this INTENDED to work?
It is intented to work with CRS axis order, and should already work that
way. Lets see what the output of the above-cited 'println' statements are.
Martin.
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server.
Download it for free - -and be entered to win a 42" plasma tv or your very
own Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel