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.<br>
<div class="gmail_quote">
<br>SELECT * FROM shortest_path('SELECT gid AS id, fromnodeid::int4, tonodeid::int4, length0::float8 AS cost FROM edges_line', 35, 210, false, false)<br><br>I tried to form a query-layer but failed. I'm sending the code I used to. Please correct me.<br>
<br>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"<br>
<br>Here is the layer definition:<br><br><br> LAYER<br> NAME "route"<br> CONNECTIONTYPE postgis<br> CONNECTION "user=postgres password=*********** dbname=VSDelhidb host=localhost"<br>
DEBUG 5<br> STATUS DEFAULT<br> TYPE LINE<br> 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"<br>
<br> TEMPLATE "t"<br> <br> #<br> # //////////////////////////////////////////////////////THE CLASS THAT CLASSIFIES EVERYTHING IN IT. ////////////////////////////////<br>
#<br><br> CLASS<br> <br> #<br> # /////////////////////////////////////////////////////THE STYLE OF DRAWING THIS CLASS. ////////////////////////////////////<br>
#<br> <br> NAME "0"<br> STYLE<br> SYMBOL "circle"<br> SIZE 10<br> OUTLINECOLOR 255 0 0<br>
COLOR 165 42 42<br> END #___END OF THE SYLE DECLARATION FOR THIS CLASS.___#####################################################################<br><br> END #_________END OF THE CLASS THAT CLASSIFIES EVERYTHING.___________##############################################################<br>
END #________END OF THE LAYER THAT DRAWS EVERYTHING._________##############################################################################<br><br>
</div><br>