Skip to content

Commit 5cb6dd7

Browse files
committedMay 22, 2012
store geometries from GeometryCollection in list
1 parent 5745fb9 commit 5cb6dd7

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed
 

‎python/plugins/fTools/tools/doGeoprocessing.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,14 +1145,18 @@ def union( self ):
11451145
if int_geom.wkbType() == 0:
11461146
# intersection produced different geometry types
11471147
temp_list = int_geom.asGeometryCollection()
1148+
int_geom = []
11481149
for i in temp_list:
11491150
if i.type() == geom.type():
1150-
try:
1151-
outFeat.setGeometry( j )
1152-
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
1153-
writer.addFeature( outFeat )
1154-
except Exception, err:
1155-
FEATURE_EXCEPT = False
1151+
int_geom.append( QgsGeometry( i ) )
1152+
if len(int_geom) > 1:
1153+
for j in int_geom:
1154+
try:
1155+
outFeat.setGeometry( j )
1156+
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )
1157+
writer.addFeature( outFeat )
1158+
except Exception, err:
1159+
FEATURE_EXCEPT = False
11561160
try:
11571161
outFeat.setGeometry( int_geom )
11581162
outFeat.setAttributeMap( ftools_utils.combineVectorAttributes( atMapA, atMapB ) )

0 commit comments

Comments
 (0)
Please sign in to comment.