Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#1810 closed defect (fixed)

Problems with default time use

Reported by: warmerdam Owned by: warmerdam
Priority: high Milestone:
Component: WMS Server Version: unspecified
Severity: normal Keywords:
Cc:

Description

>Frank says:
>> DEFAULT TIME
>> ------------
>>
>> The next problem is that if I don't include &TIME=something in the 
>> request
>> url, the default time is not used.  Shouldn't it be?  It seems I have to
>> add "&TIME=" (that is an empty time request) in order to get the default
>> time to kick in.  Is that the desired behavior?  This is annoying in this
>> application context since we end up rendering all the time images (quick
>> slow) if a WMS request is made without an explicit time.  Denis and I had
>> assumed the default time would be used any time the user did not supply
>> a time.
>>
>>

Assefa says:
>  After reading carefully the specs of wms 1.1.1 there is this paragrah 
> (Annec C 4.1) that suggests that your assumptions are correct :
> 
> "...The absence of Time or Elevation parameters is equivalent to a 
> request for the Layer’s default value (if defined) along that 
> dimension;..."
> 
> So it makes sense to change the current behaviour to reflect this. If 
> changes are made to reftect this, note that if a layer is time aware 
> (ows/wms_timeextent and ows/wms_timefield metadata are defined) but the 
> default time is not given (which is not manadatory but desired element), 
> a request to a GetMap on that layer would return an exception.
> 
>  I missed this parahrah at implemenation time and only implemented the 
> use of the default value when the value was missing (which is also 
> defined in the specs).  Code modification to change it is minimal. Le me 
> know if you want me to chenge it or you will do it.

Change History (3)

comment:1 by fwarmerdam, 18 years ago

Cc: assefa@… added
Owner: changed from mapserverbugs to fwarmerdam
I'll take this one this weekend. 

comment:2 by fwarmerdam, 18 years ago

Resolution: fixed
Status: newclosed
I have added the following code in msWMSLoadGetMapParams().  It seems
to have the desired effect. 

  /*
  ** If any select layers have a default time, we will apply the default
  ** time value even if no TIME request was in the url.
  */
  if( !timerequest && map )
  {
      for (i=0; i<map->numlayers && !timerequest; i++)
      {
          layerObj *lp = NULL;

          lp = &(map->layers[i]);
          if (lp->status != MS_ON && lp->status != MS_DEFAULT)
              continue;

          if( msOWSLookupMetadata(&(lp->metadata), "MO", "timedefault") )
              timerequest = 1;
      }
  }

The change is only in mapserver 4.9.  

comment:3 by akrherz@…, 18 years ago

Hi,

I can verify that this patch fixes this bug I noticed as well...

thanks!
  daryl
Note: See TracTickets for help on using tickets.