Skip to content

Commit

Permalink
Handling MultiLineString geometry
Browse files Browse the repository at this point in the history
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
  • Loading branch information
Koyaani and nyalldawson committed Aug 23, 2021
1 parent 68ab811 commit 0ad4a7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -3606,7 +3606,7 @@ static QVariant fcnSinuosity( const QVariantList &values, const QgsExpressionCon
static QVariant fcnStraightDistance2d( const QVariantList &values, const QgsExpressionContext *, QgsExpression *parent, const QgsExpressionNodeFunction * )
{
const QgsGeometry geom = QgsExpressionUtils::getGeometry( values.at( 0 ), parent );
const QgsCurve *curve = qgsgeometry_cast< const QgsCurve * >( geom.constGet() );
const QgsCurve *curve = geom.constGet() ? qgsgeometry_cast< const QgsCurve * >( geom.constGet()->simplifiedTypeRef() ) : nullptr;
if ( !curve )
{
parent->setEvalErrorString( QObject::tr( "Function `straight_distance_2d` requires a line geometry." ) );
Expand Down

0 comments on commit 0ad4a7d

Please sign in to comment.