I'm very new to the GIS, and grasping the pgrouting function to see the possibles develop this feature.

Basically I wanted to know all the next end points distance within 2KM from the current location.

As in the image, I wanted to know all the D nodes points from the P node point.

enter image description here


You can use pgr_driving_distance function from pgrouting which will calculate for you cost of travel to every edge of topology (every road segment), than you can find nearest route for every point using ST_Distance.

  • Thanks @jendrusk, so with this function and referring the above figure . I can get ALL D node points from the current node id (which is P)? – FR STAR Mar 10 '18 at 5:30
  • I don't know cause I'm not sure what's about this D nodes - you were writing that you need next node from node P, but only this northern is indeed next - other nodes are few hops farer... – Jendrusk Mar 10 '18 at 16:42

For this porpuses you may use Qgis plugin NNJoin. It finds nearest neighbour for first layer features from another layer features. Thus this plugin creates new layer which contains first and second layer attributes, furthermore you'll have field with shortest distance between 1st and 2nd layer nodes.

Hope it helps you.

  • OP is asking about pgrouting which means he needs distances counted by roads not euclidean, also counted in database not in QGIS :) – Jendrusk Mar 8 '18 at 10:14
  • @jendrusk is correct, I need it within PostgreSQL – FR STAR Mar 10 '18 at 5:32

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.