[QGIS Commit] r14539 - trunk/qgis/src/providers/wfs

svn_qgis at osgeo.org svn_qgis at osgeo.org
Tue Nov 9 02:47:55 EST 2010


Author: mhugent
Date: 2010-11-08 23:47:55 -0800 (Mon, 08 Nov 2010)
New Revision: 14539

Modified:
   trunk/qgis/src/providers/wfs/qgswfsdata.cpp
Log:
Improve geometry type detection for wfs

Modified: trunk/qgis/src/providers/wfs/qgswfsdata.cpp
===================================================================
--- trunk/qgis/src/providers/wfs/qgswfsdata.cpp	2010-11-09 07:29:00 UTC (rev 14538)
+++ trunk/qgis/src/providers/wfs/qgswfsdata.cpp	2010-11-09 07:47:55 UTC (rev 14539)
@@ -351,7 +351,11 @@
       {
         //error
       }
-      *mWkbType = QGis::WKBPoint;
+
+      if ( *mWkbType != QGis::WKBMultiPoint ) //keep multitype in case of geometry type mix
+      {
+        *mWkbType = QGis::WKBPoint;
+      }
     }
     else //multipoint, add WKB as fragment
     {
@@ -386,7 +390,11 @@
       {
         //error
       }
-      *mWkbType = QGis::WKBLineString;
+
+      if ( *mWkbType != QGis::WKBMultiLineString )//keep multitype in case of geometry type mix
+      {
+        *mWkbType = QGis::WKBLineString;
+      }
     }
     else //multiline, add WKB as fragment
     {
@@ -424,7 +432,10 @@
   }
   else if ( elementName == GML_NAMESPACE + NS_SEPARATOR + "Polygon" )
   {
-    *mWkbType = QGis::WKBPolygon;
+    if ( *mWkbType != QGis::WKBMultiPolygon )//keep multitype in case of geometry type mix
+    {
+      *mWkbType = QGis::WKBPolygon;
+    }
     if ( mParseModeStack.top() != QgsWFSData::multiPolygon )
     {
       createPolygonFromFragments();
@@ -432,6 +443,7 @@
   }
   else if ( elementName == GML_NAMESPACE + NS_SEPARATOR + "MultiPoint" )
   {
+    *mWkbType = QGis::WKBMultiPoint;
     if ( !mParseModeStack.empty() )
     {
       mParseModeStack.pop();
@@ -440,6 +452,7 @@
   }
   else if ( elementName == GML_NAMESPACE + NS_SEPARATOR + "MultiLineString" )
   {
+    *mWkbType = QGis::WKBMultiLineString;
     if ( !mParseModeStack.empty() )
     {
       mParseModeStack.pop();
@@ -448,6 +461,7 @@
   }
   else if ( elementName == GML_NAMESPACE + NS_SEPARATOR + "MultiPolygon" )
   {
+    *mWkbType = QGis::WKBMultiPolygon;
     if ( !mParseModeStack.empty() )
     {
       mParseModeStack.pop();



More information about the QGIS-commit mailing list