Skip to content
Permalink
Browse files
Partial fix #7708
  • Loading branch information
ddanielvaz committed Jul 23, 2013
1 parent 4b6bc3d commit 0523e8984cbf4e23892e66b93b451e3eb335f717
Showing with 6 additions and 7 deletions.
  1. +6 −7 python/plugins/fTools/tools/doGeoprocessing.py
@@ -1092,7 +1092,7 @@ def union( self ):
indexA = ftools_utils.createIndex( vproviderB )
indexB = ftools_utils.createIndex( vproviderA )

nFeat = vproviderA.featureCount() * vproviderB.featureCount()
nFeat = vproviderA.featureCount() + vproviderB.featureCount()
self.emit( SIGNAL( "runStatus(PyQt_PyObject)" ), 0)
self.emit( SIGNAL( "runRange(PyQt_PyObject)" ), ( 0, nFeat ) )

@@ -1198,12 +1198,11 @@ def union( self ):
length = len( vproviderA.fields() )

fitB = vproviderB.getFeatures()
while fitB.nextFeature( inFeatA ):
while fitB.nextFeature( inFeatB ):
add = False
geom = QgsGeometry( inFeatA.geometry() )
geom = QgsGeometry( inFeatB.geometry() )
diff_geom = QgsGeometry( geom )
atMap = inFeatA.attributes()
atMap = dict( zip( range( length, length + len( atMap ) ), atMap ) )
atMap = inFeatB.attributes()
intersects = indexB.intersects( geom.boundingBox() )

if len(intersects) < 1:
@@ -1215,8 +1214,8 @@ def union( self ):
FEATURE_EXCEPT = False
else:
for id in intersects:
vproviderB.getFeatures( QgsFeatureRequest().setFilterFid( int( id ) ) ).nextFeature( inFeatB )
tmpGeom = QgsGeometry( inFeatB.geometry() )
vproviderA.getFeatures( QgsFeatureRequest().setFilterFid( int( id ) ) ).nextFeature( inFeatA )
tmpGeom = QgsGeometry( inFeatA.geometry() )

try:
if diff_geom.intersects( tmpGeom ):

0 comments on commit 0523e89

Please sign in to comment.