You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I make a very small network (in this case two nodes), there seems to be a problem with POIs. In the example below I'm adding four POIs but nearest_pois only ever finds one. My hunch is that some of the POIs aren't actually being assigned to nodes, maybe because they are outside the the bounding box formed by the network nodes? (They are inside the original bounding box, though.)
In [1]: from pandana.loaders import osm
In [2]: bbox = (37.8668405874, -122.2590948685, 37.8679028054, -122.2586363885)
In [3]: network = osm.network_from_bbox(*bbox)
Generating contraction hierarchies with 1 threads.
Setting CH node vector of size 2
Setting CH edge vector of size 1
[info src/contraction_hierarchies/src/libch.cpp:205] Range graph removed 0 edges of 2
. 10% . 20% . 30% . 40% . 50% 100%
. 60% . 70% . 80% . 90% . 100%
In [4]: network.nodes_df
Out[4]:
x y
id
53063555 -122.258810 37.866910
53099275 -122.258993 37.867808
In [5]: query = "amenity=restaurant"
In [6]: data = osm.node_query(*bbox, tags=query)
In [7]: data
Out[7]:
amenity cuisine lat lon name
id
286632169 restaurant NaN 37.867231 -122.258692 Tako Sushi
366088674 restaurant NaN 37.867388 -122.258940 Naan 'n Curry
1419597327 restaurant ice_cream 37.867044 -122.258676 Cream
2965338413 restaurant asian 37.867116 -122.258682 Koja Kitchen
In [8]: network.init_pois(num_categories=1, max_dist=1000, max_pois=5)
In [9]: network.set_pois(query, data['lon'], data['lat'])
In [10]: network.nearest_pois(1000, query, num_pois=3)
Out[10]:
1 2 3
id
53063555 101.205002 1000 1000
53099275 0.000000 1000 1000
In [11]:
The text was updated successfully, but these errors were encountered:
When I make a very small network (in this case two nodes), there seems to be a problem with POIs. In the example below I'm adding four POIs but
nearest_pois
only ever finds one. My hunch is that some of the POIs aren't actually being assigned to nodes, maybe because they are outside the the bounding box formed by the network nodes? (They are inside the original bounding box, though.)The text was updated successfully, but these errors were encountered: