Daniel's solution was completely adequate. Remember that your vehicle location might not (surely not) be precisely over a vertex or line segment. This is the "real life" scenario.
What you must do is create a line segment from the vehicle's location to the
nearest available vertex and then add the algorithm's result to it (meaning
to the emergency point)
HTH,
Pedro Doria Meunier
GSM: +351961720188
Skype: pdoriam
On Thursday 11 December 2008 09:50:14 am searchelite wrote:
> Daniel Kastl-2 wrote:
> > As David said: once you selected the nearest vertex to your start, take
> > this vertex ID as your start point (source), and take the nearest vertex
> > ID to your end point as the endpoint (target).
> >
> > Then use Dijkstra for example:
> >
> > SELECT * FROM shortest_path('
> > SELECT gid as id,
> > source::integer,
> > target::integer,
> > length::double precision as cost
> > FROM ways',
> > 10, 20, false, false);
> >
> > In this case start point is 10 and end point is 20.
> > See http://pgrouting.postlbs.org/wiki/WorkshopFOSS4G2008/ch07
> >
> > Daniel
>
> Thanks for the reply...
>
> It seems that from your explanation the source and target are the road
> vertex not the actual vehicle point and emergency point(correct me if i'm
> wrong). What i want is to get the path with vehicle_point as the source and
> emergency_point as the target
>
> thank you
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ postgis-users mailing list [email protected] http://postgis.refractions.net/mailman/listinfo/postgis-users
