diff --git a/src/core/qgsmaptopixelgeometrysimplifier.cpp b/src/core/qgsmaptopixelgeometrysimplifier.cpp index 4f57db31952c..4041b690a34a 100644 --- a/src/core/qgsmaptopixelgeometrysimplifier.cpp +++ b/src/core/qgsmaptopixelgeometrysimplifier.cpp @@ -162,8 +162,6 @@ std::unique_ptr< QgsAbstractGeometry > QgsMapToPixelSimplifier::simplifyGeometry } double x = 0.0, y = 0.0, lastX = 0.0, lastY = 0.0; - QgsRectangle r; - r.setMinimal(); if ( numPoints <= ( isaLinearRing ? 4 : 2 ) ) isGeneralizable = false; @@ -225,8 +223,6 @@ std::unique_ptr< QgsAbstractGeometry > QgsMapToPixelSimplifier::simplifyGeometry lastX = x; lastY = y; } - - r.combineExtentWith( x, y ); } break; } @@ -300,8 +296,6 @@ std::unique_ptr< QgsAbstractGeometry > QgsMapToPixelSimplifier::simplifyGeometry hasLongSegments |= isLongSegment; } - - r.combineExtentWith( x, y ); } } } @@ -317,7 +311,7 @@ std::unique_ptr< QgsAbstractGeometry > QgsMapToPixelSimplifier::simplifyGeometry { // approximate the geometry's shape by its bounding box // (rect for linear ring / one segment for line string) - return generalizeWkbGeometryByBoundingBox( wkbType, geometry, r, isaLinearRing ); + return generalizeWkbGeometryByBoundingBox( wkbType, geometry, envelope, isaLinearRing ); } else {