Skip to content

Commit

Permalink
Remove the whole ring / linestring if number of vertices to small
Browse files Browse the repository at this point in the history
  • Loading branch information
mhugent committed Dec 28, 2015
1 parent 416c004 commit bf3fbec
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/geometry/qgscurvepolygonv2.cpp
Expand Up @@ -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 )
Expand Down
6 changes: 6 additions & 0 deletions src/core/geometry/qgslinestringv2.cpp
Expand Up @@ -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;
}
Expand Down

0 comments on commit bf3fbec

Please sign in to comment.