[Cartoweb-users] Re: How Does It works?

Sylvain Pasche sylvain.pasche at camptocamp.com
Mon Jan 16 03:41:49 EST 2006


Hello,

That would be something like:

 SELECT * FROM shortest_path_as_geometry('graph2', 
(select v.id from graph2_vertices v join graph2 g on v.geom_id =
g.source_id where g.gid=5), 
(select v.id from graph2_vertices v join graph2 g on v.geom_id =
g.target_id where g.gid=10));

Note however, that shortest_path_as_geometry is just an utility
function, and if you need something more specific, you can always do you
own SQL statement.

Otherwise, please send email to the cartoweb-users at lists.maptools.org
mailing list instead of me directly.

Best regards,

Sylvain


Le lundi 09 janvier 2006 à 14:59 -0200, Bruno Maluche Neto a écrit :
>  
> Thanks Sylvain...
> Just one aditional question...
> How can I use the shortest_path_as_geometry to show up  the path like
> you did below?
>  
> Ty
>         ----- Original Message ----- 
>         From: Sylvain Pasche 
>         To: Bruno Maluche Neto 
>         Sent: Friday, December 23, 2005 8:22 AM
>         Subject: Re: How Does It works?
>          
>         SELECT * FROM shortest_path('SELECT id, source, target, cost FROM graph2_edges', 
>              (select v.id from graph2_vertices v join graph2 g on v.geom_id = g.source_id where g.gid=5), 
>              (select v.id from graph2_vertices v join graph2 g on v.geom_id = g.target_id where g.gid=10), 
>            false, false);
>         
>         In this example, the graph table is called "graph2", and we go
>         from gid=5 to gid=10.
>         
>         Regards,
>         
>         Sylvain 



More information about the Cartoweb-users mailing list