Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Nyall Dawson <nyall.dawson@gmail.com>
  • Loading branch information
elpaso and nyalldawson committed Nov 29, 2021
1 parent 3283aa4 commit 74b594b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
7 changes: 2 additions & 5 deletions src/core/expression/qgsexpressionfunction.cpp
Expand Up @@ -6767,8 +6767,7 @@ static QVariant executeGeomOverlay( const QVariantList &values, const QgsExpress
bool testResult { false };
for ( auto it = intersection.const_parts_begin(); ! testResult && it != intersection.const_parts_end(); ++it )
{
const QgsPolygon *geom = qgsgeometry_cast< const QgsPolygon * >( *it );
// qDebug() << "Area" << feat2.id() << geom->area();
const QgsCurvePolygon *geom = qgsgeometry_cast< const QgsCurvePolygon * >( *it );
if ( minOverlap != -1 )
{
if ( geom->area() >= minOverlap )
Expand All @@ -6789,7 +6788,6 @@ static QVariant executeGeomOverlay( const QVariantList &values, const QgsExpress
const double height = bbox.height();
const double size = width > height ? width : height;
const double tolerance = size / 1000.0;
//qDebug() << "Inscribed circle radius" << feat2.id() << QgsGeos( geom ).maximumInscribedCircle( tolerance )->length();
testResult = QgsGeos( geom ).maximumInscribedCircle( tolerance )->length() >= minInscribedCircleRadius;
}
}
Expand Down Expand Up @@ -6833,8 +6831,7 @@ static QVariant executeGeomOverlay( const QVariantList &values, const QgsExpress
bool testResult { false };
for ( auto it = intersection.const_parts_begin(); ! testResult && it != intersection.const_parts_end(); ++it )
{
const QgsLineString *geom = qgsgeometry_cast< const QgsLineString * >( *it );
// qDebug() << "Length" << feat2.id() << geom->length();
const QgsCurve *geom = qgsgeometry_cast< const QgsCurve * >( *it );
if ( minOverlap != -1 )
{
if ( geom->length() >= minOverlap )
Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/qgsgeos.h
Expand Up @@ -297,7 +297,7 @@ class CORE_EXPORT QgsGeos: public QgsGeometryEngine
QString *errorMsg = nullptr ) const;

/**
* Returns the maximum inscribed circle radius.
* Returns the maximum inscribed circle.
*
* Constructs the Maximum Inscribed Circle for a polygonal geometry, up to a specified tolerance.
* The Maximum Inscribed Circle is determined by a point in the interior of the area
Expand Down

0 comments on commit 74b594b

Please sign in to comment.