Skip to content

Commit

Permalink
rollback accidentally commit file of r14465
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@14466 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Oct 31, 2010
1 parent 3f1cc0d commit 86080c8
Showing 1 changed file with 30 additions and 10 deletions.
40 changes: 30 additions & 10 deletions python/plugins/fTools/tools/doVisual.py
Expand Up @@ -441,16 +441,36 @@ def check_geometry( self, vlayer ):
geom = QgsGeometry( feat.geometry() )
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nElement )
nElement += 1

errors = geom.validateGeometry()
if len(errors) > 0:
lstErrors.append( self.tr( "Feature %1 has %2 errors:" ).arg( feat.id() ).arg( uni
for e in errors:
if e.hasWhere():
lstErrors.append( self.tr( "Feature %1: %2 [%3]" ).arg( feat.id() ).arg( e.what() ).arg( e.where() ) )
else:
lstErrors.append( self.tr( "Feature %1: %2 [%3]" ).arg( feat.id() ).arg( e.what() ).arg( e.where() ) )

if geom.isMultipart():
polygons = geom.asMultiPolygon()
for polygon in polygons:
if not self.isHoleNested( polygon ):
lstErrors.append( self.tr( "Feature %1 contains an unnested hole" ).arg( unicode( feat.id() ) ) )
count += 1
if not self.isPolygonClosed( polygon ):
lstErrors.append( self.tr( "Feature %1 is not closed" ).arg( unicode( feat.id() ) ) )
count += 1
if self.isSelfIntersecting( polygon ):
lstErrors.append( self.tr( "Feature %1 is self intersecting" ).arg( unicode( feat.id() ) ) )
count += 1
if not self.isCorrectOrientation( polygon ):
lstErrors.append( self.tr( "Feature %1 has incorrect node ordering" ).arg( unicode( feat.id() ) ) )
count += 1

else:
geom = geom.asPolygon()
if not self.isHoleNested( geom ):
lstErrors.append( self.tr( "Feature %1 contains an unnested hole" ).arg( unicode( feat.id() ) ) )
count += 1
if not self.isPolygonClosed( geom ):
lstErrors.append( self.tr( "Feature %1 is not closed" ).arg( unicode( feat.id() ) ) )
count += 1
if self.isSelfIntersecting( geom ):
lstErrors.append( self.tr( "Feature %1 is self intersecting" ).arg( unicode( feat.id() ) ) )
count += 1
if not self.isCorrectOrientation( geom ):
lstErrors.append( self.tr( "Feature %1 has incorrect node ordering" ).arg( unicode( feat.id() ) ) )
count += 1
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), nFeat )
return ( lstErrors, count )

Expand Down

0 comments on commit 86080c8

Please sign in to comment.