2

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 '12 at 20:41
  • Hey, thanks for replying. I guess the most central one would be the most convenient for my app. – sergiopuy Nov 23 '12 at 21:22
  • Does anyone have any ideas? – sergiopuy Nov 24 '12 at 18:10
1

One approach could be

  1. get the bounding box for all edges with the same name
  2. calculate the center of this bbox
  3. find the edge that is closest to this center

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.