Skip to content

Commit 4b6a6aa

Browse files
author
jef
committed
rollback accidentally commit file of r14465
git-svn-id: http://svn.osgeo.org/qgis/trunk@14466 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 7f2b541 commit 4b6a6aa

File tree

1 file changed

+30
-10
lines changed

1 file changed

+30
-10
lines changed

python/plugins/fTools/tools/doVisual.py

+30-10
Original file line numberDiff line numberDiff line change
@@ -441,16 +441,36 @@ def check_geometry( self, vlayer ):
441441
geom = QgsGeometry( feat.geometry() )
442442
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
443443
nElement += 1
444-
445-
errors = geom.validateGeometry()
446-
if len(errors) > 0:
447-
lstErrors.append( self.tr( "Feature %1 has %2 errors:" ).arg( feat.id() ).arg( uni
448-
for e in errors:
449-
if e.hasWhere():
450-
lstErrors.append( self.tr( "Feature %1: %2 [%3]" ).arg( feat.id() ).arg( e.what() ).arg( e.where() ) )
451-
else:
452-
lstErrors.append( self.tr( "Feature %1: %2 [%3]" ).arg( feat.id() ).arg( e.what() ).arg( e.where() ) )
453-
444+
if geom.isMultipart():
445+
polygons = geom.asMultiPolygon()
446+
for polygon in polygons:
447+
if not self.isHoleNested( polygon ):
448+
lstErrors.append( self.tr( "Feature %1 contains an unnested hole" ).arg( unicode( feat.id() ) ) )
449+
count += 1
450+
if not self.isPolygonClosed( polygon ):
451+
lstErrors.append( self.tr( "Feature %1 is not closed" ).arg( unicode( feat.id() ) ) )
452+
count += 1
453+
if self.isSelfIntersecting( polygon ):
454+
lstErrors.append( self.tr( "Feature %1 is self intersecting" ).arg( unicode( feat.id() ) ) )
455+
count += 1
456+
if not self.isCorrectOrientation( polygon ):
457+
lstErrors.append( self.tr( "Feature %1 has incorrect node ordering" ).arg( unicode( feat.id() ) ) )
458+
count += 1
459+
460+
else:
461+
geom = geom.asPolygon()
462+
if not self.isHoleNested( geom ):
463+
lstErrors.append( self.tr( "Feature %1 contains an unnested hole" ).arg( unicode( feat.id() ) ) )
464+
count += 1
465+
if not self.isPolygonClosed( geom ):
466+
lstErrors.append( self.tr( "Feature %1 is not closed" ).arg( unicode( feat.id() ) ) )
467+
count += 1
468+
if self.isSelfIntersecting( geom ):
469+
lstErrors.append( self.tr( "Feature %1 is self intersecting" ).arg( unicode( feat.id() ) ) )
470+
count += 1
471+
if not self.isCorrectOrientation( geom ):
472+
lstErrors.append( self.tr( "Feature %1 has incorrect node ordering" ).arg( unicode( feat.id() ) ) )
473+
count += 1
454474
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nFeat )
455475
return ( lstErrors, count )
456476

0 commit comments

Comments
 (0)