mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-25 00:58:06 -05:00
#9686: fix simplification of no-closed polygons
This commit is contained in:
parent
fc6cd5428a
commit
60e1a9b721
@ -207,6 +207,24 @@ bool QgsMapToPixelSimplifier::simplifyWkbGeometry( int simplifyFlags, QGis::WkbT
|
||||
double* ptr = ( double* )targetWkb;
|
||||
map2pixelTol *= map2pixelTol; //-> Use mappixelTol for 'LengthSquare' calculations.
|
||||
|
||||
// Check whether the LinearRing is really closed.
|
||||
if ( isaLinearRing )
|
||||
{
|
||||
double x1, y1, x2, y2;
|
||||
|
||||
unsigned char* startWkbX = sourceWkb;
|
||||
unsigned char* startWkbY = startWkbX + sizeOfDoubleX;
|
||||
unsigned char* finalWkbX = sourceWkb + ( numPoints - 1 ) * ( sizeOfDoubleX + sizeOfDoubleY );
|
||||
unsigned char* finalWkbY = finalWkbX + sizeOfDoubleX;
|
||||
|
||||
memcpy( &x1, startWkbX, sizeof( double ) );
|
||||
memcpy( &y1, startWkbY, sizeof( double ) );
|
||||
memcpy( &x2, finalWkbX, sizeof( double ) );
|
||||
memcpy( &y2, finalWkbY, sizeof( double ) );
|
||||
|
||||
isaLinearRing = ( x1 == x2 ) && ( y1 == y2 );
|
||||
}
|
||||
|
||||
// Process each vertex...
|
||||
for ( int i = 0, numPoints_i = ( isaLinearRing ? numPoints - 1 : numPoints ); i < numPoints_i; ++i )
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user