import overpy import requests import geopy.distance def get_elevation(lat, lon) -> float: return float(requests.get(f'https://www.elevation-api.eu/v1/elevation/{lat}/{lon}').text) def distance(npt1: overpy.Node, npt2: overpy.Node) -> float: """ returns the distance between npt1 and npt2 in meters""" pt1 = (npt1.lat, npt1.lon) pt2 = (npt2.lat, npt2.lon) return geopy.distance.distance(pt1, pt2).km * 1000