[mapserver-users] Default Values in Runtime Substitution Error

Lars Schylberg lars.schylberg at blixtmail.se
Tue Mar 14 12:34:47 PDT 2017


This should help:

http://mapserver.org/cgi/runsub.html#default-values-if-not-provided-in-the-url

/Lars S.

Den 2017-03-14 kl. 19:38, skrev Stefanos Anastasiou:
> Hi all.
>    I'm trying to perform a runtime substitution in MapServer. My 
> mapfile snippet is the following:
>
>  VALIDATION
>       "val_1" "^[0-9]+(\.[0-9]+)?$"
>       "val_2" "^[0-9]+(\.[0-9]+)?$"
>       "val_3" "^[0-9]+(\.[0-9]+)?$"
>       "val_4" "^[0-9]+(\.[0-9]+)?$"
>  END
>  METADATA
>         #various WMS parameters
>   END
>   TYPE line
>   STATUS on
>   CONNECTIONTYPE POSTGIS
>   CONNECTION 'host=localhost port=5432 user=stefanos 
> password=myPassword dbname=dbName'
>   DATA "geom FROM (SELECT * FROM stored_function(%val_1%, %val_2%, 
> %val_3%, %val_4%)) AS foo USING UNIQUE seq USING srid=2100"
>
>
> If I pass the parameters in my url, everything works well. The problem 
> occurs when I don't pass any parameter. The MS_ERROFILE gives me the 
> following error:
>
> Error (ERROR:  syntax error at or near "%"
> LINE 1: ...'hex') as geom,"seq" from (SELECT * FROM _a_route(%val_1%, 
> %val_2%...
>                                        ^
>
> It's necessary not to pass default values like  "default_val_1" 
> "some_value"    because of a weird setup of my stored function.
>
> Is there any way to fix this ?
>
> Thanks a lot...!!
>
> -Stefanos
>
>
>
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/mapserver-users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20170314/e37615b5/attachment.htm>


More information about the MapServer-users mailing list