Thanks to visit codestin.com
Credit goes to github.com

Skip to content

geopy ignores altitude when calculating geodesic #387

@inbaroz

Description

@inbaroz
import geopy

p1 = geopy.point.Point()
p1.latitude = 10
p1.longitude = -110

p2 = geopy.point.Point()
p2.altitude = 35
p2.latitude = 20
p2.longitude = -120

I'm trying to calculate distance between 2 locations. Each location has lat, lon, altitude. When calculating distance using Geopy it doesn't seem to consider the altitude: slight changes in lat, lot influence the result, small/huge change in altitude doesn't affect the resulting distance.

# low alt
p1.altitude = 350 
print(geopy.distance.geodesic(p1, p2).km)
# 1541.8564339502925

# high alt
p1.altitude = 3500000 
print(geopy.distance.geodesic(p1, p2).km)
# 1541.8564339502925

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions