Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 378
eros Avatar asked Nov 24 '11 07:11

eros


2 Answers

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)

like image 59
Ian Turton Avatar answered Oct 07 '22 21:10

Ian Turton


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.

like image 25
phatfingers Avatar answered Oct 07 '22 22:10

phatfingers