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

Stephen Woodbridge woodbri at swoodbridge.com
Mon Jun 11 20:48:39 PDT 2012


You need to get your query working in psql or pgadmin first and you 
should move your pgrouting questions over the the pgrouting list.

I would also recommend that you work your way through a pgrouting 
tutorial. If you work through the steps to setup  pgrouting and have a 
working model then it is trivial to get it to work in mapserver.

Thanks,
   -Steve

On 6/11/2012 11:30 PM, Annu Anurag wrote:
> Yes sir. That worked. But I'm still getting an error:
>
> msDrawMap(): Image handling error. Failed to draw layer named 'route'.
> msPostGISLayerWhichShapes(): Query error. Error executing query: ERROR:
> column "source" does not exist LINE 1: SELECT gid AS id, source::int4,
> target::int4, length::double... ^ QUERY: SELECT gid AS id, source::int4,
> target::int4, length::double precision AS cost FROM edges_line
>
> The error log contains this:
>
> [Tue Jun 12 08:54:34 2012].554731 msPostGISLayerWhichShapes query:
> select encode(ST_AsBinary(ST_Force_2D("the_geom"),'NDR'),'hex') as
> geom,"gid" from (select b.gid, b.the_geom 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:54:34 2012].568295 msPostGISLayerWhichShapes query
> status: PGRES_FATAL_ERROR (7)
> [Tue Jun 12 08:54:34 2012].568405 Error (msPostGISLayerWhichShapes()
> ) executing query: ERROR:  column "source" does not exist
> LINE 1: SELECT gid AS id, source::int4, target::int4, length::double...
>                            ^
> QUERY:  SELECT gid AS id, source::int4, target::int4, length::double
> precision AS cost FROM edges_line
> [Tue Jun 12 08:54:34 2012].568478 msPostGISLayerWhichShapes(): Query
> error. Error executing query: ERROR:  column "source" does not exist
> LINE 1: SELECT gid AS id, source::int4, target::int4, length::double...
>                            ^
> QUERY:  SELECT gid AS id, source::int4, target::int4, length::double
> precision AS cost FROM edges_line
>
>
> _______________________________________________
> 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