Skip to content
Permalink
Browse files

Be a bit less aggresive at pruning small feature polygon label candid…

…ates
  • Loading branch information
nyalldawson committed Apr 30, 2020
1 parent 9dec1dd commit 30540120c9196de1d1e2dba7d29e2b4cf5a80b60
Showing with 2 additions and 2 deletions.
  1. +1 −1 src/core/pal/feature.cpp
  2. +1 −1 src/core/pal/pal.cpp
@@ -1875,7 +1875,7 @@ std::size_t FeaturePart::createCandidatesOutsidePolygon( std::vector<std::unique
const double ringLength = ring->length();
const double circleArea = std::pow( ringLength, 2 ) / ( 4 * M_PI );
const std::size_t candidatesForArea = static_cast< std::size_t>( std::ceil( mLF->layer()->mPal->maximumPolygonCandidatesPerMapUnitSquared() * circleArea ) );
const std::size_t targetPolygonCandidates = std::max( static_cast< std::size_t >( 4 ), maxPolygonCandidates > 0 ? std::min( maxPolygonCandidates, candidatesForArea ) : candidatesForArea );
const std::size_t targetPolygonCandidates = std::max( static_cast< std::size_t >( 16 ), maxPolygonCandidates > 0 ? std::min( maxPolygonCandidates, candidatesForArea ) : candidatesForArea );

// assume each position generates one candidate
const double delta = ringLength / targetPolygonCandidates;
@@ -312,7 +312,7 @@ std::unique_ptr<Problem> Pal::extract( const QgsRectangle &extent, const QgsGeom
break;

case GEOS_POLYGON:
maxCandidates = std::max( static_cast< std::size_t >( 4 ), feat->feature->maximumPolygonCandidates() );
maxCandidates = std::max( static_cast< std::size_t >( 16 ), feat->feature->maximumPolygonCandidates() );
break;
}

0 comments on commit 3054012

Please sign in to comment.
You can’t perform that action at this time.