[mapserver-users] making pgrouting shortest distance function run with mapserver

Stephen Woodbridge woodbri at swoodbridge.com
Mon Jun 11 20:13:53 PDT 2012


On 6/11/2012 10:51 PM, Annu Anurag wrote:
> Yes sir. I rectified that flaw. But now mapserver is throwing this error:
>
> msDrawMap(): Image handling error. Failed to draw layer named 'route'.
> msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:
> column "gid" does not exist LINE 1:
> ...ary(ST_Force_2D("the_geom"),'NDR'),'hex') as geom,"gid" from... ^
>
> The error log contains this:
>
> [Tue Jun 12 08:06:17 2012].1364 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.edge_id=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)
> [Tue Jun 12 08:06:17 2012].7413 msPostGISLayerWhichShapes query status:
> PGRES_FATAL_ERROR (7)
> [Tue Jun 12 08:06:17 2012].7520 Error (msPostGISLayerWhichShapes()
> ) executing query: ERROR:  column "gid" does not exist
> LINE 1: ...ary(ST_Force_2D("the_geom"),'NDR'),'hex') as geom,"gid" from...
>                                                               ^
> [Tue Jun 12 08:06:17 2012].7594 msPostGISLayerWhichShapes(): Query
> error. Error executing query: ERROR:  column "gid" does not exist
> LINE 1: ...ary(ST_Force_2D("the_geom"),'NDR'),'hex') as geom,"gid" from...
>                                                               ^
>
>
> I modified my query to:
>
> DATA "the_geom from (select b.the_geom, a.* FROM (SELECT * FROM

Change this to:

     ... (select b.gid, b.the_geom, ...

> 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.edge_id=b.gid) AS foo using unique
> gid using srid=-1"
>
> I've checked the shapefile in the database. It has a gid column.
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users



More information about the mapserver-users mailing list