Navigation Menu

Skip to content

Commit

Permalink
Partial fix #7708
Browse files Browse the repository at this point in the history
  • Loading branch information
ddanielvaz committed Jul 23, 2013
1 parent 4b6bc3d commit 0523e89
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions python/plugins/fTools/tools/doGeoprocessing.py
Expand Up @@ -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 ) )

Expand Down Expand Up @@ -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:
Expand All @@ -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 ):
Expand Down

0 comments on commit 0523e89

Please sign in to comment.