I would like to calculate the shortest path between a list of destinations and an origin. But first I need to find the nodes closest to my destinations. I am getting the list of destinations from OSMNX function for a set of Points of Interests (geometries_from_place).
import osmnx as ox
import geopandas as gpd
import networkx as nx
print(ox.__version__)
ox.config(use_cache=True, log_console=True)
Kinshasa = [ "Kisenso, Mont Amba, 31, Democratic Republic of the Congo",
"N'djili, Tshangu, Democratic Republic of the Congo",
"Kinshasa, Democratic Republic of the Congo"]
G_Kinshasa = ox.graph.graph_from_place(Kinshasa, simplify=True, network_type='drive')
tags2 = {'amenity' : ['hospital','university','social_facility'],
'landuse' : ['retail', 'commercial'],
'shop' : ['water','bakery']}
POIS = ox.geometries_from_place(Kinshasa, tags2, which_result=1)
Nearest_Nodes = ox.get_nearest_nodes(G_Kinshasa, POIS['geometry'][x],POIS[geometry][y])
How can I get a list of tules of lats and longs from the POIS['geometry'] object which is a GeoSeries to pass it to get_nearest_nodes in the last line of code above?
Here is a sample of output of POIS['geometry']:
Out[10]:
0 POINT (15.34802 -4.39344)
1 POINT (15.34074 -4.41001)
2 POINT (15.34012 -4.40466)
3 POINT (15.34169 -4.40443)
4 POINT (15.35278 -4.40812)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…