I want to use pgRouting for showing shortest path on hiking trails. I created web map so I need to enable users when they click on start and end point somewhere on hiking trails, that it shows shortest path between those two points. I am beginner with it, so I just need to tell me where to start. I have those lines in postgis database and I am working with phpPgAdmin and Mapserver.
Tell me more
×
Geographic Information Systems Stack Exchange is a question and answer site for
cartographers, geographers and GIS professionals. It's 100% free, no registration required.
|
|
First you'll need to get pgRouting running. For a tutorial check: A Beginner’s Guide to pgRouting. The simplest approach is to do node-to-node routing using shortest_path(). You'll need to enable the user to pick start and end node for their routings. For example code check: Picking a Feature’s Attribute Value From a WMS Layer With OpenLayers In Mapscript, you can then tie a "Get Routing" button to a function that loads a new layer based on the shortest_path() query. Update: This is a great tutorial for creating a webmap with routing functionality: http://workshop.pgrouting.org/chapters/geoext_client.html It is based on OpenLayers with GeoExt and pgRouting, but it's easy to adjust it to any other routing webservice. |
|||||||||
|