[mapserver-commits] r8724 - sandbox/single-pass/mapserver
svn at osgeo.org
svn at osgeo.org
Mon Mar 9 15:30:07 EDT 2009
Author: sdlime
Date: 2009-03-09 15:30:02 -0400 (Mon, 09 Mar 2009)
New Revision: 8724
Modified:
sandbox/single-pass/mapserver/maplayer.c
sandbox/single-pass/mapserver/mapserver.h
sandbox/single-pass/mapserver/maptemplate.c
Log:
Added msLayerSeekShape() vtable function...
Modified: sandbox/single-pass/mapserver/maplayer.c
===================================================================
--- sandbox/single-pass/mapserver/maplayer.c 2009-03-09 19:29:36 UTC (rev 8723)
+++ sandbox/single-pass/mapserver/maplayer.c 2009-03-09 19:30:02 UTC (rev 8724)
@@ -182,6 +182,20 @@
}
/*
+** Returns the shape in its feature staff offset by a number of features (offset 0 is the first feature)
+*/
+int msLayerSeekShape(layerObj *layer, shapeObj *shape, long offset)
+{
+ if ( ! layer->vtable) {
+ int rv = msInitializeVirtualTable(layer);
+ if (rv != MS_SUCCESS)
+ return rv;
+ }
+
+ return layer->vtable->LayerSeekShape(layer, shape, offset);
+}
+
+/*
** Closes resources used by a particular layer.
*/
void msLayerClose(layerObj *layer)
@@ -384,9 +398,9 @@
rv = msLayerGetItems(layer); /* get a list of all attributes available for this layer (including JOINs) */
if(rv != MS_SUCCESS) return(rv);
- printf("Items (which code):\n");
- for(i=0;i<layer->numitems;i++)
- printf(" %d: %s\n", i, layer->items[i]);
+ // printf("Items (which code):\n");
+ // for(i=0;i<layer->numitems;i++)
+ // printf(" %d: %s\n", i, layer->items[i]);
items = layer->items; /* save for later */
numitems = layer->numitems;
@@ -1265,6 +1279,11 @@
return MS_SUCCESS;
}
+int LayerDefaultSeekShape(layerObj *layer, shapeObj *shape, long offset)
+{
+ return MS_SUCCESS;
+}
+
/*
* msConnectLayer
*
@@ -1323,6 +1342,7 @@
vtable->LayerGetNumFeatures = LayerDefaultGetNumFeatures;
vtable->LayerRewind = LayerDefaultRewind;
+ vtable->LayerSeekShape = LayerDefaultSeekShape;
return MS_SUCCESS;
}
Modified: sandbox/single-pass/mapserver/mapserver.h
===================================================================
--- sandbox/single-pass/mapserver/mapserver.h 2009-03-09 19:29:36 UTC (rev 8723)
+++ sandbox/single-pass/mapserver/mapserver.h 2009-03-09 19:30:02 UTC (rev 8724)
@@ -1442,6 +1442,7 @@
int (*LayerCreateItems)(layerObj *layer, int nt);
int (*LayerGetNumFeatures)(layerObj *layer);
int (*LayerRewind)(layerObj *layer);
+ int (*LayerSeekShape)(layerObj *layer, shapeObj *shape, long offset);
};
#endif /*SWIG*/
@@ -1786,6 +1787,7 @@
MS_DLL_EXPORT int msLayerIsOpen(layerObj *layer);
MS_DLL_EXPORT void msLayerClose(layerObj *layer);
MS_DLL_EXPORT int msLayerRewind(layerObj *layer);
+MS_DLL_EXPORT int msLayerSeekShape(layerObj *layer, shapeObj *shape, long offset);
MS_DLL_EXPORT int msLayerWhichShapes(layerObj *layer, rectObj rect);
MS_DLL_EXPORT int msLayerWhichItems(layerObj *layer, int classify, int annotate, char *metadata);
MS_DLL_EXPORT int msLayerWhichItemsNew(layerObj *layer, int classify, int annotate, int all, char *metadata);
Modified: sandbox/single-pass/mapserver/maptemplate.c
===================================================================
--- sandbox/single-pass/mapserver/maptemplate.c 2009-03-09 19:29:36 UTC (rev 8723)
+++ sandbox/single-pass/mapserver/maptemplate.c 2009-03-09 19:30:02 UTC (rev 8724)
@@ -840,9 +840,9 @@
// status = msLayerGetItems(layer); /* retrieve all the item names */
// if(status != MS_SUCCESS) return status;
- printf("Items (template code):\n");
- for(i=0;i<layer->numitems;i++)
- printf(" %d: %s\n", i, layer->items[i]);
+ // printf("Items (template code):\n");
+ // for(i=0;i<layer->numitems;i++)
+ // printf(" %d: %s\n", i, layer->items[i]);
if(layer->numjoins > 0) { /* initialize necessary JOINs here */
for(j=0; j<layer->numjoins; j++) {
More information about the mapserver-commits
mailing list