azavea / osmesa

OSMesa is an OpenStreetMap processing stack based on GeoTrellis and Apache Spark
Apache License 2.0
79 stars 26 forks source link

Measure lengths in meters, not mega-degrees #136

Closed mojodna closed 5 years ago

drew-bower commented 5 years ago

@mojodna can you confirm the math that is being used to calculate distance in meters?

mojodna commented 5 years ago

This now uses st_lengthSphere from Spark JTS / GeoMesa, which is defined here: https://github.com/locationtech/geomesa/blob/9fcd422dbe7fa1c4b1faca1d2d3c0b695504d00a/geomesa-spark/geomesa-spark-jts/src/main/scala/org/locationtech/geomesa/spark/jts/udf/SpatialRelationFunctions.scala#L54-L55

It uses fastDistance internally, which uses a Haversine distance calculator because geo is set in the SpatialContext created in GeoMesa.

drew-bower commented 5 years ago

is that a sphere based method? I Just need to know.. for a broader conversation. Thanks in advance.

mojodna commented 5 years ago

Yes.

drew-bower commented 5 years ago

Thanks.