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 created a digital database of many important features and locations of my city. and I want to create a web application in which shortest distance between two locations can be calculated and displayed. Is it possible with openlayers as client scripting. My shapefiles are in postgis.

What I am expecting is :

  • The database contains all roads, point features etc.

  • When the user types a location, the required location name can be listed out from the database and then user can similarly select another location

  • Then my technique is to find the nearest road points for the two locations (may be using buffer method) and then

  • finding the shortest and possible routes between the two road points along the road vector features.

    But I don't know how to write the code and algorithms.

share|improve this question
    
Please check workshop.pgrouting.org or ftp.remotesensing.org/pgrouting/foss4g2009/docs/… for examples –  user25318 Dec 30 '13 at 9:52
    
Welcome to GIS SE! When answering it is always best to include more than just a URL or only URLs because they can sometimes disappear. If possible, can you expand your Answer with a paragraph or two about what will be found at those URLs that directly answers the Question, please? –  PolyGeo Dec 30 '13 at 10:18
add comment

1 Answer 1

up vote 1 down vote accepted

Yes, that's possible using PostGIS with pgRouting and OpenLayers. You'll find an extensive tutorial here: http://pgrouting.org/docs/ol-workshop/index.html

In a similar question (routing using openlayers and pgrouting) the following GeoExt for pgRouting tutorial is recommended: http://workshop.pgrouting.org/chapters/geoext_client.html

You'll want to look into auto-complete scripts to support users when typing location names.

Finding nearest points on line has been discussed multiple times, e.g. Nearest neighbor between a point layer and a line layer

You'll have to learn to write code ... or hire someone.

share|improve this answer
    
thanks and i extended my question..please tell me if i can do that all using pgrouting –  Jeevan Patnaik Feb 10 '13 at 11:48
    
kneipenculture.de/ol_osm_routing.zip this link is given in pgrouting pgrouting.org/docs/ol-workshop/index.html and is not working –  Jeevan Patnaik Feb 10 '13 at 12:19
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.