Skip to content
Permalink
Browse files

Until we have support for TIN types, the multi type of Triangle

geometries should be multipolygon

Refs #36638
  • Loading branch information
nyalldawson committed Jun 10, 2020
1 parent e0c03f9 commit d81f498a991e38f360ab051d8d3c0a5500915cf7
Showing with 15 additions and 1 deletion.
  1. +10 −1 src/core/geometry/qgswkbtypes.h
  2. +5 −0 tests/src/python/test_qgsgeometry.py
@@ -303,11 +303,20 @@ class CORE_EXPORT QgsWkbTypes
switch ( type )
{
case Unknown:
return Unknown;

// until we support TIN types, use multipolygon
case Triangle:
return MultiPolygon;

case TriangleZ:
return MultiPolygonZ;

case TriangleM:
return MultiPolygonM;

case TriangleZM:
return Unknown;
return MultiPolygonZM;

case GeometryCollection:
return GeometryCollection;
@@ -2911,6 +2911,11 @@ def testWkbTypes(self):
self.assertEqual(QgsWkbTypes.multiType(QgsWkbTypes.MultiPoint25D), QgsWkbTypes.MultiPoint25D)
self.assertEqual(QgsWkbTypes.multiType(QgsWkbTypes.MultiLineString25D), QgsWkbTypes.MultiLineString25D)
self.assertEqual(QgsWkbTypes.multiType(QgsWkbTypes.MultiPolygon25D), QgsWkbTypes.MultiPolygon25D)
# until we have tin types, these should return multipolygons
self.assertEqual(QgsWkbTypes.multiType(QgsWkbTypes.Triangle), QgsWkbTypes.MultiPolygon)
self.assertEqual(QgsWkbTypes.multiType(QgsWkbTypes.TriangleZ), QgsWkbTypes.MultiPolygonZ)
self.assertEqual(QgsWkbTypes.multiType(QgsWkbTypes.TriangleM), QgsWkbTypes.MultiPolygonM)
self.assertEqual(QgsWkbTypes.multiType(QgsWkbTypes.TriangleZM), QgsWkbTypes.MultiPolygonZM)

# test curveType method
self.assertEqual(QgsWkbTypes.curveType(QgsWkbTypes.Unknown), QgsWkbTypes.Unknown)

0 comments on commit d81f498

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