[QGIS Commit] r14457 - trunk/qgis/src/plugins/offline_editing

svn_qgis at osgeo.org svn_qgis at osgeo.org
Sat Oct 30 10:55:18 EDT 2010


Author: mhugent
Date: 2010-10-30 07:55:18 -0700 (Sat, 30 Oct 2010)
New Revision: 14457

Modified:
   trunk/qgis/src/plugins/offline_editing/offline_editing.cpp
Log:
Patch from Mathias Walker: improvement of geometry detection in offline plugin

Modified: trunk/qgis/src/plugins/offline_editing/offline_editing.cpp
===================================================================
--- trunk/qgis/src/plugins/offline_editing/offline_editing.cpp	2010-10-30 14:32:45 UTC (rev 14456)
+++ trunk/qgis/src/plugins/offline_editing/offline_editing.cpp	2010-10-30 14:55:18 UTC (rev 14457)
@@ -370,19 +370,28 @@
 
   // add geometry column
   QString geomType = "";
-  switch ( layer->geometryType() )
+  switch ( layer->wkbType() )
   {
-    case QGis::Point:
+    case QGis::WKBPoint:
       geomType = "POINT";
       break;
-    case QGis::Line:
+    case QGis::WKBMultiPoint:
+      geomType = "MULTIPOINT";
+      break;
+    case QGis::WKBLineString:
       geomType = "LINESTRING";
       break;
-    case QGis::Polygon:
+    case QGis::WKBMultiLineString:
+      geomType = "MULTILINESTRING";
+      break;
+    case QGis::WKBPolygon:
       geomType = "POLYGON";
       break;
+    case QGis::WKBMultiPolygon:
+      geomType = "MULTIPOLYGON";
+      break;
     default:
-      showWarning( tr( "Unknown QGIS geometry type %1" ).arg( layer->geometryType() ) );
+      showWarning( tr( "QGIS wkbType %1 not supported" ).arg( layer->wkbType() ) );
       break;
   };
   QString sqlAddGeom = QString( "SELECT AddGeometryColumn('%1', 'Geometry', %2, '%3', 2)" )



More information about the QGIS-commit mailing list