[pgrouting-users] sort result

Sven Schroeter schroeter at netgis.de
Tue Mar 20 08:50:46 EDT 2012


Hi,

I’m  playing with Pgrouting using my own routing network (for bicycle) to
navigate from sub-line A to sub-line B: 

SELECT rt.gid, AsText(rt.the_geom) AS wkt,
                       length(rt.the_geom) AS length, routen_sub.id
                    FROM routen_sub,
                        (SELECT gid, the_geom
                            FROM dijkstra_sp_directed(
                                'routen_sub',
                                5,
                                22,
                                true, true)
                         ) as rt
                    WHERE routen_sub.gid=rt.gid;

First Question:
This works fine but the result geometry of my direction is unsorted. Is
there a possibility to sort the result directly via SQL?

Second Question:
Is it possible to set a "via" point directly in the SQL? With
dijkstra_sp_directed is it only possible to set a start and a endpoint.

Thanks
Sven




More information about the Pgrouting-users mailing list