I have two point shapefiles (with just one point each, let's call them 'Origin' and 'Destination'). I need to find the shortest path between them over a street network extracted using OSMnx from OpenStreetMap. For this, the points' coordinates are needed. First, I have each file read using GeoPandas as follows:
import geopandas as gpd
origin_fp = "C:/Users/User Name/Python_experiment/Origin.shp"
destination_fp = "C:/Users/User Name/Python_experiment/Destination.shp"
origin = gpd.read_file(origin_fp)
destination = gpd.read_file(destination_fp)
Once this is done, what is the syntax for extracting the coordinates of each feature in the shapefile?
They already have the same coordinate system to which I will project my graph.
Must the shapefiles have attributes for latitude and longitude?