@@ -131,10 +131,12 @@ QgsPoint* QgsOgrMapToPixelSimplifier::getEnvelopePoints( const QgsRectangle& env
131131// ! Simplifies the OGR-geometry (Removing duplicated points) when is applied the specified map2pixel context
132132bool QgsOgrMapToPixelSimplifier::simplifyOgrGeometry ( QGis::GeometryType geometryType, double * xptr, int xStride, double * yptr, int yStride, int pointCount, int & pointSimplifiedCount )
133133{
134- bool canbeGeneralizable = ( mSimplifyFlags & QgsMapToPixelSimplifier::SimplifyGeometry );
134+ bool isGeneralizable = ( mSimplifyFlags & QgsMapToPixelSimplifier::SimplifyGeometry );
135135
136136 pointSimplifiedCount = pointCount;
137- if ( geometryType == QGis::Point || geometryType == QGis::UnknownGeometry ) return false ;
137+ if ( geometryType == QGis::Point || geometryType == QGis::UnknownGeometry )
138+ return false ;
139+
138140 pointSimplifiedCount = 0 ;
139141
140142 double map2pixelTol = mTolerance * mTolerance ; // -> Use mappixelTol for 'LengthSquare' calculations.
@@ -150,7 +152,10 @@ bool QgsOgrMapToPixelSimplifier::simplifyOgrGeometry( QGis::GeometryType geometr
150152 memcpy ( &x, xsourcePtr, sizeof ( double ) ); xsourcePtr += xStride;
151153 memcpy ( &y, ysourcePtr, sizeof ( double ) ); ysourcePtr += yStride;
152154
153- if ( i == 0 || !canbeGeneralizable || QgsMapToPixelSimplifier::calculateLengthSquared2D ( x, y, lastX, lastY ) > map2pixelTol || ( geometryType == QGis::Line && ( i == 1 || i >= numPoints - 2 ) ) )
155+ if ( i == 0 ||
156+ !isGeneralizable ||
157+ calculateLengthSquared2D ( x, y, lastX, lastY ) > map2pixelTol ||
158+ ( geometryType == QGis::Line && ( i == 1 || i >= numPoints - 2 ) ) )
154159 {
155160 memcpy ( xtargetPtr, &x, sizeof ( double ) ); lastX = x; xtargetPtr += xStride;
156161 memcpy ( ytargetPtr, &y, sizeof ( double ) ); lastY = y; ytargetPtr += yStride;
@@ -184,7 +189,7 @@ bool QgsOgrMapToPixelSimplifier::simplifyOgrGeometry( OGRGeometryH geometry, boo
184189 QgsRectangle envelope ( env.MinX , env.MinY , env.MaxX , env.MaxY );
185190
186191 // Can replace the geometry by its BBOX ?
187- if (( mSimplifyFlags & QgsMapToPixelSimplifier::SimplifyEnvelope ) && canbeGeneralizedByMapBoundingBox ( envelope ) )
192+ if (( mSimplifyFlags & QgsMapToPixelSimplifier::SimplifyEnvelope ) && isGeneralizableByMapBoundingBox ( envelope ) )
188193 {
189194 QgsPoint* points = getEnvelopePoints ( envelope, numPoints, isaLinearRing );
190195
0 commit comments