Dear Stephen sir,<br>I tried your suggestion sir. But I'm still having some errors. Is there something wrong with the syntax of the statement? I changed the line in my code to this as you had suggested:<br><br>DATA "the_geom from (select b.the_geom, a.* FROM (SELECT * FROM shortest_path('SELECT gid AS id, source::int4, target::int4, length::double precision AS cost FROM edges_line', 50, 210, false, false)) as a edges_line as b where a.edgeid=b.gid) AS foo using unique gid using srid=-1"<br>

<br>and I'm getting the following error now:<br><br>msDrawMap(): Image handling error. Failed to draw layer named 'route'.
msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:  syntax error at or near "edges_line"
LINE 1: ...st FROM edges_line', 50, 210, false, false)) as a edges_line...
                                                             ^
 
<br><br>When I looked up the error log, I got this:<br><br>[Tue Jun 12 07:17:54 2012].140295 msPostGISLayerNextShape called.<br>[Tue Jun 12 07:17:54 2012].140331 msPostGISLayerFreeItemInfo called.<br>[Tue Jun 12 07:17:54 2012].140363 msPostGISLayerClose called: the_geom from edges_arc<br>

[Tue Jun 12 07:17:54 2012].140412 msConnPoolRelease(Road4,user=postgres password=************ dbname=VSDelhidb host=localhost,0x896c410)<br>[Tue Jun 12 07:17:54 2012].140445 msConnPoolClose(user=postgres password=************ dbname=VSDelhidb host=localhost,0x896c410)<br>

[Tue Jun 12 07:17:54 2012].141013 msDrawMap(): Layer 3 (Road4), 0.508s<br>[Tue Jun 12 07:17:54 2012].141134 msPostGISLayerOpen called: the_geom from (select b.the_geom, a.* FROM (SELECT * FROM shortest_path('SELECT gid AS id, source::int4, target::int4, length::double precision AS cost FROM edges_line', 50, 210, false, false)) as a edges_line as b where a.edgeid=b.gid) AS foo using unique gid using srid=-1<br>

[Tue Jun 12 07:17:54 2012].141187 msPostGISLayerOpen: No connection in pool, creating a fresh one.<br>[Tue Jun 12 07:17:54 2012].322140 msConnPoolRegister(route,user=postgres password=************ dbname=VSDelhidb host=localhost,0x896c410)<br>

[Tue Jun 12 07:17:54 2012].363321 msPostGISLayerOpen: Got PostGIS version 10500.<br>[Tue Jun 12 07:17:54 2012].363393 msPostGISLayerFreeItemInfo called.<br>[Tue Jun 12 07:17:54 2012].363433 msPostGISLayerWhichShapes called.<br>

[Tue Jun 12 07:17:54 2012].363461 msPostGISParseData called.<br>[Tue Jun 12 07:17:54 2012].363535 msPostGISParseData: unique_column=gid, srid=-1, geom_column_name=the_geom, table_name=(select b.the_geom, a.* FROM (SELECT * FROM shortest_path('SELECT gid AS id, source::int4, target::int4, length::double precision AS cost FROM edges_line', 50, 210, false, false)) as a edges_line as b where a.edgeid=b.gid) AS foo<br>

[Tue Jun 12 07:17:54 2012].363568 msPostGISBuildSQL called.<br>[Tue Jun 12 07:17:54 2012].363597 msPostGISBuildSQLItems called.<br>[Tue Jun 12 07:17:54 2012].363629 msPostGISBuildSQLItems: 0 items requested.<br>[Tue Jun 12 07:17:54 2012].363660 msPostGISBuildSQLFrom called.<br>

[Tue Jun 12 07:17:54 2012].363692 msPostGISBuildSQLWhere called.<br>[Tue Jun 12 07:17:54 2012].363721 msPostGISBuildSQLSRID called.<br>[Tue Jun 12 07:17:54 2012].363750 msPostGISBuildSQLSRID: SRID provided (-1)<br>[Tue Jun 12 07:17:54 2012].363780 msPostGISBuildSQLBox called.<br>

[Tue Jun 12 07:17:54 2012].363876 msPostGISLayerWhichShapes query: select encode(ST_AsBinary(ST_Force_2D("the_geom"),'NDR'),'hex') as geom,"gid" from (select b.the_geom, a.* FROM (SELECT * FROM shortest_path('SELECT gid AS id, source::int4, target::int4, length::double precision AS cost FROM edges_line', 50, 210, false, false)) as a edges_line as b where a.edgeid=b.gid) AS foo where the_geom && GeomFromText('POLYGON((-6015.80966101695 -4605.49,-6015.80966101695 4811.71,6544.54966101695 4811.71,6544.54966101695 -4605.49,-6015.80966101695 -4605.49))',-1)<br>

[Tue Jun 12 07:17:54 2012].365626 msPostGISLayerWhichShapes query status: PGRES_FATAL_ERROR (7)<br>[Tue Jun 12 07:17:54 2012].365707 Error (msPostGISLayerWhichShapes()<br>) executing query: ERROR:  syntax error at or near "edges_line"<br>

LINE 1: ...st FROM edges_line', 50, 210, false, false)) as a edges_line...<br>                                                             ^<br>[Tue Jun 12 07:17:54 2012].365759 msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:  syntax error at or near "edges_line"<br>

LINE 1: ...st FROM edges_line', 50, 210, false, false)) as a edges_line...<br>                                                             ^<br> <br>[Tue Jun 12 07:17:54 2012].365881 msPostGISLayerFreeItemInfo called.<br>

[Tue Jun 12 07:17:54 2012].365925 msPostGISLayerClose called: the_geom from (select b.the_geom, a.* FROM (SELECT * FROM shortest_path('SELECT gid AS id, source::int4, target::int4, length::double precision AS cost FROM edges_line', 50, 210, false, false)) as a edges_line as b where a.edgeid=b.gid) AS foo using unique gid using srid=-1<br>

[Tue Jun 12 07:17:54 2012].365975 msConnPoolRelease(route,user=postgres password=************ dbname=VSDelhidb host=localhost,0x896c410)<br>[Tue Jun 12 07:17:54 2012].366021 msConnPoolClose(user=postgres password=************ dbname=VSDelhidb host=localhost,0x896c410)<br>

[Tue Jun 12 07:17:54 2012].366792 msDrawMap(): Image handling error. Failed to draw layer named 'route'.<br>[Tue Jun 12 07:17:54 2012].368660 msPostGISLayerClose called: the_geom from edges_line<br>[Tue Jun 12 07:17:54 2012].368737 msPostGISLayerClose called: the_geom from allfeatureslabel_point<br>

[Tue Jun 12 07:17:54 2012].368776 msPostGISLayerClose called: the_geom from namesofroads_text<br>[Tue Jun 12 07:17:54 2012].368814 msPostGISLayerClose called: the_geom from edges_arc<br>[Tue Jun 12 07:17:54 2012].368852 msPostGISLayerClose called: the_geom from (select b.the_geom, a.* FROM (SELECT * FROM shortest_path('SELECT gid AS id, source::int4, target::int4, length::double precision AS cost FROM edges_line', 50, 210, false, false)) as a edges_line as b where a.edgeid=b.gid) AS foo using unique gid using srid=-1<br>

[Tue Jun 12 07:17:54 2012].370944 freeLayer(): freeing layer at 0x88e04e8.<br>[Tue Jun 12 07:17:54 2012].371022 msPostGISLayerIsOpen called.<br>[Tue Jun 12 07:17:54 2012].371067 freeLayer(): freeing layer at 0x88e12e8.<br>

[Tue Jun 12 07:17:54 2012].371099 msPostGISLayerIsOpen called.<br>[Tue Jun 12 07:17:54 2012].371136 freeLayer(): freeing layer at 0x88e2220.<br>[Tue Jun 12 07:17:54 2012].371167 msPostGISLayerIsOpen called.<br>[Tue Jun 12 07:17:54 2012].371207 freeLayer(): freeing layer at 0x88e30d8.<br>

[Tue Jun 12 07:17:54 2012].371239 msPostGISLayerIsOpen called.<br>[Tue Jun 12 07:17:54 2012].371285 freeLayer(): freeing layer at 0x88e3fb8.<br>[Tue Jun 12 07:17:54 2012].371317 msPostGISLayerIsOpen called.<br><br><br>Another thing I think worth mentioning is that I haven't done anything special with my database to make pgrouting work on it. I have only enabled the pgrouting basic functions to the database but haven't created any index or anything of that sort. Actually the documentation for pgrouting is so poor that I'm not even able to understand where to look for a problem. I just need to be able to route from node 'a' to node 'b' in my road network. The name of the network is 'edges_line' as you can see. Can you mention the query you would use to route from node a to b in this table?  I can try and run that code and then modify it according to my need. Thank you!<br>