[mapserver-commits] r9110 - in trunk: mapserver msautotest/wxs msautotest/wxs/expected

svn at osgeo.org svn at osgeo.org
Thu Jun 18 12:39:51 EDT 2009


Author: tomkralidis
Date: 2009-06-18 12:39:51 -0400 (Thu, 18 Jun 2009)
New Revision: 9110

Added:
   trunk/msautotest/wxs/expected/wfs11_get_feature_maxfeatures.xml
Modified:
   trunk/mapserver/HISTORY.TXT
   trunk/mapserver/mapwfs.c
   trunk/mapserver/mapwfs11.c
   trunk/msautotest/wxs/wfs_simple.map
Log:
- make WFS numberOfFeatures match maxFeatures if passed (#2907)


Modified: trunk/mapserver/HISTORY.TXT
===================================================================
--- trunk/mapserver/HISTORY.TXT	2009-06-17 19:23:32 UTC (rev 9109)
+++ trunk/mapserver/HISTORY.TXT	2009-06-18 16:39:51 UTC (rev 9110)
@@ -14,6 +14,8 @@
 Current Version (SVN trunk):
 ----------------------------
 
+- make WFS numberOfFeatures match maxFeatures if passed (#2907)
+
 - Add logging in layer visibility tests to help users find why layers don't draw (#3054)
 
 - include PNG libs first (#3046)

Modified: trunk/mapserver/mapwfs.c
===================================================================
--- trunk/mapserver/mapwfs.c	2009-06-17 19:23:32 UTC (rev 9109)
+++ trunk/mapserver/mapwfs.c	2009-06-18 16:39:51 UTC (rev 9110)
@@ -1639,6 +1639,10 @@
         }
       }
 
+     if(maxfeatures > 0) {
+         iNumberOfFeatures = maxfeatures;
+     }
+
       if(paramsObj->pszVersion && strncmp(paramsObj->pszVersion,"1.1",3) == 0 )
         msIO_printf("   xsi:schemaLocation=\"%s %sSERVICE=WFS&VERSION=%s&REQUEST=DescribeFeatureType&TYPENAME=%s&OUTPUTFORMAT=%s  http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd\" numberOfFeatures=\"%d\">\n",
 		  user_namespace_uri_encoded, script_url_encoded, encoded, encoded_typename, output_schema_format, iNumberOfFeatures);

Modified: trunk/mapserver/mapwfs11.c
===================================================================
--- trunk/mapserver/mapwfs11.c	2009-06-17 19:23:32 UTC (rev 9109)
+++ trunk/mapserver/mapwfs11.c	2009-06-18 16:39:51 UTC (rev 9110)
@@ -207,6 +207,7 @@
     char *xsi_schemaLocation = NULL;
 
     char *script_url=NULL, *script_url_encoded=NULL;
+    const char *value = NULL;
 
     xmlChar *buffer = NULL;
     int size = 0, i;
@@ -329,7 +330,7 @@
                                                                   "XMLSCHEMA,text/xml; subtype=gml/2.1.2,text/xml; subtype=gml/3.1.1"));
 
 /* -------------------------------------------------------------------- */
-/*      GetFeatureType                                                  */
+/*      GetFeature                                                      */
 /* -------------------------------------------------------------------- */
       psNode = xmlAddChild(psMainNode, 
                           msOWSCommonOperationsMetadataOperation(psNsOws,psNsXLink,"GetFeature", 
@@ -349,6 +350,14 @@
                                                                   "Parameter", "outputFormat", 
                                                                   "text/xml; subtype=gml/3.1.1"));
 
+     value = msOWSLookupMetadata(&(map->web.metadata), "FO", "maxfeatures");
+
+    if (value) {
+         xmlAddChild(psMainNode, msOWSCommonOperationsMetadataDomainType(ows_version, psNsOws,
+                                                                  "Constraint", "DefaultMaxFeatures",
+                                                                  (char *)value));
+    }
+
 /* -------------------------------------------------------------------- */
 /*      FeatureTypeList                                                 */
 /* -------------------------------------------------------------------- */

Added: trunk/msautotest/wxs/expected/wfs11_get_feature_maxfeatures.xml
===================================================================
--- trunk/msautotest/wxs/expected/wfs11_get_feature_maxfeatures.xml	                        (rev 0)
+++ trunk/msautotest/wxs/expected/wfs11_get_feature_maxfeatures.xml	2009-06-18 16:39:51 UTC (rev 9110)
@@ -0,0 +1,56 @@
+Content-type: text/xml
+
+<?xml version='1.0' encoding="ISO-8859-1" ?>
+<wfs:FeatureCollection
+   xmlns:ms="http://mapserver.gis.umn.edu/mapserver"
+   xmlns:gml="http://www.opengis.net/gml"
+   xmlns:wfs="http://www.opengis.net/wfs"
+   xmlns:ogc="http://www.opengis.net/ogc"
+   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+   xsi:schemaLocation="http://mapserver.gis.umn.edu/mapserver http://localhost/path/to/wfs_simple?SERVICE=WFS&amp;VERSION=1.1.0&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=province&amp;OUTPUTFORMAT=text/xml; subtype=gml/3.1.1  http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.1.0/wfs.xsd" numberOfFeatures="2">
+      <gml:boundedBy>
+      	<gml:Envelope srsName="EPSG:4326">
+      		<gml:lowerCorner>-66.432672 43.412311</gml:lowerCorner>
+      		<gml:upperCorner>-59.709694 47.796447</gml:upperCorner>
+      	</gml:Envelope>
+      </gml:boundedBy>
+    <gml:featureMember>
+      <ms:province gml:id="province.Quebec">
+        <gml:boundedBy>
+        	<gml:Envelope srsName="EPSG:4326">
+        		<gml:lowerCorner>-61.510511 47.767892</gml:lowerCorner>
+        		<gml:upperCorner>-61.457648 47.796447</gml:upperCorner>
+        	</gml:Envelope>
+        </gml:boundedBy>
+        <ms:msGeometry>
+          <gml:Polygon srsName="EPSG:4326">
+            <gml:exterior>
+              <gml:LinearRing>
+                <gml:posList srsDimension="2">-61.510511 47.774240 -61.508947 47.788606 -61.492725 47.796447 -61.457648 47.787438 -61.459987 47.767892 -61.483502 47.769615 -61.510511 47.774240 </gml:posList>
+              </gml:LinearRing>
+            </gml:exterior>
+          </gml:Polygon>
+        </ms:msGeometry>
+      </ms:province>
+    </gml:featureMember>
+    <gml:featureMember>
+      <ms:province gml:id="province.Nova Scotia">
+        <gml:boundedBy>
+        	<gml:Envelope srsName="EPSG:4326">
+        		<gml:lowerCorner>-60.211728 47.166385</gml:lowerCorner>
+        		<gml:upperCorner>-60.168776 47.192716</gml:upperCorner>
+        	</gml:Envelope>
+        </gml:boundedBy>
+        <ms:msGeometry>
+          <gml:Polygon srsName="EPSG:4326">
+            <gml:exterior>
+              <gml:LinearRing>
+                <gml:posList srsDimension="2">-60.204850 47.166385 -60.211728 47.179857 -60.194354 47.192716 -60.173448 47.187638 -60.168776 47.174965 -60.204850 47.166385 </gml:posList>
+              </gml:LinearRing>
+            </gml:exterior>
+          </gml:Polygon>
+        </ms:msGeometry>
+      </ms:province>
+    </gml:featureMember>
+</wfs:FeatureCollection>
+

Modified: trunk/msautotest/wxs/wfs_simple.map
===================================================================
--- trunk/msautotest/wxs/wfs_simple.map	2009-06-17 19:23:32 UTC (rev 9109)
+++ trunk/msautotest/wxs/wfs_simple.map	2009-06-18 16:39:51 UTC (rev 9110)
@@ -59,6 +59,10 @@
 #
 # RUN_PARMS: wfs11_get_feature_hits.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=province&resulttype=hits" > [RESULT]
 #
+# GetFeature maxfeatures=2
+#
+# RUN_PARMS: wfs11_get_feature_maxfeatures.xml [MAPSERV] QUERY_STRING="map=[MAPFILE]&SERVICE=WFS&VERSION=1.1.0&REQUEST=GetFeature&TYPENAME=province&maxfeatures=2" > [RESULT]
+
 MAP
 
 NAME WFS_TEST



More information about the mapserver-commits mailing list