[mapserver-commits] r9766 - trunk/mapserver

svn at osgeo.org svn at osgeo.org
Fri Jan 29 13:31:30 EST 2010


Author: assefa
Date: 2010-01-29 13:31:29 -0500 (Fri, 29 Jan 2010)
New Revision: 9766

Modified:
   trunk/mapserver/mapwfs.c
Log:
Correct issues with maxfeatures and startindex #2799

Modified: trunk/mapserver/mapwfs.c
===================================================================
--- trunk/mapserver/mapwfs.c	2010-01-28 15:32:10 UTC (rev 9765)
+++ trunk/mapserver/mapwfs.c	2010-01-29 18:31:29 UTC (rev 9766)
@@ -1870,10 +1870,8 @@
         }
       }
 
-     if(maxfeatures > 0 && maxfeatures < iNumberOfFeatures) {
-         iNumberOfFeatures = maxfeatures;
-     }
 
+
       if(paramsObj->pszVersion && strncmp(paramsObj->pszVersion,"1.1",3) == 0 )
         msIO_printf("   xsi:schemaLocation=\"%s %sSERVICE=WFS&amp;VERSION=%s&amp;REQUEST=DescribeFeatureType&amp;TYPENAME=%s&amp;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);
@@ -1886,27 +1884,24 @@
     msFree(encoded_schema);
     msFree(encoded_typename);
 
-    /*some validations on startindex, it should not be > that the total elements
-     TODO: should we send an exception?*/
-    if (startindex >0 && startindex >=iNumberOfFeatures)
-    {   
-        msIO_printf("   <gml:boundedBy>\n"); 
-        msIO_printf("      <gml:null>missing</gml:null>\n");
-        msIO_printf("   </gml:boundedBy>\n"); 
-    }
-    else
-    {
-        /* handle case of maxfeatures = 0 */
-        /*internally use a start index that start with with 0 as the first index*/
-        if(maxfeatures != 0 && iResultTypeHits == 0)
-          msGMLWriteWFSQuery(map, stdout, startindex-1, maxfeatures, pszNameSpace, outputformat);
+     
+    if(maxfeatures > 0 && maxfeatures < iNumberOfFeatures)
+      iNumberOfFeatures = maxfeatures;
+    
 
-        if (((iNumberOfFeatures==0) || (maxfeatures == 0)) && iResultTypeHits == 0) {
-          msIO_printf("   <gml:boundedBy>\n"); 
-          msIO_printf("      <gml:null>missing</gml:null>\n");
-          msIO_printf("   </gml:boundedBy>\n"); 
-        }
+    
+    
+    /* handle case of maxfeatures = 0 */
+    /*internally use a start index that start with with 0 as the first index*/
+    if(maxfeatures != 0 && iResultTypeHits == 0)
+      msGMLWriteWFSQuery(map, stdout, startindex-1, maxfeatures, pszNameSpace, outputformat);
+    
+    if (((iNumberOfFeatures==0) || (maxfeatures == 0)) && iResultTypeHits == 0) {
+      msIO_printf("   <gml:boundedBy>\n"); 
+      msIO_printf("      <gml:null>missing</gml:null>\n");
+      msIO_printf("   </gml:boundedBy>\n"); 
     }
+    
 
     if(outputformat == OWS_GML2)
       msIO_printf("</wfs:FeatureCollection>\n\n");



More information about the mapserver-commits mailing list