Skip to content

Commit 6bc0313

Browse files
committed
[OGR provider] Make ogrWkbGeometryTypeName() correctly display M/ZM geometry names, as potentially returned by GDAL 2.1
1 parent 22dfd76 commit 6bc0313

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/providers/ogr/qgsogrprovider.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,20 @@ QString QgsOgrProvider::subsetString()
479479
QString QgsOgrProvider::ogrWkbGeometryTypeName( OGRwkbGeometryType type ) const
480480
{
481481
QString geom;
482+
483+
// GDAL 2.1 can return M/ZM geometries
484+
#if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,1,0)
485+
if ( wkbHasM( type ) )
486+
{
487+
geom = ogrWkbGeometryTypeName( wkbFlatten( type ) );
488+
if ( wkbHasZ( type ) )
489+
geom += "Z";
490+
if ( wkbHasM( type ) )
491+
geom += "M";
492+
return geom;
493+
}
494+
#endif
495+
482496
switch (( long )type )
483497
{
484498
case wkbUnknown:

0 commit comments

Comments
 (0)