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

Add functions for spherical and Vincenty distance. #797

Merged
merged 1 commit into from
Mar 22, 2018

Conversation

manthey
Copy link
Contributor

@manthey manthey commented Mar 16, 2018

This adds two utility functions to the transform module: sphericalDistance and vincentyDistance. They can both be used to get the distance between two points based on a specified gcs.

When using a Mercator projection, using the unitsPerPixel value at the current zoom is misleading, as the distance calculated with that will be erroneous away from the defining latitudes for the projection. While the spherical distance is probably sufficient for most applications, the Vincenty distance is more accurate.

@manthey manthey force-pushed the vincenty-distance branch from 7d39d64 to 95a5a2b Compare March 21, 2018 18:50
Copy link

@matthewma7 matthewma7 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tried out these two kinds of distance calculation. Confirmed their calculation with each others result.
LGTM. approve.

@manthey manthey merged commit 9e87f00 into master Mar 22, 2018
@manthey manthey deleted the vincenty-distance branch March 22, 2018 19:22
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.

2 participants