~ubuntu-branches/ubuntu/jaunty/mapserver/jaunty-updates

« back to all changes in this revision

Viewing changes to maprasterquery.c

  • Committer: Bazaar Package Importer
  • Author(s): Fabio Tranchitella
  • Date: 2006-11-02 11:44:17 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20061102114417-pnutjb20kqzl23ua
Tags: 4.10.0-3
debian/control: build-depends on libpq-dev. (Closes: #396565)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 ******************************************************************************
28
28
 *
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
 
32
 *
 
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
 
36
 * will work properly.
 
37
 *
30
38
 * Revision 1.21  2005/10/28 01:09:42  jani
31
39
 * MS RFC 3: Layer vtable architecture (bug 1477)
32
40
 *
102
110
#include "mapresample.h"
103
111
#include "mapthread.h"
104
112
 
105
 
MS_CVSID("$Id: maprasterquery.c,v 1.21 2005/10/28 01:09:42 jani Exp $")
 
113
MS_CVSID("$Id: maprasterquery.c,v 1.23 2006/06/23 20:39:19 frank Exp $")
106
114
 
107
115
int msRASTERLayerGetShape(layerObj *layer, shapeObj *shape, int tile, 
108
116
                          long record);
1344
1352
#endif /* def USE_GDAL */
1345
1353
}
1346
1354
 
 
1355
/************************************************************************/
 
1356
/*                     msRASTERLayerSetTimeFilter()                     */
 
1357
/*                                                                      */
 
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.                           */
 
1362
/*                                                                      */
 
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
/************************************************************************/
 
1369
 
 
1370
int msRASTERLayerSetTimeFilter(layerObj *layer, const char *timestring, 
 
1371
                               const char *timefield)
 
1372
{
 
1373
    int tilelayerindex;
 
1374
 
 
1375
/* -------------------------------------------------------------------- */
 
1376
/*      If we don't have a tileindex the time filter has no effect.     */
 
1377
/* -------------------------------------------------------------------- */
 
1378
    if( layer->tileindex == NULL ) 
 
1379
        return MS_SUCCESS;
 
1380
 
 
1381
/* -------------------------------------------------------------------- */
 
1382
/*      Find the tileindex layer.                                       */
 
1383
/* -------------------------------------------------------------------- */
 
1384
    tilelayerindex = msGetLayerIndex(layer->map, layer->tileindex);
 
1385
 
 
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 );
 
1395
 
 
1396
/* -------------------------------------------------------------------- */
 
1397
/*      Otherwise we invoke the tileindex layers SetTimeFilter          */
 
1398
/*      method.                                                         */
 
1399
/* -------------------------------------------------------------------- */
 
1400
    return msLayerSetTimeFilter( layer->map->layers + tilelayerindex,
 
1401
                                 timestring, timefield );
 
1402
}
 
1403
 
 
1404
/************************************************************************/
 
1405
/*                msRASTERLayerInitializeVirtualTable()                 */
 
1406
/************************************************************************/
1347
1407
 
1348
1408
int
1349
1409
msRASTERLayerInitializeVirtualTable(layerObj *layer)
1368
1428
 
1369
1429
    layer->vtable->LayerCloseConnection = msRASTERLayerClose;
1370
1430
 
1371
 
    layer->vtable->LayerSetTimeFilter = msLayerMakePlainTimeFilter;
 
1431
    /* we use backtics for proper tileindex shapefile functioning */
 
1432
    layer->vtable->LayerSetTimeFilter = msRASTERLayerSetTimeFilter;
 
1433
 
1372
1434
    /* layer->vtable->LayerCreateItems, use default */
1373
1435
    /* layer->vtable->LayerGetNumFeatures, use default */
1374
1436
 
1375
 
 
1376
1437
    return MS_SUCCESS;
1377
1438
}
1378
1439