Skip to content

Commit

Permalink
Fix some GEOS noise when trying to register a line string with only
Browse files Browse the repository at this point in the history
one vertex as a feature in the labeling engine

We no longer try to register these features as obstacles for labels -
it's not possible to handle these and they just result in noisy
geos warnings on the console.
  • Loading branch information
nyalldawson committed Nov 18, 2020
1 parent 1c076ee commit 2677d55
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/core/labeling/qgspallabeling.cpp
Expand Up @@ -2657,6 +2657,13 @@ void QgsPalLayerSettings::registerObstacleFeature( const QgsFeature &f, QgsRende
return;
}

// don't even try to register linestrings with only one vertex as an obstacle
if ( const QgsLineString *ls = qgsgeometry_cast< const QgsLineString * >( geom.constGet() ) )
{
if ( ls->numPoints() < 2 )
return;
}

// simplify?
const QgsVectorSimplifyMethod &simplifyMethod = context.vectorSimplifyMethod();
std::unique_ptr<QgsGeometry> scopedClonedGeom;
Expand Down

0 comments on commit 2677d55

Please sign in to comment.