others (#15) - Drawing a path using line and point tables (#313) - Message List

Drawing a path using line and point tables

Hi,

I have two tables for roads and hospitals. I'm looking for suitable pgrouting function(s) for following scenario.

Finding the closest hospital from an accident point (on a road) and draw the path.

Following functionality is needed.

1. One end of the drawn path needs to start from in front of the closest hospital.
2. Path needs to stop from the accident point on road.

I'm new to pgrouting and appreciate your help.


Thank you,

Nalin

  • Message #1229

    Hi Nalin,

    It is more than doable if we assume that you have coordinates for the hospitals.

    1. Using PostGIS ST_Distance() function you find the closest hospital location.

    2. Do the same to find closes road network node to that hospital.

    3. Find closest node to the accident location in same manner.

    4. Run shortest path function with two selected nodes.