Skip to content

Commit

Permalink
[OGR provider] Make ogrWkbGeometryTypeName() correctly display M/ZM g…
Browse files Browse the repository at this point in the history
…eometry names, as potentially returned by GDAL 2.1
  • Loading branch information
rouault committed Jun 18, 2016
1 parent 22dfd76 commit 6bc0313
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/providers/ogr/qgsogrprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +479,20 @@ QString QgsOgrProvider::subsetString()
QString QgsOgrProvider::ogrWkbGeometryTypeName( OGRwkbGeometryType type ) const
{
QString geom;

// GDAL 2.1 can return M/ZM geometries
#if defined(GDAL_COMPUTE_VERSION) && GDAL_VERSION_NUM >= GDAL_COMPUTE_VERSION(2,1,0)
if ( wkbHasM( type ) )
{
geom = ogrWkbGeometryTypeName( wkbFlatten( type ) );
if ( wkbHasZ( type ) )
geom += "Z";
if ( wkbHasM( type ) )
geom += "M";
return geom;
}
#endif

switch (( long )type )
{
case wkbUnknown:
Expand Down

0 comments on commit 6bc0313

Please sign in to comment.