Question

I'm trying to figure out which unit JTS LineString.getLength() return.

for example:

LineString foo = (initialize line string somehow)
foo.getLength() -> 7.025667228118838E-4

Are these Kilometers?, Meters?, Feet?

Was it helpful?

Solution 2

It's in degrees.

OTHER TIPS

It depends in which unit your coordinate geometries are expressed. If your coordinates are in meters, the perimeter will also be in meters.

com.vividsolutions.jts.geom.Geometry.getLength() returns a length/perimeter in meters. com.vividsolutions.jts.geom.Geometry.getArea() returns an area in squaremeters.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top