Skip to content

Commit

Permalink
Fix build with geos < 3.9 and reduce tolerance
Browse files Browse the repository at this point in the history
  • Loading branch information
elpaso authored and nyalldawson committed Nov 29, 2021
1 parent 5aa7037 commit 202bef9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -6623,7 +6623,7 @@ static QVariant executeGeomOverlay( const QVariantList &values, const QgsExpress
node = QgsExpressionUtils::getNode( values.at( 6 ), parent ); //in expressions overlay functions throw the exception: Eval Error: Cannot convert '' to int
minInscribedCircleRadius = QgsExpressionUtils::getDoubleValue( values.at( 6 ), parent );
#if GEOS_VERSION_MAJOR==3 && GEOS_VERSION_MINOR<9
if ( minInscribedCircleRadiusValue != -1 )
if ( minInscribedCircleRadius != -1 )
{
parent->setEvalErrorString( QObject::tr( "'min_inscribed_circle_radius' is only available when QGIS is built with GEOS >= 3.9." ) );
return QVariant();
Expand Down Expand Up @@ -6787,7 +6787,7 @@ static QVariant executeGeomOverlay( const QVariantList &values, const QgsExpress
const double width = bbox.width();
const double height = bbox.height();
const double size = width > height ? width : height;
const double tolerance = size / 1000.0;
const double tolerance = size / 100.0;
testResult = QgsGeos( geom ).maximumInscribedCircle( tolerance )->length() >= minInscribedCircleRadius;
}
}
Expand Down

0 comments on commit 202bef9

Please sign in to comment.