Skip to content

Commit bf3fbec

Browse files
committedDec 28, 2015
Remove the whole ring / linestring if number of vertices to small
1 parent 416c004 commit bf3fbec

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed
 

‎src/core/geometry/qgscurvepolygonv2.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ bool QgsCurvePolygonV2::deleteVertex( const QgsVertexId& vId )
702702

703703
QgsCurveV2* ring = vId.ring == 0 ? mExteriorRing : mInteriorRings.at( vId.ring - 1 );
704704
int n = ring->numPoints();
705-
if ( n <= 2 )
705+
if ( n <= 4 )
706706
{
707707
//no points will be left in ring, so remove whole ring
708708
if ( vId.ring == 0 )

‎src/core/geometry/qgslinestringv2.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,12 @@ bool QgsLineStringV2::deleteVertex( const QgsVertexId& position )
644644
{
645645
mM.remove( position.vertex );
646646
}
647+
648+
if( numPoints() == 1 )
649+
{
650+
clear();
651+
}
652+
647653
mBoundingBox = QgsRectangle(); //set bounding box invalid
648654
return true;
649655
}

0 commit comments

Comments
 (0)
Please sign in to comment.