harsha2010 / magellan

Geo Spatial Data Analytics on Spark
Apache License 2.0
533 stars 149 forks source link

withinCircle is incorrect for geo coordinates #174

Closed ritesh-dineout closed 7 years ago

ritesh-dineout commented 7 years ago

Consider the origin point as Point(78.337059, 17.421833)

The user location point as Point(78.34024857791022, 17.426519064103633)

When I call userlocationpoint.withinCircle(origin, 50); this function will return true based on the implementation

https://github.com/harsha2010/magellan/blob/master/src/main/scala/magellan/Point.scala#L81-L84

However the actual geographic distance between these two points are 619.521 meters.

Consider the below screenshot of google maps.

distance

NOTE: The google maps displays road distance I am only interested in air distance which is obviously less than road distance.

harsha2010 commented 7 years ago

yes, it doesn't use great circle distance if thats what you mean ... theres a separate PR for fixing that.. right now this function is not supposed to be really used, its just a placeholder. It will be released in v1.0.6 roughly around mid november