[mapserver-commits] r7674 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri Jun 13 12:58:20 EDT 2008


Author: tomkralidis
Date: 2008-06-13 12:58:20 -0400 (Fri, 13 Jun 2008)
New Revision: 7674

Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapwfs.c
Log:
- mapwfs.c: set layer extent to map extent for default
  GetFeature requests with no spatial predicates (#1287)



Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2008-06-13 00:56:47 UTC (rev 7673)
+++ trunk/mapserver/HISTORY.TXT	2008-06-13 16:58:20 UTC (rev 7674)
@@ -13,6 +13,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- mapwfs.c: set layer extent to map extent for default
+  GetFeature requests with no spatial predicates (#1287)
 
 Version 5.2.0-beta1 (2008-06-11):
 ---------------------------------

Modified: trunk/mapserver/mapwfs.c
===================================================================
--- trunk/mapserver/mapwfs.c	2008-06-13 00:56:47 UTC (rev 7673)
+++ trunk/mapserver/mapwfs.c	2008-06-13 16:58:20 UTC (rev 7674)
@@ -1080,7 +1080,8 @@
 	
 	if (msWFSIsLayerSupported(lp) && lp->name && strcasecmp(lp->name, layers[k]) == 0) {
 	  const char *pszThisLayerSRS;
-	  
+          char szBuf[32];
+          rectObj ext;
 	  bLayerFound = MS_TRUE;
 	  
 	  lp->status = MS_ON;
@@ -1113,8 +1114,29 @@
 		       "msWFSGetFeature()");
 	    return msWFSException(map, "typename", "InvalidParameterValue", paramsObj->pszVersion);
 	  }
-	}
-	
+
+          /* set the map extent to the layer extent */
+
+          /* get the extent of the layer (bbox will get further filtered later */
+          /* if the client specifies BBOX or a spatial filter */
+
+          if (msOWSGetLayerExtent(map, lp, "FO", &ext) == MS_SUCCESS) {
+            sprintf(szBuf, "init=epsg:%.10s", pszMapSRS+5);
+
+            if (szBuf != NULL) {
+              if (msLoadProjectionString(&(map->projection), szBuf) != 0) {
+                 msSetError(MS_WFSERR, "msLoadProjectionString() failed2: %s", "msWFSGetFeature()", szBuf);
+                 return msWFSException(map, "mapserv", "NoApplicableCode", paramsObj->pszVersion);
+              }
+            }
+
+            if (msProjectionsDiffer(&map->projection, &lp->projection) == MS_TRUE) {
+               msProjectRect(&lp->projection, &map->projection, &(ext));
+            }
+
+            bbox = map->extent = ext;
+          }
+        }
       }
 
       if (!bLayerFound) {



More information about the mapserver-commits mailing list