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

This commit is contained in:
Marco Hugentobler 2015-12-28 18:24:32 +01:00
parent 416c004a08
commit bf3fbec755
2 changed files with 7 additions and 1 deletions

View File

@ -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 )

View File

@ -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;
}