[mapserver-users] Forward time and other parameters to a layer defined as wms client

Trond Michelsen trondmm-mapserver+2017 at crusaders.no
Thu Aug 8 02:34:14 PDT 2019


You're right, Runtime substitution is possible, but there were a
couple of issues.

One of them is probably not relevant for Søren. Different layers could
use different dimensions, like pressure and temperature. So we needed
something that would pass all possible dimensions to the backend. They
_could_ be hardcoded on a layer to layer basis, but it simplified the
setup if we could use a single connection string for all layers.

The second was that I couldn't find a way to make the runtime
substitution case insensitive. Using %TIME% in the mapfile won't
substitute anything if the request says &time=...

The third issue we had at the time was that we needed default values,
but I see that this has been fixed a long time ago.

On Thu, Aug 08, 2019 at 08:56:13AM +0200, Seth G wrote:
> A related approach to the one suggested by Trond is the one
> mentioned in https://github.com/mapserver/mapserver/issues/4797

> MAP->WEB: METADATA (values only, not keys) are supported as runtime
> substitution parameters - see
> https://mapserver.org/cgi/runsub.html#parameters-supported

> So if hardcoding wms_time works then in theory this could be
> replaced with a dynamic value from a URL.  I'm unsure if TIME would
> need to be added to the VALIDATION block as it is already a standard
> WMS parameter.

> On Thu, Aug 8, 2019, at 2:19 AM, Trond Michelsen wrote:
>> I made a workaround for this a while ago (I think we were using
>> Mapserver 4.10 at the time). It's possible there are better ways to
>> solve this now, but it still works :)
>> 
>> I can give more details tomorrow, but the gist of it is that I've made
>> an Apache handler (mod_perl) that modifies the incoming request, and
>> adds the TIME, LEVEL and all DIM_* parameters to an environment
>> variable I've called MS_PASSTHROUGH, and then I add %MS_PASSTHROUGH%&
>> to the connection parameter in the layer configuration.
>> 
>> I can send you a copy of my Apache handler and config tomorrow, if you
>> like.
>> 
>> On Wed, Aug 07, 2019 at 05:49:20PM +0000, Søren Laursen wrote:
>>> We have been using mapserver to display static layers, and are now
>>> in progress of using it to display dynamic (time bound) layers.
>>
>>> We have a wms server that serve forecast, and we use a shape file to
>>> mask out areas, for example cut a forecast so it follow landmass.
>>
>>> This works perfect, but when we want to include the TIME parameter
>>> to show a forecast at a specific point in time, we cannot get
>>> mapserver to forward the parameter.
>>
>>> Later on we will have the same problem with forecast that are bound
>>> by for example attitude and time.
>>
>>> We are using mapserver with apache, and in production we have a
>>> varnish in front (and banning urls when new forecast are ready).
>>
>>> I have look at time documentation of both the time wms settings and
>>> the runtime subtitionen but cannot figure out how we can make a
>>> solution.
>>
>>> When we hardcode a wms_time parameter in the layer definition
>>> everything works.

-- 
Trond Michelsen



More information about the MapServer-users mailing list