27
27
******************************************************************************
29
29
* $Log: maprasterquery.c,v $
30
* Revision 1.23 2006/06/23 20:39:19 frank
31
* fix time filter propogation to tileindex layer
33
* Revision 1.22 2006/06/22 17:32:25 frank
34
* Use backtics version of LayerSetTimeFilter so that time
35
* queries against layers with direct shapefile tileindexes
30
38
* Revision 1.21 2005/10/28 01:09:42 jani
31
39
* MS RFC 3: Layer vtable architecture (bug 1477)
1344
1352
#endif /* def USE_GDAL */
1355
/************************************************************************/
1356
/* msRASTERLayerSetTimeFilter() */
1358
/* This function is actually just used in the context of */
1359
/* setting a filter on the tileindex for time based queries. */
1360
/* For instance via WMS requests. So it isn't really related */
1361
/* to the "raster query" support at all. */
1363
/* If a local shapefile tileindex is in use, we will set a */
1364
/* backtics filter (shapefile compatible). If another layer is */
1365
/* being used as the tileindex then we will forward the */
1366
/* SetTimeFilter call to it. If there is no tileindex in */
1367
/* place, we do nothing. */
1368
/************************************************************************/
1370
int msRASTERLayerSetTimeFilter(layerObj *layer, const char *timestring,
1371
const char *timefield)
1375
/* -------------------------------------------------------------------- */
1376
/* If we don't have a tileindex the time filter has no effect. */
1377
/* -------------------------------------------------------------------- */
1378
if( layer->tileindex == NULL )
1381
/* -------------------------------------------------------------------- */
1382
/* Find the tileindex layer. */
1383
/* -------------------------------------------------------------------- */
1384
tilelayerindex = msGetLayerIndex(layer->map, layer->tileindex);
1386
/* -------------------------------------------------------------------- */
1387
/* If we are using a local shapefile as our tileindex (that is */
1388
/* to say, the tileindex name is not of another layer), then we */
1389
/* just install a backtics style filter on the raster layer. */
1390
/* This is propogated to the "working layer" created for the */
1391
/* tileindex by code in mapraster.c. */
1392
/* -------------------------------------------------------------------- */
1393
if( tilelayerindex == -1 )
1394
return msLayerMakeBackticsTimeFilter( layer, timestring, timefield );
1396
/* -------------------------------------------------------------------- */
1397
/* Otherwise we invoke the tileindex layers SetTimeFilter */
1399
/* -------------------------------------------------------------------- */
1400
return msLayerSetTimeFilter( layer->map->layers + tilelayerindex,
1401
timestring, timefield );
1404
/************************************************************************/
1405
/* msRASTERLayerInitializeVirtualTable() */
1406
/************************************************************************/
1349
1409
msRASTERLayerInitializeVirtualTable(layerObj *layer)
1369
1429
layer->vtable->LayerCloseConnection = msRASTERLayerClose;
1371
layer->vtable->LayerSetTimeFilter = msLayerMakePlainTimeFilter;
1431
/* we use backtics for proper tileindex shapefile functioning */
1432
layer->vtable->LayerSetTimeFilter = msRASTERLayerSetTimeFilter;
1372
1434
/* layer->vtable->LayerCreateItems, use default */
1373
1435
/* layer->vtable->LayerGetNumFeatures, use default */
1376
1437
return MS_SUCCESS;