Hi developers,

Simple question:
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).

To give my problem here:

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.

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.

I could not find anything specying the order for the returned ordinates in the
documentation of "DirectPosition", but intuitively I would expect that the
ordinate order of the CRS is respected and used.
(In contrast to JTS ... which is always [X,Y].)

For example if I had a CS with axis directions to NE and SE, which is
theoretically possible, there is not intuitive "X" or "Y". Only the CRS's
CoordinateSystem can define the order in this case. So it would be consistent
if the CRS's axis order is always respected and used in functions like
  getCoordinates() or
  getOrdinate(int)
and of course in the constructors of "DirectPosition" implementations.

Now, how is this INTENDED to work?
Martin, you wrote the class, you should know.

Matthias Basler
[EMAIL PROTECTED]

----------------------------------------------------------------
This mail was sent through http://webmail.uni-jena.de


-------------------------------------------------------
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

Reply via email to