[mapserver-commits] r9200 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Wed Jul 22 00:20:44 EDT 2009
Author: sdlime
Date: 2009-07-22 00:20:44 -0400 (Wed, 22 Jul 2009)
New Revision: 9200
Modified:
trunk/mapserver/mapgraticule.c
trunk/mapserver/maplayer.c
trunk/mapserver/mapmygis.c
trunk/mapserver/mapogr.cpp
trunk/mapserver/maporaclespatial.c
trunk/mapserver/mappostgis.c
trunk/mapserver/maprasterquery.c
trunk/mapserver/mapsde.c
trunk/mapserver/mapserver.h
trunk/mapserver/mapshape.c
trunk/mapserver/mapwfslayer.c
Log:
Added hooks for msLayerResultsGetShape(). #3069
Modified: trunk/mapserver/mapgraticule.c
===================================================================
--- trunk/mapserver/mapgraticule.c 2009-07-21 19:34:36 UTC (rev 9199)
+++ trunk/mapserver/mapgraticule.c 2009-07-22 04:20:44 UTC (rev 9200)
@@ -547,13 +547,12 @@
layer->vtable->LayerIsOpen = msGraticuleLayerIsOpen;
layer->vtable->LayerWhichShapes = msGraticuleLayerWhichShapes;
layer->vtable->LayerNextShape = msGraticuleLayerNextShape;
+ /* layer->vtable->LayerResultsGetShape, use default */
layer->vtable->LayerGetShape = msGraticuleLayerGetShape;
-
layer->vtable->LayerClose = msGraticuleLayerClose;
layer->vtable->LayerGetItems = msGraticuleLayerGetItems;
layer->vtable->LayerGetExtent = msGraticuleLayerGetExtent;
layer->vtable->LayerGetAutoStyle = msGraticuleLayerGetAutoStyle;
-
/* layer->vtable->LayerCloseConnection, use default */;
layer->vtable->LayerSetTimeFilter = msLayerMakePlainTimeFilter;
/* layer->vtable->LayerApplyFilterToLayer, use default */
Modified: trunk/mapserver/maplayer.c
===================================================================
--- trunk/mapserver/maplayer.c 2009-07-21 19:34:36 UTC (rev 9199)
+++ trunk/mapserver/maplayer.c 2009-07-22 04:20:44 UTC (rev 9200)
@@ -146,6 +146,21 @@
}
/*
+** Used to retrieve a shape from a result set by index. Result sets are created by the various
+** msQueryBy...() functions. The index is assigned by the data source.
+*/
+int msLayerResultsGetShape(layerObj *layer, shapeObj *shape, int tile, long record)
+{
+ if ( ! layer->vtable) {
+ int rv = msInitializeVirtualTable(layer);
+ if (rv != MS_SUCCESS)
+ return rv;
+ }
+
+ return layer->vtable->LayerResultsGetShape(layer, shape, tile, record);
+}
+
+/*
** Used to retrieve a shape by index. All data sources must be capable of random access using
** a record number of some sort.
*/
@@ -373,7 +388,7 @@
freeitems = MS_TRUE;
}
- /* layer-level item use */
+ /* layer-level item use (TODO: consider making sure the item is valid before adding to the list some how) */
if(layer->classitem) layer->classitemindex = string2list(layer->items, &(layer->numitems), layer->classitem);
if(layer->filteritem) layer->filteritemindex = string2list(layer->items, &(layer->numitems), layer->filteritem);
if(layer->labelitem) layer->labelitemindex = string2list(layer->items, &(layer->numitems), layer->labelitem);
@@ -868,57 +883,52 @@
/*
* Dummies / default actions for layers
*/
-int
-LayerDefaultInitItemInfo(layerObj *layer)
+int LayerDefaultInitItemInfo(layerObj *layer)
{
- return MS_SUCCESS;
+ return MS_SUCCESS;
}
-void
-LayerDefaultFreeItemInfo(layerObj *layer)
+void LayerDefaultFreeItemInfo(layerObj *layer)
{
- return;
+ return;
}
int LayerDefaultOpen(layerObj *layer)
{
- return MS_FAILURE;
+ return MS_FAILURE;
}
-int
-LayerDefaultIsOpen(layerObj *layer)
+int LayerDefaultIsOpen(layerObj *layer)
{
- return MS_FALSE;
+ return MS_FALSE;
}
-int
-LayerDefaultWhichShapes(layerObj *layer, rectObj rect)
+int LayerDefaultWhichShapes(layerObj *layer, rectObj rect)
{
- return MS_SUCCESS;
+ return MS_SUCCESS;
}
-int
-LayerDefaultNextShape(layerObj *layer, shapeObj *shape)
+int LayerDefaultNextShape(layerObj *layer, shapeObj *shape)
{
- return MS_FAILURE;
+ return MS_FAILURE;
}
+int LayerDefaultResultsGetShape(layerObj *layer, shapeObj *shape, int tile, long record)
+{
+ return MS_FAILURE;
+}
-int
-LayerDefaultGetShape(layerObj *layer, shapeObj *shape,
- int tile, long record)
+int LayerDefaultGetShape(layerObj *layer, shapeObj *shape, int tile, long record)
{
- return MS_FAILURE;
+ return MS_FAILURE;
}
-int
-LayerDefaultClose(layerObj *layer)
+int LayerDefaultClose(layerObj *layer)
{
- return MS_SUCCESS;
+ return MS_SUCCESS;
}
-int
-LayerDefaultGetItems(layerObj *layer)
+int LayerDefaultGetItems(layerObj *layer)
{
return MS_SUCCESS; /* returning no items is legit */
}
@@ -947,47 +957,39 @@
#endif
}
-int
-LayerDefaultGetExtent(layerObj *layer, rectObj *extent)
+int LayerDefaultGetExtent(layerObj *layer, rectObj *extent)
{
- return MS_FAILURE;
+ return MS_FAILURE;
}
-int
-LayerDefaultGetAutoStyle(mapObj *map, layerObj *layer, classObj *c,
- int tile, long record)
+int LayerDefaultGetAutoStyle(mapObj *map, layerObj *layer, classObj *c, int tile, long record)
{
- msSetError(MS_MISCERR, "'STYLEITEM AUTO' not supported for this data source.", "msLayerGetAutoStyle()");
- return MS_FAILURE;
+ msSetError(MS_MISCERR, "'STYLEITEM AUTO' not supported for this data source.", "msLayerGetAutoStyle()");
+ return MS_FAILURE;
}
-int
-LayerDefaultCloseConnection(layerObj *layer)
+int LayerDefaultCloseConnection(layerObj *layer)
{
- return MS_SUCCESS;
+ return MS_SUCCESS;
}
-
-int
-LayerDefaultCreateItems(layerObj *layer,
- const int nt)
+int LayerDefaultCreateItems(layerObj *layer, const int nt)
{
- if (nt > 0) {
- layer->items = (char **)calloc(nt, sizeof(char *)); /* should be more than enough space */
- if(!layer->items) {
- msSetError(MS_MEMERR, NULL, "LayerDefaultCreateItems()");
- return(MS_FAILURE);
- }
- layer->numitems = 0;
+ if (nt > 0) {
+ layer->items = (char **)calloc(nt, sizeof(char *)); /* should be more than enough space */
+ if(!layer->items) {
+ msSetError(MS_MEMERR, NULL, "LayerDefaultCreateItems()");
+ return(MS_FAILURE);
}
- return MS_SUCCESS;
+ layer->numitems = 0;
+ }
+ return MS_SUCCESS;
}
-int
-LayerDefaultGetNumFeatures(layerObj *layer)
+int LayerDefaultGetNumFeatures(layerObj *layer)
{
- msSetError(MS_SHPERR, "Not an inline layer", "msLayerGetNumFeatures()");
- return MS_FAILURE;
+ msSetError(MS_SHPERR, "Not an inline layer", "msLayerGetNumFeatures()");
+ return MS_FAILURE;
}
/*
@@ -1020,122 +1022,116 @@
return msInitializeVirtualTable(layer) ;
}
-static int
-populateVirtualTable(layerVTableObj *vtable)
+static int populateVirtualTable(layerVTableObj *vtable)
{
- assert(vtable != NULL);
+ assert(vtable != NULL);
- vtable->LayerInitItemInfo = LayerDefaultInitItemInfo;
- vtable->LayerFreeItemInfo = LayerDefaultFreeItemInfo;
- vtable->LayerOpen = LayerDefaultOpen;
- vtable->LayerIsOpen = LayerDefaultIsOpen;
- vtable->LayerWhichShapes = LayerDefaultWhichShapes;
+ vtable->LayerInitItemInfo = LayerDefaultInitItemInfo;
+ vtable->LayerFreeItemInfo = LayerDefaultFreeItemInfo;
+ vtable->LayerOpen = LayerDefaultOpen;
+ vtable->LayerIsOpen = LayerDefaultIsOpen;
+ vtable->LayerWhichShapes = LayerDefaultWhichShapes;
- vtable->LayerNextShape = LayerDefaultNextShape;
- vtable->LayerGetShape = LayerDefaultGetShape;
- vtable->LayerClose = LayerDefaultClose;
- vtable->LayerGetItems = LayerDefaultGetItems;
- vtable->LayerGetExtent = LayerDefaultGetExtent;
+ vtable->LayerNextShape = LayerDefaultNextShape;
+ vtable->LayerResultsGetShape = LayerDefaultResultsGetShape;
+ vtable->LayerGetShape = LayerDefaultGetShape;
+ vtable->LayerClose = LayerDefaultClose;
+ vtable->LayerGetItems = LayerDefaultGetItems;
+ vtable->LayerGetExtent = LayerDefaultGetExtent;
- vtable->LayerGetAutoStyle = LayerDefaultGetAutoStyle;
- vtable->LayerCloseConnection = LayerDefaultCloseConnection;
- vtable->LayerSetTimeFilter = msLayerMakePlainTimeFilter;
+ vtable->LayerGetAutoStyle = LayerDefaultGetAutoStyle;
+ vtable->LayerCloseConnection = LayerDefaultCloseConnection;
+ vtable->LayerSetTimeFilter = msLayerMakePlainTimeFilter;
- vtable->LayerApplyFilterToLayer = msLayerApplyPlainFilterToLayer;
+ vtable->LayerApplyFilterToLayer = msLayerApplyPlainFilterToLayer;
- vtable->LayerCreateItems = LayerDefaultCreateItems;
+ vtable->LayerCreateItems = LayerDefaultCreateItems;
- vtable->LayerGetNumFeatures = LayerDefaultGetNumFeatures;
+ vtable->LayerGetNumFeatures = LayerDefaultGetNumFeatures;
- return MS_SUCCESS;
+ return MS_SUCCESS;
}
-static int
-createVirtualTable(layerVTableObj **vtable)
+static int createVirtualTable(layerVTableObj **vtable)
{
- *vtable = malloc(sizeof(**vtable));
- if ( ! *vtable) {
- return MS_FAILURE;
- }
- return populateVirtualTable(*vtable);
+ *vtable = malloc(sizeof(**vtable));
+ if ( ! *vtable) {
+ return MS_FAILURE;
+ }
+ return populateVirtualTable(*vtable);
}
-static int
-destroyVirtualTable(layerVTableObj **vtable)
+static int destroyVirtualTable(layerVTableObj **vtable)
{
- memset(*vtable, 0, sizeof(**vtable));
- msFree(*vtable);
- *vtable = NULL;
- return MS_SUCCESS;
+ memset(*vtable, 0, sizeof(**vtable));
+ msFree(*vtable);
+ *vtable = NULL;
+ return MS_SUCCESS;
}
-int
-msInitializeVirtualTable(layerObj *layer)
+int msInitializeVirtualTable(layerObj *layer)
{
- if (layer->vtable) {
- destroyVirtualTable(&layer->vtable);
- }
- createVirtualTable(&layer->vtable);
+ if (layer->vtable) {
+ destroyVirtualTable(&layer->vtable);
+ }
+ createVirtualTable(&layer->vtable);
+
+ if(layer->features && layer->connectiontype != MS_GRATICULE )
+ layer->connectiontype = MS_INLINE;
-
- if(layer->features && layer->connectiontype != MS_GRATICULE )
- layer->connectiontype = MS_INLINE;
+ if(layer->tileindex && layer->connectiontype == MS_SHAPEFILE)
+ layer->connectiontype = MS_TILED_SHAPEFILE;
- if(layer->tileindex && layer->connectiontype == MS_SHAPEFILE)
- layer->connectiontype = MS_TILED_SHAPEFILE;
+ if(layer->type == MS_LAYER_RASTER && layer->connectiontype != MS_WMS)
+ layer->connectiontype = MS_RASTER;
- if(layer->type == MS_LAYER_RASTER && layer->connectiontype != MS_WMS)
- layer->connectiontype = MS_RASTER;
-
-
- switch(layer->connectiontype) {
- case(MS_INLINE):
- return(msINLINELayerInitializeVirtualTable(layer));
- break;
- case(MS_SHAPEFILE):
- return(msShapeFileLayerInitializeVirtualTable(layer));
- break;
- case(MS_TILED_SHAPEFILE):
- return(msTiledSHPLayerInitializeVirtualTable(layer));
- break;
- case(MS_SDE):
- return(msSDELayerInitializeVirtualTable(layer));
- break;
- case(MS_OGR):
- return(msOGRLayerInitializeVirtualTable(layer));
- break;
- case(MS_POSTGIS):
- return(msPostGISLayerInitializeVirtualTable(layer));
- break;
- case(MS_WMS):
- /* WMS should be treated as a raster layer */
- return(msRASTERLayerInitializeVirtualTable(layer));
- break;
- case(MS_ORACLESPATIAL):
- return(msOracleSpatialLayerInitializeVirtualTable(layer));
- break;
- case(MS_WFS):
- return(msWFSLayerInitializeVirtualTable(layer));
- break;
- case(MS_GRATICULE):
- return(msGraticuleLayerInitializeVirtualTable(layer));
- break;
- case(MS_MYGIS):
- return(msMYGISLayerInitializeVirtualTable(layer));
- break;
- case(MS_RASTER):
- return(msRASTERLayerInitializeVirtualTable(layer));
- break;
- case(MS_PLUGIN):
- return(msPluginLayerInitializeVirtualTable(layer));
- break;
- default:
- msSetError(MS_MISCERR,
- "Unknown connectiontype, it was %d",
- "msInitializeVirtualTable()", layer->connectiontype);
- return MS_FAILURE;
- break;
+ switch(layer->connectiontype) {
+ case(MS_INLINE):
+ return(msINLINELayerInitializeVirtualTable(layer));
+ break;
+ case(MS_SHAPEFILE):
+ return(msShapeFileLayerInitializeVirtualTable(layer));
+ break;
+ case(MS_TILED_SHAPEFILE):
+ return(msTiledSHPLayerInitializeVirtualTable(layer));
+ break;
+ case(MS_SDE):
+ return(msSDELayerInitializeVirtualTable(layer));
+ break;
+ case(MS_OGR):
+ return(msOGRLayerInitializeVirtualTable(layer));
+ break;
+ case(MS_POSTGIS):
+ return(msPostGISLayerInitializeVirtualTable(layer));
+ break;
+ case(MS_WMS):
+ /* WMS should be treated as a raster layer */
+ return(msRASTERLayerInitializeVirtualTable(layer));
+ break;
+ case(MS_ORACLESPATIAL):
+ return(msOracleSpatialLayerInitializeVirtualTable(layer));
+ break;
+ case(MS_WFS):
+ return(msWFSLayerInitializeVirtualTable(layer));
+ break;
+ case(MS_GRATICULE):
+ return(msGraticuleLayerInitializeVirtualTable(layer));
+ break;
+ case(MS_MYGIS):
+ return(msMYGISLayerInitializeVirtualTable(layer));
+ break;
+ case(MS_RASTER):
+ return(msRASTERLayerInitializeVirtualTable(layer));
+ break;
+ case(MS_PLUGIN):
+ return(msPluginLayerInitializeVirtualTable(layer));
+ break;
+ default:
+ msSetError(MS_MISCERR, "Unknown connectiontype, it was %d", "msInitializeVirtualTable()", layer->connectiontype);
+ return MS_FAILURE;
+ break;
}
+
/* not reached */
return MS_FAILURE;
}
@@ -1237,6 +1233,7 @@
layer->vtable->LayerIsOpen = msINLINELayerIsOpen;
/* layer->vtable->LayerWhichShapes, use default */
layer->vtable->LayerNextShape = msINLINELayerNextShape;
+ layer->vtable->LayerResultsGetShape = msINLINELayerGetShape; /* no special version, use ...GetShape() */
layer->vtable->LayerGetShape = msINLINELayerGetShape;
/* layer->vtable->LayerClose, use default */
/* layer->vtable->LayerGetItems, use default */
Modified: trunk/mapserver/mapmygis.c
===================================================================
--- trunk/mapserver/mapmygis.c 2009-07-21 19:34:36 UTC (rev 9199)
+++ trunk/mapserver/mapmygis.c 2009-07-22 04:20:44 UTC (rev 9200)
@@ -1,5 +1,5 @@
/******************************************************************************
- * $Id:$
+ * $Id$
*
* Project: MapServer
* Purpose: Implements the MySQL/"MyGIS" connection type support.
@@ -1980,23 +1980,18 @@
layer->vtable->LayerIsOpen = msMYGISLayerIsOpen;
layer->vtable->LayerWhichShapes = msMYGISLayerWhichShapes;
layer->vtable->LayerNextShape = msMYGISLayerNextShape;
+ layer->vtable->LayerResultsGetShape = msMYGISLayerGetShapeVT; /* no special version, use ...GetShape() */
layer->vtable->LayerGetShape = msMYGISLayerGetShapeVT;
-
layer->vtable->LayerClose = msMYGISLayerClose;
layer->vtable->LayerGetItems = msMYGISLayerGetItems;
layer->vtable->LayerGetExtent = msMYGISLayerGetExtent;
-
/* layer->vtable->LayerGetAutoStyle, use default */
-
layer->vtable->LayerCloseConnection = msMYGISLayerClose;
-
layer->vtable->LayerSetTimeFilter = msLayerMakePlainTimeFilter;
-
/* layer->vtable->LayerApplyFilterToLayer, use default */
/* layer->vtable->LayerCreateItems, use default */
/* layer->vtable->LayerGetNumFeatures, use default */
-
return MS_SUCCESS;
}
Modified: trunk/mapserver/mapogr.cpp
===================================================================
--- trunk/mapserver/mapogr.cpp 2009-07-21 19:34:36 UTC (rev 9199)
+++ trunk/mapserver/mapogr.cpp 2009-07-22 04:20:44 UTC (rev 9200)
@@ -3371,22 +3371,18 @@
layer->vtable->LayerIsOpen = msOGRLayerIsOpen;
layer->vtable->LayerWhichShapes = msOGRLayerWhichShapes;
layer->vtable->LayerNextShape = msOGRLayerNextShape;
+ layer->vtable->LayerResultsGetShape = msOGRLayerGetShape; /* no special version, use ...GetShape() */
layer->vtable->LayerGetShape = msOGRLayerGetShape;
-
layer->vtable->LayerClose = msOGRLayerClose;
layer->vtable->LayerGetItems = msOGRLayerGetItems;
layer->vtable->LayerGetExtent = msOGRLayerGetExtent;
layer->vtable->LayerGetAutoStyle = msOGRLayerGetAutoStyle;
-
/* layer->vtable->LayerCloseConnection, use default */
-
layer->vtable->LayerApplyFilterToLayer = msLayerApplyCondSQLFilterToLayer;
-
layer->vtable->LayerSetTimeFilter = msLayerMakeBackticsTimeFilter;
/* layer->vtable->LayerCreateItems, use default */
/* layer->vtable->LayerGetNumFeatures, use default */
-
return MS_SUCCESS;
}
Modified: trunk/mapserver/maporaclespatial.c
===================================================================
--- trunk/mapserver/maporaclespatial.c 2009-07-21 19:34:36 UTC (rev 9199)
+++ trunk/mapserver/maporaclespatial.c 2009-07-22 04:20:44 UTC (rev 9200)
@@ -2649,19 +2649,16 @@
vtable->LayerIsOpen = msOracleSpatialLayerIsOpen;
vtable->LayerWhichShapes = msOracleSpatialLayerWhichShapes;
vtable->LayerNextShape = msOracleSpatialLayerNextShape;
+ vtable->LayerResultsGetShape = msOracleSpatialLayerGetShapeVT; /* no special version, use ...GetShape() */
vtable->LayerGetShape = msOracleSpatialLayerGetShapeVT;
vtable->LayerClose = msOracleSpatialLayerClose;
vtable->LayerGetItems = msOracleSpatialLayerGetItems;
vtable->LayerGetExtent = msOracleSpatialLayerGetExtent;
-
/* layer->vtable->LayerGetAutoStyle, use default */
/* layer->vtable->LayerApplyFilterToLayer, use default */
-
vtable->LayerCloseConnection = msOracleSpatialLayerClose;
vtable->LayerApplyFilterToLayer = msLayerApplyCondSQLFilterToLayer;
-
vtable->LayerSetTimeFilter = msLayerMakePlainTimeFilter;
-
/* layer->vtable->LayerGetNumFeatures, use default */
return MS_SUCCESS;
@@ -2680,18 +2677,14 @@
layer->vtable->LayerIsOpen = msOracleSpatialLayerIsOpen;
layer->vtable->LayerWhichShapes = msOracleSpatialLayerWhichShapes;
layer->vtable->LayerNextShape = msOracleSpatialLayerNextShape;
+ layer->vtable->LayerResultsGetShape = msOracleSpatialLayerGetShapeVT; /* no special version, use ...GetShape() */
layer->vtable->LayerGetShape = msOracleSpatialLayerGetShapeVT;
-
layer->vtable->LayerClose = msOracleSpatialLayerClose;
layer->vtable->LayerGetItems = msOracleSpatialLayerGetItems;
layer->vtable->LayerGetExtent = msOracleSpatialLayerGetExtent;
-
/* layer->vtable->LayerGetAutoStyle, use default */
-
layer->vtable->LayerCloseConnection = msOracleSpatialLayerClose;
-
layer->vtable->LayerApplyFilterToLayer = msLayerApplyCondSQLFilterToLayer;
-
layer->vtable->LayerSetTimeFilter = msLayerMakePlainTimeFilter;
/* layer->vtable->LayerCreateItems, use default */
/* layer->vtable->LayerGetNumFeatures, use default */
Modified: trunk/mapserver/mappostgis.c
===================================================================
--- trunk/mapserver/mappostgis.c 2009-07-21 19:34:36 UTC (rev 9199)
+++ trunk/mapserver/mappostgis.c 2009-07-22 04:20:44 UTC (rev 9200)
@@ -2397,25 +2397,17 @@
layer->vtable->LayerIsOpen = msPostGISLayerIsOpen;
layer->vtable->LayerWhichShapes = msPostGISLayerWhichShapes;
layer->vtable->LayerNextShape = msPostGISLayerNextShape;
+ layer->vtable->LayerResultsGetShape = msPostGISLayerGetShape; /* no special version, use ...GetShape() */
layer->vtable->LayerGetShape = msPostGISLayerGetShape;
-
layer->vtable->LayerClose = msPostGISLayerClose;
-
layer->vtable->LayerGetItems = msPostGISLayerGetItems;
layer->vtable->LayerGetExtent = msPostGISLayerGetExtent;
-
layer->vtable->LayerApplyFilterToLayer = msLayerApplyCondSQLFilterToLayer;
-
/* layer->vtable->LayerGetAutoStyle, not supported for this layer */
layer->vtable->LayerCloseConnection = msPostGISLayerClose;
-
layer->vtable->LayerSetTimeFilter = msPostGISLayerSetTimeFilter;
/* layer->vtable->LayerCreateItems, use default */
/* layer->vtable->LayerGetNumFeatures, use default */
-
return MS_SUCCESS;
}
-
-
-
Modified: trunk/mapserver/maprasterquery.c
===================================================================
--- trunk/mapserver/maprasterquery.c 2009-07-21 19:34:36 UTC (rev 9199)
+++ trunk/mapserver/maprasterquery.c 2009-07-22 04:20:44 UTC (rev 9200)
@@ -1431,20 +1431,16 @@
layer->vtable->LayerIsOpen = msRASTERLayerIsOpen;
layer->vtable->LayerWhichShapes = msRASTERLayerWhichShapes;
layer->vtable->LayerNextShape = msRASTERLayerNextShape;
+ layer->vtable->LayerResultsGetShape = msRASTERLayerGetShape; /* no special version, use ...GetShape() */
layer->vtable->LayerGetShape = msRASTERLayerGetShape;
-
layer->vtable->LayerClose = msRASTERLayerClose;
layer->vtable->LayerGetItems = msRASTERLayerGetItems;
layer->vtable->LayerGetExtent = msRASTERLayerGetExtent;
-
/* layer->vtable->LayerGetAutoStyle, use default */
/* layer->vtable->LayerApplyFilterToLayer, use default */
-
layer->vtable->LayerCloseConnection = msRASTERLayerClose;
-
/* we use backtics for proper tileindex shapefile functioning */
layer->vtable->LayerSetTimeFilter = msRASTERLayerSetTimeFilter;
-
/* layer->vtable->LayerCreateItems, use default */
/* layer->vtable->LayerGetNumFeatures, use default */
Modified: trunk/mapserver/mapsde.c
===================================================================
--- trunk/mapserver/mapsde.c 2009-07-21 19:34:36 UTC (rev 9199)
+++ trunk/mapserver/mapsde.c 2009-07-22 04:20:44 UTC (rev 9200)
@@ -2179,6 +2179,7 @@
vtable->LayerIsOpen = msSDELayerIsOpen;
vtable->LayerWhichShapes = msSDELayerWhichShapes;
vtable->LayerNextShape = msSDELayerNextShape;
+ vtable->LayerResultsGetShape = msSDELayerGetShapeVT; /* no special version, use ...GetShape() */
vtable->LayerGetShape = msSDELayerGetShapeVT;
vtable->LayerClose = msSDELayerClose;
vtable->LayerGetItems = msSDELayerGetItems;
@@ -2211,17 +2212,14 @@
layer->vtable->LayerIsOpen = msSDELayerIsOpen;
layer->vtable->LayerWhichShapes = msSDELayerWhichShapes;
layer->vtable->LayerNextShape = msSDELayerNextShape;
+ layer->vtable->LayerResultsGetShape = msSDELayerGetShapeVT; /* no special version, use ...GetShape() */
layer->vtable->LayerGetShape = msSDELayerGetShapeVT;
layer->vtable->LayerClose = msSDELayerClose;
layer->vtable->LayerGetItems = msSDELayerGetItems;
layer->vtable->LayerGetExtent = msSDELayerGetExtent;
-
/* layer->vtable->LayerGetAutoStyle, use default */
/* layer->vtable->LayerApplyFilterToLayer, use default */
-
- /* SDE uses pooled connections, close from msCloseConnections */
- layer->vtable->LayerCloseConnection = msSDELayerCloseConnection;
-
+ layer->vtable->LayerCloseConnection = msSDELayerCloseConnection; /* SDE uses pooled connections, close from msCloseConnections */
layer->vtable->LayerSetTimeFilter = msLayerMakePlainTimeFilter;
layer->vtable->LayerCreateItems = msSDELayerCreateItems;
/* layer->vtable->LayerGetNumFeatures, use default */
Modified: trunk/mapserver/mapserver.h
===================================================================
--- trunk/mapserver/mapserver.h 2009-07-21 19:34:36 UTC (rev 9199)
+++ trunk/mapserver/mapserver.h 2009-07-22 04:20:44 UTC (rev 9200)
@@ -1489,6 +1489,8 @@
int (*LayerIsOpen)(layerObj *layer);
int (*LayerWhichShapes)(layerObj *layer, rectObj rect);
int (*LayerNextShape)(layerObj *layer, shapeObj *shape);
+ int (*LayerResultsGetShape)(layerObj *layer, shapeObj *shape,
+ int tile, long record);
int (*LayerGetShape)(layerObj *layer, shapeObj *shape,
int tile, long record);
int (*LayerClose)(layerObj *layer);
Modified: trunk/mapserver/mapshape.c
===================================================================
--- trunk/mapserver/mapshape.c 2009-07-21 19:34:36 UTC (rev 9199)
+++ trunk/mapserver/mapshape.c 2009-07-22 04:20:44 UTC (rev 9200)
@@ -2345,48 +2345,44 @@
void msTiledSHPLayerFreeItemInfo(layerObj *layer)
{
- if(layer->iteminfo) {
- free(layer->iteminfo);
- layer->iteminfo = NULL;
- }
+ if(layer->iteminfo) {
+ free(layer->iteminfo);
+ layer->iteminfo = NULL;
+ }
}
int msTiledSHPLayerIsOpen(layerObj *layer)
{
- if(layer->layerinfo)
- return MS_TRUE;
- else
- return MS_FALSE;
+ if(layer->layerinfo)
+ return MS_TRUE;
+ else
+ return MS_FALSE;
}
int msTiledSHPLayerInitializeVirtualTable(layerObj *layer)
{
- assert(layer != NULL);
- assert(layer->vtable != NULL);
+ assert(layer != NULL);
+ assert(layer->vtable != NULL);
- layer->vtable->LayerInitItemInfo = msTiledSHPLayerInitItemInfo;
- layer->vtable->LayerFreeItemInfo = msTiledSHPLayerFreeItemInfo;
- layer->vtable->LayerOpen = msTiledSHPOpenFile;
-
- layer->vtable->LayerIsOpen = msTiledSHPLayerIsOpen;
- layer->vtable->LayerWhichShapes = msTiledSHPWhichShapes;
- layer->vtable->LayerNextShape = msTiledSHPNextShape;
- layer->vtable->LayerGetShape = msTiledSHPGetShape;
-
- layer->vtable->LayerClose = msTiledSHPCloseVT;
- layer->vtable->LayerGetItems = msTiledSHPLayerGetItems;
- layer->vtable->LayerGetExtent = msTiledSHPLayerGetExtent;
-
+ layer->vtable->LayerInitItemInfo = msTiledSHPLayerInitItemInfo;
+ layer->vtable->LayerFreeItemInfo = msTiledSHPLayerFreeItemInfo;
+ layer->vtable->LayerOpen = msTiledSHPOpenFile;
+ layer->vtable->LayerIsOpen = msTiledSHPLayerIsOpen;
+ layer->vtable->LayerWhichShapes = msTiledSHPWhichShapes;
+ layer->vtable->LayerNextShape = msTiledSHPNextShape;
+ layer->vtable->LayerResultsGetShape = msTiledSHPGetShape; /* no special version, use ...GetShape() */
+ layer->vtable->LayerGetShape = msTiledSHPGetShape;
+ layer->vtable->LayerClose = msTiledSHPCloseVT;
+ layer->vtable->LayerGetItems = msTiledSHPLayerGetItems;
+ layer->vtable->LayerGetExtent = msTiledSHPLayerGetExtent;
/* layer->vtable->LayerApplyFilterToLayer, use default */
-
- /* layer->vtable->LayerGetAutoStyle, use default */
- /* layer->vtable->LayerCloseConnection, use default */;
-
- layer->vtable->LayerSetTimeFilter = msLayerMakeBackticsTimeFilter;
- /* layer->vtable->LayerCreateItems, use default */
+ /* layer->vtable->LayerGetAutoStyle, use default */
+ /* layer->vtable->LayerCloseConnection, use default */;
+ layer->vtable->LayerSetTimeFilter = msLayerMakeBackticsTimeFilter;
+ /* layer->vtable->LayerCreateItems, use default */
/* layer->vtable->LayerGetNumFeatures, use default */
- return MS_SUCCESS;
+ return MS_SUCCESS;
}
/* SHAPEFILE Layer virtual table functions */
@@ -2605,6 +2601,7 @@
layer->vtable->LayerIsOpen = msShapeFileLayerIsOpen;
layer->vtable->LayerWhichShapes = msShapeFileLayerWhichShapes;
layer->vtable->LayerNextShape = msShapeFileLayerNextShape;
+ layer->vtable->LayerResultsGetShape = msShapeFileLayerGetShape; /* no special version, use ...GetShape() */
layer->vtable->LayerGetShape = msShapeFileLayerGetShape;
layer->vtable->LayerClose = msShapeFileLayerClose;
layer->vtable->LayerGetItems = msShapeFileLayerGetItems;
Modified: trunk/mapserver/mapwfslayer.c
===================================================================
--- trunk/mapserver/mapwfslayer.c 2009-07-21 19:34:36 UTC (rev 9199)
+++ trunk/mapserver/mapwfslayer.c 2009-07-22 04:20:44 UTC (rev 9200)
@@ -1183,17 +1183,14 @@
layer->vtable->LayerIsOpen = msWFSLayerIsOpen;
layer->vtable->LayerWhichShapes = msWFSLayerWhichShapes;
layer->vtable->LayerNextShape = msOGRLayerNextShape; /* yes, OGR */
+ layer->vtable->LayerResultsGetShape = msOGRLayerGetShape; /* yes, OGR but no special version, use ...GetShape() */
layer->vtable->LayerGetShape = msOGRLayerGetShape; /* yes, OGR */
-
layer->vtable->LayerClose = msWFSLayerClose;
layer->vtable->LayerGetItems = msWFSLayerGetItems;
layer->vtable->LayerGetExtent = msOGRLayerGetExtent; /* yes, OGR */
/* layer->vtable->LayerGetAutoStyle, use default */
-
/* layer->vtable->LayerApplyFilterToLayer, use default */
-
/* layer->vtable->LayerCloseConnection, use default */
-
layer->vtable->LayerSetTimeFilter = msLayerMakePlainTimeFilter;
/* layer->vtable->LayerCreateItems, use default */
/* layer->vtable->LayerGetNumFeatures, use default */
More information about the mapserver-commits
mailing list