Reputation: 5086
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?
Upvotes: 8
Views: 6659
Reputation: 10976
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)
Upvotes: 3
Reputation: 10250
In Cartesian coordinates, x maps left-right and y maps up-down. So, a natural fit oriented in front of a map would be to use x for longitude (east-west) and y for latitude (north-south). There's a z as well, that could be used for altitude.
Upvotes: 2