Skip to content

Commit

Permalink
Be a bit less aggresive at pruning small feature polygon label candid…
Browse files Browse the repository at this point in the history
…ates
  • Loading branch information
nyalldawson committed May 3, 2020
1 parent 9dec1dd commit 3054012
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/core/pal/feature.cpp
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/core/pal/pal.cpp
Expand Up @@ -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;
}

Expand Down

0 comments on commit 3054012

Please sign in to comment.