Skip to content
Permalink
Browse files

Remove the whole ring / linestring if number of vertices to small

  • Loading branch information
mhugent committed Dec 28, 2015
1 parent 416c004 commit bf3fbec7553a6f0929fa0fa9de81f31470fdec1c
Showing with 7 additions and 1 deletion.
  1. +1 −1 src/core/geometry/qgscurvepolygonv2.cpp
  2. +6 −0 src/core/geometry/qgslinestringv2.cpp
@@ -702,7 +702,7 @@ bool QgsCurvePolygonV2::deleteVertex( const QgsVertexId& vId )

QgsCurveV2* ring = vId.ring == 0 ? mExteriorRing : mInteriorRings.at( vId.ring - 1 );
int n = ring->numPoints();
if ( n <= 2 )
if ( n <= 4 )
{
//no points will be left in ring, so remove whole ring
if ( vId.ring == 0 )
@@ -644,6 +644,12 @@ bool QgsLineStringV2::deleteVertex( const QgsVertexId& position )
{
mM.remove( position.vertex );
}

if( numPoints() == 1 )
{
clear();
}

mBoundingBox = QgsRectangle(); //set bounding box invalid
return true;
}

0 comments on commit bf3fbec

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