MCPcopy Index your code
hub / github.com/googlemaps/google-maps-services-python / elevation_along_path

Function elevation_along_path

googlemaps/elevation.py:40–65  ·  view source on GitHub ↗

Provides elevation data sampled along a path on the surface of the earth. :param path: An encoded polyline string, or a list of latitude/longitude values from which you wish to calculate elevation data. :type path: string, dict, list, or tuple :param samples: The number of

(client, path, samples)

Source from the content-addressed store, hash-verified

38
39
40def elevation_along_path(client, path, samples):
41 """
42 Provides elevation data sampled along a path on the surface of the earth.
43
44 :param path: An encoded polyline string, or a list of latitude/longitude
45 values from which you wish to calculate elevation data.
46 :type path: string, dict, list, or tuple
47
48 :param samples: The number of sample points along a path for which to
49 return elevation data.
50 :type samples: int
51
52 :rtype: list of elevation data responses
53 """
54
55 if type(path) is str:
56 path = "enc:%s" % path
57 else:
58 path = convert.shortest_path(path)
59
60 params = {
61 "path": path,
62 "samples": samples
63 }
64
65 return client._request("/maps/api/elevation/json", params).get("results", [])

Callers

nothing calls this directly

Calls 1

_requestMethod · 0.80

Tested by

no test coverage detected