From da26890e998c9ddf0d5a00e995075a8ebac0d560 Mon Sep 17 00:00:00 2001 From: mhugent Date: Sat, 30 Oct 2010 14:55:18 +0000 Subject: [PATCH] Patch from Mathias Walker: improvement of geometry detection in offline plugin git-svn-id: http://svn.osgeo.org/qgis/trunk@14457 c8812cc2-4d05-0410-92ff-de0c093fc19c --- .../offline_editing/offline_editing.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/plugins/offline_editing/offline_editing.cpp b/src/plugins/offline_editing/offline_editing.cpp index 5f74f84cabc..d6d9f1525b4 100644 --- a/src/plugins/offline_editing/offline_editing.cpp +++ b/src/plugins/offline_editing/offline_editing.cpp @@ -370,19 +370,28 @@ void QgsOfflineEditing::copyVectorLayer( QgsVectorLayer* layer, sqlite3* db, con // 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)" )