Skip to content
Permalink
Browse files

Don't try to write empty rendered rings/geometries to GeoPDF outputs

Fixes issues caused when a feature is sent to the rendering engine,
but ends up being completely clipped away.
  • Loading branch information
nyalldawson committed Sep 21, 2020
1 parent ef99f00 commit 96753cfd1b9e986841158675bda365e585c48c27
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/core/symbology/qgssymbol.cpp
@@ -1221,7 +1221,7 @@ void QgsSymbol::renderFeature( const QgsFeature &feature, QgsRenderContext &cont
{
for ( const LineInfo &info : qgis::as_const( linesToRender ) )
{
if ( context.hasRenderedFeatureHandlers() )
if ( context.hasRenderedFeatureHandlers() && !info.renderLine.empty() )
{
renderedBoundsGeom = renderedBoundsGeom.isNull() ? QgsGeometry::fromQPolygonF( info.renderLine )
: QgsGeometry::collectGeometry( QVector< QgsGeometry>() << QgsGeometry::fromQPolygonF( info.renderLine ) << renderedBoundsGeom );
@@ -1240,7 +1240,7 @@ void QgsSymbol::renderFeature( const QgsFeature &feature, QgsRenderContext &cont
int i = 0;
for ( const PolygonInfo &info : qgis::as_const( polygonsToRender ) )
{
if ( context.hasRenderedFeatureHandlers() )
if ( context.hasRenderedFeatureHandlers() && !info.renderExterior.empty() )
{
renderedBoundsGeom = renderedBoundsGeom.isNull() ? QgsGeometry::fromQPolygonF( info.renderExterior )
: QgsGeometry::collectGeometry( QVector< QgsGeometry>() << QgsGeometry::fromQPolygonF( info.renderExterior ) << renderedBoundsGeom );
@@ -1265,7 +1265,7 @@ void QgsSymbol::renderFeature( const QgsFeature &feature, QgsRenderContext &cont
break;
}

if ( context.hasRenderedFeatureHandlers() )
if ( context.hasRenderedFeatureHandlers() && !renderedBoundsGeom.isNull() )
{
QgsRenderedFeatureHandlerInterface::RenderedFeatureContext featureContext( context );
const QList< QgsRenderedFeatureHandlerInterface * > handlers = context.renderedFeatureHandlers();

0 comments on commit 96753cf

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