Skip to content

Commit fcacd00

Browse files
committedMay 30, 2019
Avoid redundant calculation in QgsMapToPixelSimplifier
1 parent 3d9386b commit fcacd00

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed
 

‎src/core/qgsmaptopixelgeometrysimplifier.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,6 @@ std::unique_ptr< QgsAbstractGeometry > QgsMapToPixelSimplifier::simplifyGeometry
162162
}
163163

164164
double x = 0.0, y = 0.0, lastX = 0.0, lastY = 0.0;
165-
QgsRectangle r;
166-
r.setMinimal();
167165

168166
if ( numPoints <= ( isaLinearRing ? 4 : 2 ) )
169167
isGeneralizable = false;
@@ -225,8 +223,6 @@ std::unique_ptr< QgsAbstractGeometry > QgsMapToPixelSimplifier::simplifyGeometry
225223
lastX = x;
226224
lastY = y;
227225
}
228-
229-
r.combineExtentWith( x, y );
230226
}
231227
break;
232228
}
@@ -300,8 +296,6 @@ std::unique_ptr< QgsAbstractGeometry > QgsMapToPixelSimplifier::simplifyGeometry
300296

301297
hasLongSegments |= isLongSegment;
302298
}
303-
304-
r.combineExtentWith( x, y );
305299
}
306300
}
307301
}
@@ -317,7 +311,7 @@ std::unique_ptr< QgsAbstractGeometry > QgsMapToPixelSimplifier::simplifyGeometry
317311
{
318312
// approximate the geometry's shape by its bounding box
319313
// (rect for linear ring / one segment for line string)
320-
return generalizeWkbGeometryByBoundingBox( wkbType, geometry, r, isaLinearRing );
314+
return generalizeWkbGeometryByBoundingBox( wkbType, geometry, envelope, isaLinearRing );
321315
}
322316
else
323317
{

0 commit comments

Comments
 (0)
Please sign in to comment.