Could be possible to get a walking or driving distance area using pgr_drivindistance,pgr_alphashape and/or pgr_pointsaspolygon when an user click any location on map with Leaflet or OpenLayers?.

I am new programming in sql and trying to get the correct result I found the first problem on how to pass source node which is integer to double ( x , y).

The second one is how to join pgr_drivindistance and pgr_alphashape so that through Geoserver get the walking-driving polygon when the user clicks(x,y) on the map.

Would have another chance to achieve that objective with another functions?.

1 Answer 1


Just use Geoserver SQL views http://geoserver.geo-solutions.it/edu/en/adding_data/add_sqllayers.html


  • Thanks for your quick answer. geoserver.geo-solutions.it/edu/en/adding_data/… give me an idea on how to get work two function in one unic calls.
    – user19566
    Jan 22, 2015 at 17:50
  • Your welcome.here also an article.I think it was written whis pgrouting 1.x but you still get an idea: wiki.smu.edu.sg/1112t2is415g1/images/0/04/Report_v2.pdf
    – Thomas B
    Jan 22, 2015 at 17:54
  • This article is a good reference and a approximation to the final target. The link anitagraser.com/2011/05/13/… is one of the steps that i have followed but i don't know if could be possible to change the start_id::int4 to ::double format to admit (%x% %y%).I will try. Respect to pass source node(int) as variable(x,y),double, it is better to develop a new pgr_drivedistance function changing the format to this parameters?
    – user19566
    Jan 22, 2015 at 18:18
  • Yes.write a wrapper-function.here you find more details: workshop.pgrouting.org/chapters/wrapper.html. there they write a function pgr_fromAtoB with two coordinates as input parameter which they use to find the nearest nodes to this coordinates. you can adapt this for your needs so you pass just one coordinate and for example the distance value
    – Thomas B
    Jan 22, 2015 at 18:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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