Skip to content

Commit 8422a9d

Browse files
committedNov 11, 2011
Do not validate the geometry if it is known to be valid - save some time
1 parent b07ccb3 commit 8422a9d

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed
 

‎src/app/qgsmaptoolnodetool.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -954,11 +954,17 @@ void SelectionFeature::setSelectedFeature( QgsFeatureId featureId,
954954

955955
void SelectionFeature::validateGeometry( QgsGeometry *g )
956956
{
957-
QgsDebugMsg( "validating geometry" );
958-
959957
if ( g == NULL )
960958
g = mFeature->geometry();
961959

960+
if ( g->isGeosValid() )
961+
{
962+
QgsDebugMsg( "geometry is valid - not validating." );
963+
return;
964+
}
965+
966+
QgsDebugMsg( "validating geometry" );
967+
962968
g->validateGeometry( mGeomErrors );
963969

964970
while ( !mGeomErrorMarkers.isEmpty() )

0 commit comments

Comments
 (0)
Please sign in to comment.