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

StackOverflow https://stackoverflow.com/questions/8253633

  •  07-03-2021
  •  | 
  •  

سؤال

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?

هل كانت مفيدة؟

المحلول

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)

نصائح أخرى

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.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top