Skip to content
Permalink
Browse files

Fix incorrect layer type icons for some geopackage layers (e.g. curve…

… types)
  • Loading branch information
nyalldawson committed Feb 9, 2018
1 parent 8f902e7 commit 2ee0bc87ca5c766d33c2d5db0b89a7c0068e4c06
Showing with 15 additions and 0 deletions.
  1. +15 −0 src/providers/ogr/qgsogrdataitems.cpp
@@ -139,6 +139,21 @@ QgsLayerItem::LayerType QgsOgrLayerItem::layerTypeFromDb( const QString &geometr
{
return QgsLayerItem::LayerType::Raster;
}

// fallback - try parsing as a WKT type string
switch ( QgsWkbTypes::geometryType( QgsWkbTypes::parseType( geometryType ) ) )
{
case QgsWkbTypes::PointGeometry:
return QgsLayerItem::LayerType::Point;
case QgsWkbTypes::LineGeometry:
return QgsLayerItem::LayerType::Line;
case QgsWkbTypes::PolygonGeometry:
return QgsLayerItem::LayerType::Polygon;
case QgsWkbTypes::UnknownGeometry:
case QgsWkbTypes::NullGeometry:
break;
}

return QgsLayerItem::LayerType::TableLayer;
}

0 comments on commit 2ee0bc8

Please sign in to comment.
You can’t perform that action at this time.