You need to create a LineString geometry using a spatial aggregate like ST_MakeLine() first. Consider reading the pgRouting documentation, f.e. http://www.pgrouting.org/docs/howto/mapserver.html
> -----Ursprüngliche Nachricht----- > Von: mapserver-users-boun...@lists.osgeo.org > [mailto:mapserver-users-boun...@lists.osgeo.org] Im Auftrag > von Annu Anurag > Gesendet: Dienstag, 12. Juni 2012 19:55 > An: mapserver-users > Betreff: [mapserver-users] shortest_path query > > Hello there. I've got the query for shortest path using > pgrouting to run finally. I get the edges but now I need to > map my result onto a mapserver layer. I've tried examples > from the internet but mostly they're flawed. I'm positng the > query which has worked for me. Please suggest a way to > convert it into a visible layer using mapserver. > > SELECT * FROM shortest_path('SELECT gid AS id, > fromnodeid::int4, tonodeid::int4, length0::float8 AS cost > FROM edges_line', 35, 210, false, false) > > I tried to form a query-layer but failed. I'm sending the > code I used to. Please correct me. > > DATA "the_geom FROM (SELECT * FROM shortest_path('SELECT gid > AS id, fromnodeid::int4, tonodeid::int4, length0::float8 AS > cost FROM edges_line', 35, 210, false, false)) AS foo using > unique gid using srid=4326" > > Here is the layer definition: > > > LAYER > NAME "route" > CONNECTIONTYPE postgis > CONNECTION "user=postgres password=*********** > dbname=VSDelhidb host=localhost" > DEBUG 5 > STATUS DEFAULT > TYPE LINE > DATA "the_geom FROM (SELECT * FROM > shortest_path('SELECT gid AS id, fromnodeid::int4, > tonodeid::int4, length0::float8 AS cost FROM edges_line', 35, > 210, false, false)) AS foo using unique gid using srid=4326" > > TEMPLATE "t" > > # > # > //////////////////////////////////////////////////////THE > CLASS THAT CLASSIFIES EVERYTHING IN IT. > //////////////////////////////// > # > > CLASS > > # > # > /////////////////////////////////////////////////////THE > STYLE OF DRAWING THIS CLASS. //////////////////////////////////// > # > > NAME "0" > STYLE > SYMBOL "circle" > SIZE 10 > OUTLINECOLOR 255 0 0 > COLOR 165 42 42 > END #___END OF THE SYLE DECLARATION FOR THIS > CLASS.___##################################################### > ################ > > END #_________END OF THE CLASS THAT CLASSIFIES > EVERYTHING.___________######################################## > ###################### > END #________END OF THE LAYER THAT DRAWS > EVERYTHING._________########################################## #################################### > > > _______________________________________________ mapserver-users mailing list mapserver-users@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/mapserver-users