AW: [UMN_MAPSERVER-USERS] Logical Expressions

Rahkonen Jukka Jukka.Rahkonen at MMMTIKE.FI
Fri Nov 17 03:57:44 EST 2006


________________________________

>Lähettäjä: UMN MapServer Users List puolesta: Arnd Wippermann
>Hello Eric,
>You can change values in the mapfile, when you use substitutions:
>Z.Bsp.: EXPRESSION ('[PRJNR]' = '%PRJNR%') in the mapfile
>And this in the Mapserver-Request (not WMS-Request)
>?mode=map&....&PRJNR=1001&...
>Than Mapserver sustitute %PRJNR% with the value 1001.

Hi, 
 
Just a comment, actually you CAN use substitutions also in WMS-requests if you just get your WMS-client to send them through to Mapserver.  I made once a trial by using a variable as a part of the layer's database connection string and as a result I got a dynamic WMS layer with data changing according to this parameter.  This works fine if requests are sent directly from the client, for example a web browser.  Some WMS-clients are simply using the same WMS connection string that is used for GetCapabilities as a part of the GetMap request, and with those it is possible to use own variables if they are just added as extra parameters to the URL used for connecting the server.  However, this is not how WMS-clients should work. Instead they should use an URL returned by the GetCapabilities as "wms_connectionstring" for GetMap requests .  I tried also to pass my variable inside the layers "wms_connectionstring" attribute in the METADATA section of the mapfile as well in order to make the WMS layer flexibly queryable with any standard WMS client.  This did not work if I wrote something like &DATA=%variable% there because %variable% will not be substituted with the value but remains as textstring.  Perhaps variable substitution is not allowed everywhere in the mapfile, or?
 
A question for developers: I suppose that playing with extra parameters is not exactly forbidden by the WMS standards, but perhaps it may be a bit too Mapserver specific.  Would it be a nice feature or not to be able to use runtime expressions also with WMS?  Perhaps it would need no other changes than allowing runtime substitutions also for METADATA elements, or at least "wms_connectionstring".  Or is it already possible somehow?
 
Regards,
 
-Jukka Rahkonen-
 



More information about the mapserver-users mailing list