Search code examples
javacoordinategeotools

Using GeoTools: What is the Latitude and Longitude in com.vividsolutions.jts.geom.Coordinate class?


I will use com.vividsolutions.jts.geom.Coordinate as my coordinate class. But don't find any document which is the correct order of the coordinate. is it standard?

Here's the java doc link -> http://www.vividsolutions.com/jts/javadoc/com/vividsolutions/jts/geom/Coordinate.html

My question is: What is x? (is it Latitude or Longitude?) What is y? (is it Latitude or Longitude?)

Any guidance is appreciated.

UPDATES1 Let me to add this. I am using GeoTools Java Library. Then, the library is using that Coordinate class. How does GeoTools treat the Coordinate.x and Coordinate.y?


Solution

  • It depends on the projection you are using. Check the EPSG definition and it will list the axis order. For example see http://spatialreference.org/ref/sr-org/6864/prettywkt/. If you are using GeoTools then you probably don't need to be worrying about the JTS internals.

    UPDATE

    I remembered this document which may help (http://docs.geotools.org/latest/userguide/library/referencing/order.html)