[mapserver-commits] r11881 - in branches/branch-6-0/mapserver: . mapscript/php mapscript/swiginc

svn at osgeo.org svn at osgeo.org
Thu Jul 7 15:55:44 EDT 2011


Author: sdlime
Date: 2011-07-07 12:55:43 -0700 (Thu, 07 Jul 2011)
New Revision: 11881

Modified:
   branches/branch-6-0/mapserver/HISTORY.TXT
   branches/branch-6-0/mapserver/mapchart.c
   branches/branch-6-0/mapserver/mapcluster.c
   branches/branch-6-0/mapserver/mapdraw.c
   branches/branch-6-0/mapserver/mapgraticule.c
   branches/branch-6-0/mapserver/maplayer.c
   branches/branch-6-0/mapserver/mapmssql2008.c
   branches/branch-6-0/mapserver/mapogr.cpp
   branches/branch-6-0/mapserver/maporaclespatial.c
   branches/branch-6-0/mapserver/mapows.h
   branches/branch-6-0/mapserver/mappostgis.c
   branches/branch-6-0/mapserver/mapquery.c
   branches/branch-6-0/mapserver/mapraster.c
   branches/branch-6-0/mapserver/maprasterquery.c
   branches/branch-6-0/mapserver/mapscript/php/mapscript_i.c
   branches/branch-6-0/mapserver/mapscript/swiginc/layer.i
   branches/branch-6-0/mapserver/mapsde.c
   branches/branch-6-0/mapserver/mapserver.h
   branches/branch-6-0/mapserver/mapshape.c
   branches/branch-6-0/mapserver/mapunion.c
   branches/branch-6-0/mapserver/mapwfslayer.c
Log:
Fix performance issue with Oracle and scrollable cursors (#3905).

Modified: branches/branch-6-0/mapserver/HISTORY.TXT
===================================================================
--- branches/branch-6-0/mapserver/HISTORY.TXT	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/HISTORY.TXT	2011-07-07 19:55:43 UTC (rev 11881)
@@ -14,6 +14,8 @@
 
 Version 6.0.1 (SVN branch-6-0):
 ---------------------------
+- Fix performance issue with Oracle and scrollable cursors (#3905)
+
 - Fix attribute binding for layer styles (#3941)
 
 - Added missing fclose() when writing query files (#3943)

Modified: branches/branch-6-0/mapserver/mapchart.c
===================================================================
--- branches/branch-6-0/mapserver/mapchart.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapchart.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -614,7 +614,7 @@
             msProjectRect(&map->projection, &layer->projection, &searchrect); /* project the searchrect to source coords */
     #endif
         
-        status = msLayerWhichShapes(layer, searchrect);
+        status = msLayerWhichShapes(layer, searchrect, MS_FALSE);
         if(status == MS_DONE) { /* no overlap */
             msLayerClose(layer);
             return MS_SUCCESS;

Modified: branches/branch-6-0/mapserver/mapcluster.c
===================================================================
--- branches/branch-6-0/mapserver/mapcluster.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapcluster.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -931,7 +931,7 @@
 #endif
 
 /* rebuild the clusters according to the current extent */
-int RebuildClusters(layerObj *layer)
+int RebuildClusters(layerObj *layer, int isQuery)
 {
     mapObj* map;
 	layerObj* srcLayer;
@@ -1031,7 +1031,7 @@
     srcLayer = &layerinfo->srcLayer;
 
     /* start retrieving the shapes */
-    status = msLayerWhichShapes(srcLayer, searchrect);
+    status = msLayerWhichShapes(srcLayer, searchrect, isQuery);
 	if(status == MS_DONE) 
 	{ /* no overlap */
         return MS_SUCCESS;
@@ -1302,10 +1302,10 @@
 }
 
 /* Execute a query for this layer */
-int msClusterLayerWhichShapes(layerObj *layer, rectObj rect)
+int msClusterLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery)
 {
     /* rebuild the cluster database */
-    return RebuildClusters(layer);
+  return RebuildClusters(layer, isQuery);
 }
 
 static int prepareShape(layerObj* layer, msClusterLayerInfo* layerinfo, clusterInfo* current, shapeObj* shape)

Modified: branches/branch-6-0/mapserver/mapdraw.c
===================================================================
--- branches/branch-6-0/mapserver/mapdraw.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapdraw.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -834,7 +834,7 @@
     msProjectRect(&map->projection, &layer->projection, &searchrect); /* project the searchrect to source coords */
 #endif
     
-  status = msLayerWhichShapes(layer, searchrect);
+  status = msLayerWhichShapes(layer, searchrect, MS_FALSE);
   if(status == MS_DONE) { /* no overlap */
     msLayerClose(layer);
     return MS_SUCCESS;

Modified: branches/branch-6-0/mapserver/mapgraticule.c
===================================================================
--- branches/branch-6-0/mapserver/mapgraticule.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapgraticule.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -152,7 +152,7 @@
 /**********************************************************************************************************************
  *
  */
-int msGraticuleLayerWhichShapes(layerObj *layer, rectObj rect)
+int msGraticuleLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery)
 {
   graticuleObj *pInfo = (graticuleObj *) layer->layerinfo;
   int iAxisTickCount = 0;
@@ -664,7 +664,7 @@
  
     msLayerOpen(layer);
    
-    status = msLayerWhichShapes(layer, searchrect);
+    status = msLayerWhichShapes(layer, searchrect, MS_FALSE);
     if(status == MS_DONE) { /* no overlap */
       msLayerClose(layer);
       return NULL;

Modified: branches/branch-6-0/mapserver/maplayer.c
===================================================================
--- branches/branch-6-0/mapserver/maplayer.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/maplayer.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -130,14 +130,14 @@
 ** Note that for shapefiles we apply any maxfeatures constraint at this point. That may be the only
 ** connection type where this is feasible.
 */
-int msLayerWhichShapes(layerObj *layer, rectObj rect)
+int msLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery)
 {
   if ( ! layer->vtable) {
       int rv =  msInitializeVirtualTable(layer);
       if (rv != MS_SUCCESS)
           return rv;
   }
-  return layer->vtable->LayerWhichShapes(layer, rect);
+  return layer->vtable->LayerWhichShapes(layer, rect, isQuery);
 }
 
 /*
@@ -1120,7 +1120,7 @@
   return MS_FALSE;
 }
 
-int LayerDefaultWhichShapes(layerObj *layer, rectObj rect)
+int LayerDefaultWhichShapes(layerObj *layer, rectObj rect, int isQuery)
 {
   return MS_SUCCESS;
 }

Modified: branches/branch-6-0/mapserver/mapmssql2008.c
===================================================================
--- branches/branch-6-0/mapserver/mapmssql2008.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapmssql2008.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -679,7 +679,7 @@
 }
 
 /* Execute SQL query for this layer */
-int msMSSQL2008LayerWhichShapes(layerObj *layer, rectObj rect)
+int msMSSQL2008LayerWhichShapes(layerObj *layer, rectObj rect, in isQuery)
 {
     msMSSQL2008LayerInfo  *layerinfo = 0;
     char    *query_str = 0;
@@ -1901,7 +1901,7 @@
     return MS_FAILURE;
 }
 
-int msMSSQL2008LayerWhichShapes(layerObj *layer, rectObj rect)
+int msMSSQL2008LayerWhichShapes(layerObj *layer, rectObj rect, int isQuery)
 {
     msSetError(MS_QUERYERR, "msMSSQL2008LayerWhichShapes called but unimplemented!(mapserver not compiled with MSSQL2008 support)", "msMSSQL2008LayerWhichShapes()");
     return MS_FAILURE;

Modified: branches/branch-6-0/mapserver/mapogr.cpp
===================================================================
--- branches/branch-6-0/mapserver/mapogr.cpp	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapogr.cpp	2011-07-07 19:55:43 UTC (rev 11881)
@@ -2376,7 +2376,7 @@
  * Returns MS_SUCCESS/MS_FAILURE, or MS_DONE if no shape matching the
  * layer's FILTER overlaps the selected region.
  **********************************************************************/
-int msOGRLayerWhichShapes(layerObj *layer, rectObj rect) 
+int msOGRLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery) 
 {
 #ifdef USE_OGR
   msOGRFileInfo *psInfo =(msOGRFileInfo*)layer->layerinfo;

Modified: branches/branch-6-0/mapserver/maporaclespatial.c
===================================================================
--- branches/branch-6-0/mapserver/maporaclespatial.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/maporaclespatial.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -1922,7 +1922,7 @@
 
 /* create SQL statement for retrieving shapes */
 /* Sets up cursor for use in *NextShape and *GetShape */
-int msOracleSpatialLayerWhichShapes( layerObj *layer, rectObj rect )
+int msOracleSpatialLayerWhichShapes( layerObj *layer, rectObj rect, int isQuery)
 {
     int success, i;
     int function = 0;
@@ -2199,6 +2199,9 @@
     
     if (success)
     {
+        int cursor_type = OCI_DEFAULT;
+        if(isQuery) cursor_type =OCI_STMT_SCROLLABLE_READONLY;
+
         success = TRY( hand,
             /* define spatial position adtp ADT object */
             OCIDefineByPos( sthand->stmthp, &adtp, hand->errhp, (ub4)numitemsinselect+1, (dvoid *)0, (sb4)0, SQLT_NTY, (dvoid *)0, (ub2 *)0, (ub2 *)0, (ub4)OCI_DEFAULT) )
@@ -2207,7 +2210,7 @@
             OCIDefineObject( adtp, hand->errhp, dthand->tdo, (dvoid **)sthand->obj, (ub4 *)0, (dvoid **)sthand->ind, (ub4 *)0 ) )
                && TRY(hand,
             /* execute */
-            OCIStmtExecute( hand->svchp, sthand->stmthp, hand->errhp, (ub4)ARRAY_SIZE, (ub4)0, (OCISnapshot *)NULL, (OCISnapshot *)NULL, (ub4)OCI_STMT_SCROLLABLE_READONLY ) )
+            OCIStmtExecute( hand->svchp, sthand->stmthp, hand->errhp, (ub4)ARRAY_SIZE, (ub4)0, (OCISnapshot *)NULL, (OCISnapshot *)NULL, (ub4)cursor_type ) )
                &&  TRY( hand,
             /* get rows fetched */
             OCIAttrGet( (dvoid *)sthand->stmthp, (ub4)OCI_HTYPE_STMT, (dvoid *)&sthand->rows_fetched, (ub4 *)0, (ub4)OCI_ATTR_ROW_COUNT, hand->errhp ) )
@@ -3518,7 +3521,7 @@
   return MS_FAILURE;
 }
 
-int msOracleSpatialLayerWhichShapes(layerObj *layer, rectObj rect)
+int msOracleSpatialLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery)
 {
   msSetError( MS_ORACLESPATIALERR, "OracleSpatial is not supported", "msOracleSpatialLayerWhichShapes()" );
   return MS_FAILURE;

Modified: branches/branch-6-0/mapserver/mapows.h
===================================================================
--- branches/branch-6-0/mapserver/mapows.h	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapows.h	2011-07-07 19:55:43 UTC (rev 11881)
@@ -435,7 +435,7 @@
 int msWFSLayerIsOpen(layerObj *lp); 
 int msWFSLayerInitItemInfo(layerObj *layer);
 int msWFSLayerGetItems(layerObj *layer);
-int msWFSLayerWhichShapes(layerObj *layer, rectObj rect);
+int msWFSLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery);
 int msWFSLayerClose(layerObj *lp);
 MS_DLL_EXPORT char *msWFSExecuteGetFeature(layerObj *lp);
 

Modified: branches/branch-6-0/mapserver/mappostgis.c
===================================================================
--- branches/branch-6-0/mapserver/mappostgis.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mappostgis.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -2399,7 +2399,7 @@
 **
 ** Registered vtable->LayerWhichShapes function.
 */
-int msPostGISLayerWhichShapes(layerObj *layer, rectObj rect) {
+int msPostGISLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery) {
 #ifdef USE_POSTGIS
     msPostGISLayerInfo *layerinfo = NULL;
     char *strSQL = NULL;

Modified: branches/branch-6-0/mapserver/mapquery.c
===================================================================
--- branches/branch-6-0/mapserver/mapquery.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapquery.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -674,7 +674,7 @@
     lp->project = MS_FALSE;
 #endif
 
-  status = msLayerWhichShapes(lp, searchrect);
+  status = msLayerWhichShapes(lp, searchrect, MS_TRUE);
   if(status == MS_DONE) { /* no overlap */
     msRestoreOldFilter(lp, old_filtertype, old_filteritem, old_filterstring); /* manually reset the filter */
     msLayerClose(lp);
@@ -853,7 +853,7 @@
       lp->project = MS_FALSE;
 #endif
 
-    status = msLayerWhichShapes(lp, search_rect);
+    status = msLayerWhichShapes(lp, search_rect, MS_TRUE);
     if(status == MS_DONE) { /* no overlap */
       msLayerClose(lp);
       continue;
@@ -1035,7 +1035,7 @@
     else
       lp->project = MS_FALSE;
 #endif
-    status = msLayerWhichShapes(lp, searchrect);
+    status = msLayerWhichShapes(lp, searchrect, MS_TRUE);
     if(status == MS_DONE) { /* no overlap */
       msLayerClose(lp);
       continue;
@@ -1276,7 +1276,7 @@
 	lp->project = MS_FALSE;
 #endif
 
-      status = msLayerWhichShapes(lp, searchrect);
+      status = msLayerWhichShapes(lp, searchrect, MS_TRUE);
       if(status == MS_DONE) { /* no overlap */
 	msLayerClose(lp);
 	break; /* next layer */
@@ -1548,7 +1548,7 @@
     else
       lp->project = MS_FALSE;
 #endif
-    status = msLayerWhichShapes(lp, searchrect);
+    status = msLayerWhichShapes(lp, searchrect, MS_TRUE);
     if(status == MS_DONE) { /* no overlap */
       msLayerClose(lp);
       continue;
@@ -1749,7 +1749,7 @@
       lp->project = MS_FALSE;
 #endif
 
-    status = msLayerWhichShapes(lp, searchrect);
+    status = msLayerWhichShapes(lp, searchrect, MS_TRUE);
     if(status == MS_DONE) { /* no overlap */
       msLayerClose(lp);
       continue;

Modified: branches/branch-6-0/mapserver/mapraster.c
===================================================================
--- branches/branch-6-0/mapserver/mapraster.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapraster.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -486,7 +486,7 @@
     /* if necessary, project the searchrect to source coords */
     if((map->projection.numargs > 0) && (layer->projection.numargs > 0)) msProjectRect(&map->projection, &layer->projection, &searchrect);
 #endif
-    status = msLayerWhichShapes(tlp, searchrect);
+    status = msLayerWhichShapes(tlp, searchrect, MS_FALSE);
     if (status != MS_SUCCESS) {
         /* Can be either MS_DONE or MS_FAILURE */
         if (status != MS_DONE) 

Modified: branches/branch-6-0/mapserver/maprasterquery.c
===================================================================
--- branches/branch-6-0/mapserver/maprasterquery.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/maprasterquery.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -831,7 +831,7 @@
         /* if necessary, project the searchrect to source coords */
         if((map->projection.numargs > 0) && (layer->projection.numargs > 0)) msProjectRect(&map->projection, &layer->projection, &searchrect);
 #endif
-        status = msLayerWhichShapes(tlp, searchrect);
+        status = msLayerWhichShapes(tlp, searchrect, MS_TRUE);
         if (status != MS_SUCCESS) {
             goto cleanup;
         }
@@ -1242,7 +1242,7 @@
 /************************************************************************/
 /*                      msRASTERLayerWhichShapes()                      */
 /************************************************************************/
-int msRASTERLayerWhichShapes(layerObj *layer, rectObj rect) 
+int msRASTERLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery) 
 
 {
 #ifndef USE_GDAL

Modified: branches/branch-6-0/mapserver/mapscript/php/mapscript_i.c
===================================================================
--- branches/branch-6-0/mapserver/mapscript/php/mapscript_i.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapscript/php/mapscript_i.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -457,7 +457,7 @@
     }
     self->connectiontype = oldconnectiontype;
 
-    return msLayerWhichShapes(self, *poRect);
+    return msLayerWhichShapes(self, *poRect, MS_FALSE);
 }
 
 

Modified: branches/branch-6-0/mapserver/mapscript/swiginc/layer.i
===================================================================
--- branches/branch-6-0/mapserver/mapscript/swiginc/layer.i	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapscript/swiginc/layer.i	2011-07-07 19:55:43 UTC (rev 11881)
@@ -165,7 +165,7 @@
         }
         self->connectiontype = oldconnectiontype;
 
-        return msLayerWhichShapes(self, rect);
+        return msLayerWhichShapes(self, rect, MS_FALSE);
     }	
 
     %newobject nextShape;

Modified: branches/branch-6-0/mapserver/mapsde.c
===================================================================
--- branches/branch-6-0/mapserver/mapsde.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapsde.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -1474,7 +1474,7 @@
 /*     starts a stream query using spatial filter.  Also limits the     */
 /*     query by the layer's FILTER item as well.                        */
 /* -------------------------------------------------------------------- */
-int msSDELayerWhichShapes(layerObj *layer, rectObj rect) {
+int msSDELayerWhichShapes(layerObj *layer, rectObj rect, int isQuery) {
 #ifdef USE_SDE
     long status;
     SE_ENVELOPE envelope;

Modified: branches/branch-6-0/mapserver/mapserver.h
===================================================================
--- branches/branch-6-0/mapserver/mapserver.h	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapserver.h	2011-07-07 19:55:43 UTC (rev 11881)
@@ -1648,7 +1648,7 @@
   void (*LayerFreeItemInfo)(layerObj *layer);
   int (*LayerOpen)(layerObj *layer);
   int (*LayerIsOpen)(layerObj *layer);
-  int (*LayerWhichShapes)(layerObj *layer, rectObj rect);
+  int (*LayerWhichShapes)(layerObj *layer, rectObj rect, int isQuery);
   int (*LayerNextShape)(layerObj *layer, shapeObj *shape);
   int (*LayerGetShape)(layerObj *layer, shapeObj *shape, resultObj *record);
   int (*LayerClose)(layerObj *layer);
@@ -2062,7 +2062,7 @@
 MS_DLL_EXPORT int msClusterLayerOpen(layerObj *layer); /* in mapcluster.c */
 MS_DLL_EXPORT int msLayerIsOpen(layerObj *layer);
 MS_DLL_EXPORT void msLayerClose(layerObj *layer);
-MS_DLL_EXPORT int msLayerWhichShapes(layerObj *layer, rectObj rect);
+MS_DLL_EXPORT int msLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery);
 MS_DLL_EXPORT int msLayerGetItemIndex(layerObj *layer, char *item);
 MS_DLL_EXPORT int msLayerWhichItems(layerObj *layer, int get_all, char *metadata); 
 MS_DLL_EXPORT int msLayerNextShape(layerObj *layer, shapeObj *shape);
@@ -2378,7 +2378,7 @@
 /* ==================================================================== */
 /*      Public prototype for mapogr.cpp functions.                      */
 /* ==================================================================== */
-int MS_DLL_EXPORT msOGRLayerWhichShapes(layerObj *layer, rectObj rect);
+int MS_DLL_EXPORT msOGRLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery);
 int MS_DLL_EXPORT msOGRLayerOpen(layerObj *layer, const char *pszOverrideConnection); /* in mapogr.cpp */
 int MS_DLL_EXPORT msOGRLayerClose(layerObj *layer);
 

Modified: branches/branch-6-0/mapserver/mapshape.c
===================================================================
--- branches/branch-6-0/mapserver/mapshape.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapshape.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -1962,7 +1962,7 @@
 }
 
 
-int msTiledSHPWhichShapes(layerObj *layer, rectObj rect)
+int msTiledSHPWhichShapes(layerObj *layer, rectObj rect, int isQuery)
 {
   int i, status;
   char *filename, tilename[MS_MAXPATHLEN];
@@ -1986,7 +1986,7 @@
     shapeObj tshape;
 
     tlp = (GET_LAYER(layer->map, tSHP->tilelayerindex));
-    status= msLayerWhichShapes(tlp, rect);
+    status= msLayerWhichShapes(tlp, rect, isQuery);
     if(status != MS_SUCCESS) return(status); /* could be MS_DONE or MS_FAILURE */
 
     msTileIndexAbsoluteDir(tiFileAbsDir, layer);
@@ -2535,7 +2535,7 @@
     return MS_FALSE;
 }
 
-int msSHPLayerWhichShapes(layerObj *layer, rectObj rect)
+int msSHPLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery)
 {
   int i, n1=0, n2=0;
   int status;

Modified: branches/branch-6-0/mapserver/mapunion.c
===================================================================
--- branches/branch-6-0/mapserver/mapunion.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapunion.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -333,7 +333,7 @@
     return MS_SUCCESS;
 }
 
-int msUnionLayerWhichShapes(layerObj *layer, rectObj rect)
+int msUnionLayerWhichShapes(layerObj *layer, rectObj rect, int isQuery)
 {
     int i;
     layerObj* srclayer;
@@ -362,7 +362,7 @@
         if(srclayer->transform == MS_TRUE && srclayer->project && layer->transform == MS_TRUE && layer->project &&msProjectionsDiffer(&(srclayer->projection), &(layer->projection)))
             msProjectRect(&layer->projection, &srclayer->projection, &srcRect); /* project the searchrect to source coords */
 #endif        
-        layerinfo->status[i] = msLayerWhichShapes(srclayer, srcRect);
+        layerinfo->status[i] = msLayerWhichShapes(srclayer, srcRect, isQuery);
         if (layerinfo->status[i] == MS_FAILURE)
             return MS_FAILURE;
     }

Modified: branches/branch-6-0/mapserver/mapwfslayer.c
===================================================================
--- branches/branch-6-0/mapserver/mapwfslayer.c	2011-07-07 19:51:37 UTC (rev 11880)
+++ branches/branch-6-0/mapserver/mapwfslayer.c	2011-07-07 19:55:43 UTC (rev 11881)
@@ -772,7 +772,7 @@
         {
             if (lp->layerinfo == NULL)
             {
-                if (msWFSLayerWhichShapes(lp, psInfo->rect) == MS_FAILURE)
+	      if (msWFSLayerWhichShapes(lp, psInfo->rect, MS_FALSE) == MS_FAILURE) /* no access to context (draw vs. query) here, although I doubt it matters... */
                   return MS_FAILURE;
             }
             return MS_SUCCESS;  /* Nothing to do... layer is already opened */
@@ -826,7 +826,7 @@
         msProjectRect(&lp->map->projection, &lp->projection, &psInfo->rect); /* project the searchrect to source coords */
 #endif
 
-    if (msWFSLayerWhichShapes(lp, psInfo->rect) == MS_FAILURE)
+    if (msWFSLayerWhichShapes(lp, psInfo->rect, MS_FALSE) == MS_FAILURE)  /* no access to context (draw vs. query) here, although I doubt it matters... */
         status = MS_FAILURE;
     
 
@@ -1050,7 +1050,7 @@
  *
  **********************************************************************/
 
-int msWFSLayerWhichShapes(layerObj *lp, rectObj rect)
+int msWFSLayerWhichShapes(layerObj *lp, rectObj rect, int isQuery)
 {
 #ifdef USE_WFS_LYR
     msWFSLayerInfo *psInfo;
@@ -1210,7 +1210,7 @@
     if ((status = msOGRLayerOpen(lp, psInfo->pszGMLFilename)) != MS_SUCCESS)
         return status;
     
-    status = msOGRLayerWhichShapes(lp, rect);
+    status = msOGRLayerWhichShapes(lp, rect, isQuery);
    
     /* Mark that the OGR Layer is valid */
     psInfo->bLayerHasValidGML = MS_TRUE;



More information about the mapserver-commits mailing list