Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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

share|improve this question
    
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
add comment

1 Answer

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
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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