Skip to content

Commit

Permalink
Patch from Mathias Walker: improvement of geometry detection in offli…
Browse files Browse the repository at this point in the history
…ne plugin

git-svn-id: http://svn.osgeo.org/qgis/trunk@14457 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
mhugent committed Oct 30, 2010
1 parent 6104410 commit da26890
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions src/plugins/offline_editing/offline_editing.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)" )
Expand Down

0 comments on commit da26890

Please sign in to comment.