Skip to content

Commit

Permalink
store geometries from GeometryCollection in list
Browse files Browse the repository at this point in the history
  • Loading branch information
alexbruy committed May 22, 2012
1 parent 5745fb9 commit 5cb6dd7
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions python/plugins/fTools/tools/doGeoprocessing.py
Expand Up @@ -1145,14 +1145,18 @@ def union( self ):
if int_geom.wkbType() == 0:
# intersection produced different geometry types
temp_list = int_geom.asGeometryCollection()
int_geom = []
for i in temp_list:
if i.type() == geom.type():
try:
outFeat.setGeometry( j )
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
writer.addFeature( outFeat )
except Exception, err:
FEATURE_EXCEPT = False
int_geom.append( QgsGeometry( i ) )
if len(int_geom) > 1:
for j in int_geom:
try:
outFeat.setGeometry( j )
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
writer.addFeature( outFeat )
except Exception, err:
FEATURE_EXCEPT = False
try:
outFeat.setGeometry( int_geom )
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
Expand Down

0 comments on commit 5cb6dd7

Please sign in to comment.