I'm trying to perform pgRouting with MapServer so I've created a function in PostGIS and the call it in map file with runtime substitution. The DATA part is as follows:
DATA "geom FROM (SELECT * FROM routing_func(%source% , %target%)) AS foo USING UNIQUE seq using srid=2100"
My validation section in the map file is:
VALIDATION "source" "[0-9]+" "target" "[0-9]+" END
and the CLASS object:
CLASS NAME 'routing' EXPRESSION "%source% && %target%" STYLE COLOR 255 0 0 WIDTH 4 END END
I try to pass the parameters in map mode with the following request:
but nothing is drawn for the route that was supposed to be calculated.
If I try the OpenLayers template like:
The MS_ERRORFILE gives me the following error:
Error (ERROR: syntax error at or near "%" LINE 1: ...d, source, target, time as cost FROM roads_noded',%source%,%...
What am I missing here?