Opened 18 years ago

Closed 18 years ago

#1809 closed defect (worksforme)

postgis tileindex doesn't support time filter for rasters

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

Description

As per IRC discussion with frankw 

Trying to use a postgis tileindex to crank out a boatload of time varying
rasters for a WMS-Time server.  The issue is that the time filter is not being
used for the postgis query and all tile index rows are returned to the 
raster layer for drawing.

Hopefully I got that right :)

Change History (2)

comment:1 by fwarmerdam, 18 years ago

Status: newassigned
I have modified rasters layers to have a a custom SetTimeFilter()
method so they can propogate a time filter on to the tile index layer
they use (when one applies).  This *should* get time filtering working
in Daryl's case.  I have tested it with a separate tileindex layer that
is a shapefile layer.

This change has been committed to CVS in 4.9 (cvs trunk).

/************************************************************************/
/*                     msRASTERLayerSetTimeFilter()                     */
/*                                                                      */
/*      This function is actually just used in the context of           */
/*      setting a filter on the tileindex for time based queries.       */
/*      For instance via WMS requests.  So it isn't really related      */
/*      to the "raster query" support at all.                           */
/*                                                                      */
/*      If a local shapefile tileindex is in use, we will set a         */
/*      backtics filter (shapefile compatible).  If another layer is    */
/*      being used as the tileindex then we will forward the            */
/*      SetTimeFilter call to it.  If there is no tileindex in          */
/*      place, we do nothing.                                           */
/************************************************************************/

int msRASTERLayerSetTimeFilter(layerObj *layer, const char *timestring, 
                               const char *timefield)
{
    int tilelayerindex;

/* -------------------------------------------------------------------- */
/*      If we don't have a tileindex the time filter has no effect.     */
/* -------------------------------------------------------------------- */
    if( layer->tileindex == NULL ) 
        return MS_SUCCESS;

/* -------------------------------------------------------------------- */
/*      Find the tileindex layer.                                       */
/* -------------------------------------------------------------------- */
    tilelayerindex = msGetLayerIndex(layer->map, layer->tileindex);

/* -------------------------------------------------------------------- */
/*      If we are using a local shapefile as our tileindex (that is     */
/*      to say, the tileindex name is not of another layer), then we    */
/*      just install a backtics style filter on the raster layer.       */
/*      This is propogated to the "working layer" created for the       */
/*      tileindex by code in mapraster.c.                               */
/* -------------------------------------------------------------------- */
    if( tilelayerindex == -1 )
        return msLayerMakeBackticsTimeFilter( layer, timestring, timefield );

/* -------------------------------------------------------------------- */
/*      Otherwise we invoke the tileindex layers SetTimeFilter          */
/*      method.                                                         */
/* -------------------------------------------------------------------- */
    return msLayerSetTimeFilter( layer->map->layers + tilelayerindex,
                                 timestring, timefield );
}

comment:2 by akrherz@…, 18 years ago

Resolution: worksforme
Status: assignedclosed
As far as I can tell, this WORKSFORME.

FrankW rocks!
Note: See TracTickets for help on using tickets.