[mapserver-users] mapserv cli and run-time substitution

Seth G sethg at geographika.co.uk
Sun Feb 6 01:08:26 PST 2022


Ah ok I was looking at the mapfile. Passing &YEAR=1976 in from the command line should work fine.
Maybe the value is being treated as a string, so you could test if the following worked (equals rather than less than):

EXPRESSION ("[year]" = "%year%")

Also maybe try with a different parameter name e.g. MYYEAR just in case YEAR is treated differently as it is used for various OGC services. 

Seth

--
web:https://geographika.net
twitter: @geographika


On Sun, Feb 6, 2022, at 9:50 AM, andy wrote:
> Hi Seth,
> 
> On Sun, 6 Feb 2022 at 09:35, Seth G <sethg at geographika.co.uk> wrote:
>  
>> Shouldn't the variable be wrapped in percentage signs?
>> 
>> EXPRESSION (%year% < 1976)
> 
> my goal is another one. My hardcorded expression is "EXPRESSION ([year] < 1976)".
> 
> I want to use run-time substitution to use "EXPRESSION ([year] < '%year%')", in the same way described here:
> https://mapserver.org/el/mapfile/validation.html#test-with-commandline
> 
> Thank you
>  
> -- 
> ___________________
> 
> Andrea Borruso
> website: https://medium.com/tantotanto
> 38° 7' 48" N, 13° 21' 9" E, EPSG:4326
> ___________________
> 
> "cercare e saper riconoscere chi e cosa,
>  in mezzo all’inferno, non è inferno, 
> e farlo durare, e dargli spazio"
> 
> Italo Calvino
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20220206/f6a99b85/attachment.htm>


More information about the MapServer-users mailing list