mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-01 00:46:20 -05:00
Check if a point is 3D before returning its z value. Fixes #37772
This commit is contained in:
parent
8d2a0d1ebb
commit
d1d156973b
@ -2349,6 +2349,9 @@ static QVariant fcnGeomZ( const QVariantList &values, const QgsExpressionContext
|
||||
if ( geom.isNull() )
|
||||
return QVariant(); //or 0?
|
||||
|
||||
if ( !geom.constGet()->is3D() )
|
||||
return QVariant();
|
||||
|
||||
//if single point, return the point's z coordinate
|
||||
if ( geom.type() == QgsWkbTypes::PointGeometry && !geom.isMultipart() )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user