[mapguide-commits] r5399 - trunk/MgDev/Web/src/HttpHandler
svn_mapguide at osgeo.org
svn_mapguide at osgeo.org
Tue Nov 23 05:06:48 EST 2010
Author: liuar
Date: 2010-11-23 02:06:48 -0800 (Tue, 23 Nov 2010)
New Revision: 5399
Modified:
trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp
trunk/MgDev/Web/src/HttpHandler/WfsFeatures.cpp
Log:
Ticket #1533 Feature count returned less than values of MaxFeatures
Two factors could result in this issue:
1.
Because the MgServerFdoFeatureReader in MapGudie server uses -1 to mark empty, while MgWfsFeatures in MapGuide web tier uses 0, so there will be 1 more feature returned from MapGuide Server. So I updated the maxFeatures value from numFeaturesToRetrieve to numFeaturesToRetrieve-1
Ptr<MgByteReader> resultReader = featureService->GetWfsFeature(featureSourceId, ((sSchemaHash.size()==0) ? sClass : sSchemaHash + _(":") + sClass), requiredProperties, m_getFeatureParams->GetSrs(), filter, numFeaturesToRetrieve-1, sVersion, sOutputFormat, sSortCriteria, sPrefix, oFeatureTypes.GetNamespaceUrl());
2.
Read schema namespaces will cause m_iMaxFeatures-- which will cause the last feature lost from the response gml document, so I add m_iMaxFeatures's value while reading schema namespaces.
Modified: trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp 2010-11-23 06:48:43 UTC (rev 5398)
+++ trunk/MgDev/Web/src/HttpHandler/HttpWfsGetFeature.cpp 2010-11-23 10:06:48 UTC (rev 5399)
@@ -270,8 +270,11 @@
}
// Call the C++ API
+ // NOTE: I updated the maxFeatures value from numFeaturesToRetrieve to numFeaturesToRetrieve-1
+ // Because the MgServerFdoFeatureReader in MapGudie server uses -1 to mark empty, while MgWfsFeatures
+ // in MapGuide web tier uses 0
Ptr<MgByteReader> resultReader = featureService->GetWfsFeature(featureSourceId, ((sSchemaHash.size()==0) ? sClass : sSchemaHash + _(":") + sClass),
- requiredProperties, m_getFeatureParams->GetSrs(), filter, numFeaturesToRetrieve, sVersion, sOutputFormat, sSortCriteria, sPrefix, oFeatureTypes.GetNamespaceUrl());
+ requiredProperties, m_getFeatureParams->GetSrs(), filter, numFeaturesToRetrieve-1, sVersion, sOutputFormat, sSortCriteria, sPrefix, oFeatureTypes.GetNamespaceUrl());
// TODO How to determine number of features retrieved...?
// Note: for now, maxFeatures is managed by the MgWfsFeatures object. - TMT 2006-3-20
Modified: trunk/MgDev/Web/src/HttpHandler/WfsFeatures.cpp
===================================================================
--- trunk/MgDev/Web/src/HttpHandler/WfsFeatures.cpp 2010-11-23 06:48:43 UTC (rev 5398)
+++ trunk/MgDev/Web/src/HttpHandler/WfsFeatures.cpp 2010-11-23 10:06:48 UTC (rev 5399)
@@ -85,6 +85,9 @@
else if(m_Namespaces.QualifiedName(Begin) == gszElementNameFeatureCollection){
MgXmlAttribute& attributes = Begin.Attributes();
m_sFeatureCollectionNamespaces = attributes.Contents();
+
+ m_iMaxFeatures++; // Read schema namespaces should not count the feature
+
m_XmlInput.Next();
return m_bOk;
}
More information about the mapguide-commits
mailing list