Created
March 29, 2018 07:47
-
-
Save pierdom/4a2587572d211146bc7a01bc88b39c63 to your computer and use it in GitHub Desktop.
[Geodesic distance in Python] Calculate distance in meters between coordinates #python #gis
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from geographiclib.geodesic import Geodesic | |
| lat1, lon1 = 51.556021, -0.279519 | |
| lat2, lon2 = 51.595387, -0.243415 | |
| geod = Geodesic.WGS84 | |
| g = geod.Inverse(lat1, lon1, lat2, lon2) | |
| print("Distance = {:.2f} meters".format(g['s12'])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment