I have installed postgreSql + postGis + pgrouting and I have loaded OSM data into my database using osm2po and shp2pgsql. How can I search for points in the map using the street names and then route the user from point 1 to point 2. pgrouting divides the streets in edges and any given street will have multiple edges and nodes, how could I link those edges and nodes to the actual street names? Any ideas? Thanks
-
What's your plan? Do you want to find the most central edge of all edges with the same road name? Or would a random one do?– underdark ♦Nov 23, 2012 at 20:41
-
Hey, thanks for replying. I guess the most central one would be the most convenient for my app.– sergiopuyNov 23, 2012 at 21:22
-
Does anyone have any ideas?– sergiopuyNov 24, 2012 at 18:10
1 Answer
One approach could be
- get the bounding box for all edges with the same name
- calculate the center of this bbox
- find the edge that is closest to this center