Skip to content

Commit

Permalink
ConcaveHull - Expression: Adds an ifdef GEOS 3.11
Browse files Browse the repository at this point in the history
Fixes #50723
  • Loading branch information
lbartoletti authored and github-actions[bot] committed Nov 5, 2022
1 parent f4890c2 commit 1c69ca2
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -2612,8 +2612,7 @@ static QVariant fcnGeomMakeValid( const QVariantList &values, const QgsExpressio
}
catch ( QgsNotSupportedException & )
{
parent->setEvalErrorString( QObject::tr( "The make_valid parameters require a newer GEOS library version" ) );
return QVariant();
parent->setEvalErrorString( QObject::tr( "The make_valid parameters require a newer GEOS library version" ) ); return QVariant();
}

return QVariant::fromValue( valid );
Expand Down Expand Up @@ -4596,6 +4595,7 @@ static QVariant fcnConvexHull( const QVariantList &values, const QgsExpressionCo
return result;
}

#if GEOS_VERSION_MAJOR>3 || ( GEOS_VERSION_MAJOR == 3 && GEOS_VERSION_MINOR>=11 )
static QVariant fcnConcaveHull( const QVariantList &values, const QgsExpressionContext *, QgsExpression *parent, const QgsExpressionNodeFunction * )
{
try
Expand All @@ -4613,7 +4613,7 @@ static QVariant fcnConcaveHull( const QVariantList &values, const QgsExpressionC
return QVariant();
}
}

#endif

static QVariant fcnMinimalCircle( const QVariantList &values, const QgsExpressionContext *, QgsExpression *parent, const QgsExpressionNodeFunction * )
{
Expand Down Expand Up @@ -8111,9 +8111,11 @@ const QList<QgsExpressionFunction *> &QgsExpression::Functions()
<< new QgsStaticExpressionFunction( QStringLiteral( "is_empty" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "geometry" ) ), fcnIsEmpty, QStringLiteral( "GeometryGroup" ) )
<< new QgsStaticExpressionFunction( QStringLiteral( "is_empty_or_null" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "geometry" ) ), fcnIsEmptyOrNull, QStringLiteral( "GeometryGroup" ), QString(), false, QSet<QString>(), false, QStringList(), true )
<< new QgsStaticExpressionFunction( QStringLiteral( "convex_hull" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "geometry" ) ), fcnConvexHull, QStringLiteral( "GeometryGroup" ), QString(), false, QSet<QString>(), false, QStringList() << QStringLiteral( "convexHull" ) )
#if GEOS_VERSION_MAJOR>3 || ( GEOS_VERSION_MAJOR == 3 && GEOS_VERSION_MINOR>=11 )
<< new QgsStaticExpressionFunction( QStringLiteral( "concave_hull" ), QgsExpressionFunction::ParameterList() << QgsExpressionFunction::Parameter( QStringLiteral( "geometry" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "target_percent" ) )
<< QgsExpressionFunction::Parameter( QStringLiteral( "allow_holes" ), true, false ), fcnConcaveHull, QStringLiteral( "GeometryGroup" ) )
#endif
<< new QgsStaticExpressionFunction( QStringLiteral( "oriented_bbox" ), QgsExpressionFunction::ParameterList()
<< QgsExpressionFunction::Parameter( QStringLiteral( "geometry" ) ),
fcnOrientedBBox, QStringLiteral( "GeometryGroup" ) )
Expand Down

0 comments on commit 1c69ca2

Please sign in to comment.