[mapserver-commits] r10007 - trunk/mapserver
svn at osgeo.org
svn at osgeo.org
Thu Mar 25 09:46:29 EDT 2010
Author: assefa
Date: 2010-03-25 09:46:25 -0400 (Thu, 25 Mar 2010)
New Revision: 10007
Modified:
trunk/mapserver/mapserver.h
trunk/mapserver/mapwfslayer.c
Log:
Fix GetFeatureInfo queries on WFS layers (#3403)
Modified: trunk/mapserver/mapserver.h
===================================================================
--- trunk/mapserver/mapserver.h 2010-03-25 04:29:16 UTC (rev 10006)
+++ trunk/mapserver/mapserver.h 2010-03-25 13:46:25 UTC (rev 10007)
@@ -1989,6 +1989,7 @@
int msOGRLayerGetItems(layerObj *layer);
void msOGRLayerFreeItemInfo(layerObj *layer);
int msOGRLayerGetShape(layerObj *layer, shapeObj *shape, int tile, long record);
+int msOGRLayerResultGetShape(layerObj *layer, shapeObj *shape, int tile, long record);
int msOGRLayerGetExtent(layerObj *layer, rectObj *extent);
#ifdef USE_OGR
Modified: trunk/mapserver/mapwfslayer.c
===================================================================
--- trunk/mapserver/mapwfslayer.c 2010-03-25 04:29:16 UTC (rev 10006)
+++ trunk/mapserver/mapwfslayer.c 2010-03-25 13:46:25 UTC (rev 10007)
@@ -936,7 +936,46 @@
+/**********************************************************************
+ * msWFSLayerGetShape()
+ *
+ **********************************************************************/
+int msWFSLayerResultGetShape(layerObj *layer, shapeObj *shape, int tile,
+ long record)
+{
+#ifdef USE_WFS_LYR
+ msWFSLayerInfo* psInfo = NULL;
+ if(layer != NULL && layer->wfslayerinfo != NULL)
+ psInfo = (msWFSLayerInfo*)layer->wfslayerinfo;
+ else
+ {
+ msSetError(MS_WFSERR, "Layer is not opened.", "msWFSLayerResultGetShape()");
+ return MS_FAILURE;
+ }
+
+ if(psInfo->bLayerHasValidGML)
+ return msOGRLayerResultGetShape(layer, shape, tile, record);
+ else
+ {
+ /* Layer is successful, but there is no data to process */
+ msFreeShape(shape);
+ shape->type = MS_SHAPE_NULL;
+ return MS_FAILURE;
+ }
+#else
+/* ------------------------------------------------------------------
+ * WFS CONNECTION Support not included...
+ * ------------------------------------------------------------------ */
+ msSetError(MS_WFSCONNERR, "WFS CLIENT CONNECTION support is not available.",
+ "msWFSLayerResultGetShape()");
+ return(MS_FAILURE);
+#endif /* USE_WFS_LYR */
+
+}
+
+
+
/**********************************************************************
* msWFSLayerGetNextShape()
*
@@ -1321,7 +1360,7 @@
layer->vtable->LayerIsOpen = msWFSLayerIsOpen;
layer->vtable->LayerWhichShapes = msWFSLayerWhichShapes;
layer->vtable->LayerNextShape = msWFSLayerNextShape;
- layer->vtable->LayerResultsGetShape = msWFSLayerGetShape;
+ layer->vtable->LayerResultsGetShape = msWFSLayerResultGetShape;
layer->vtable->LayerGetShape = msWFSLayerGetShape;
layer->vtable->LayerClose = msWFSLayerClose;
layer->vtable->LayerGetItems = msWFSLayerGetItems;
More information about the mapserver-commits
mailing list