Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix NaN in distance calculation #198

Closed

Conversation

andreynovikov
Copy link

Existing implementation produces NaN for some points. Reference URL gives 404 and can not be checked anymore. Provided implementation can produce NaN too (by design) but works for all my tested cases (about million points). Compared by execution time methods are nearly equal - several milliseconds for 30000 points.

@devemux86
Copy link
Collaborator

devemux86 commented Oct 6, 2016

We have various distance calculations in Mapsforge LatLongUtils class.
Is the Vincenty code from there?

@andreynovikov
Copy link
Author

Don't think so. I've took it from my old application that I wrote long before I've got to know Mapsforge. I do not remember exactly but looks like I've adopted some JavaScript code that is widely distributed over Internet: http://stackoverflow.com/questions/12800045/distance-using-wgs84-ellipsoid/20615459#20615459

@devemux86
Copy link
Collaborator

devemux86 commented Oct 6, 2016

Can you test LatLongUtils code?
Methods content seems similar and I'd prefer to borrow the existing from Mapsforge, so we can have a common base or fix it if there is a problem. 😄

@andreynovikov
Copy link
Author

Ok, I'll test.

@devemux86
Copy link
Collaborator

devemux86 commented Oct 8, 2016

I integrated Mapsforge API in #201.

So closing here, please test new methods.

@devemux86 devemux86 closed this Oct 8, 2016
@andreynovikov andreynovikov deleted the geopoint-distance branch October 17, 2016 10:51
@andreynovikov
Copy link
Author

Everything works, thanks.

@devemux86
Copy link
Collaborator

Great, thanks for the feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants