Getting 0 results from the elevation API (OSMNX) Add node elevation nodes

277 views Asked by At

I'm pretty new to OSMNX and I'm trying to run a few basic commands with it. One of the commands I'm trying to run is osmnx.add_node_elevation(Graph api); however, I keep getting the following result:

Graph has 188 nodes but we received 0 results from elevation API

here's an example code block:

G = ox.graph_from_address("Boston", dist = 500, network_type = "walk")
G = ox.add_node_elevations(G, api_key= my_api_key)

which is not working for some reason. Anyone have any clue how to fix this?

Edit: here's the trace:

 ``` Traceback (most recent call last)
<ipython-input-10-00d954208c44> in <module>()
----> 1 G = ox.add_node_elevations(G, api_key=api_key)

/usr/local/lib/python3.6/dist-packages/osmnx/elevation.py in add_node_elevations(G, api_key, max_locations_per_batch, pause_duration, precision)
    107     if not (len(results) == len(G) == len(node_points)):
    108         raise Exception(
--> 109             f"Graph has {len(G)} nodes but we received {len(results)} results from elevation API"
    110         )
    111     else:

Exception: Graph has 598 nodes but we received 0 results from elevation API```

Thank you!

0

There are 0 answers