diff --git a/python/plugins/processing/algs/qgis/SinglePartsToMultiparts.py b/python/plugins/processing/algs/qgis/SinglePartsToMultiparts.py index 71421caf154..ac10ad28750 100644 --- a/python/plugins/processing/algs/qgis/SinglePartsToMultiparts.py +++ b/python/plugins/processing/algs/qgis/SinglePartsToMultiparts.py @@ -30,7 +30,7 @@ import os from qgis.PyQt.QtGui import QIcon -from qgis.core import QgsFeature, QgsGeometry, QgsWkbTypes, QgsProcessingUtils, NULL +from qgis.core import QgsFeature, QgsGeometry, QgsWkbTypes, QgsProcessingUtils from processing.core.GeoAlgorithm import GeoAlgorithm from processing.core.parameters import ParameterVector @@ -87,13 +87,6 @@ class SinglePartsToMultiparts(GeoAlgorithm): for current, feature in enumerate(features): atMap = feature.attributes() idVar = atMap[index] - if idVar in [None, NULL]: - outFeat.setAttributes(atMap) - outFeat.setGeometry(feature.geometry()) - writer.addFeature(outFeat) - feedback.setProgress(int(current * total)) - continue - key = str(idVar).strip() if key not in collection_geom: collection_geom[key] = [] diff --git a/python/plugins/processing/tests/testdata/custom/single_part_poly.gml b/python/plugins/processing/tests/testdata/custom/single_part_poly.gml index a10fe7525fe..bf9a0d3462d 100644 --- a/python/plugins/processing/tests/testdata/custom/single_part_poly.gml +++ b/python/plugins/processing/tests/testdata/custom/single_part_poly.gml @@ -10,11 +10,11 @@ 8.9628809850746267.163993643533122 - + 0.80194134384858,7.16399364353312 0.672499728706625,4.76932376340694 5.20295625867508,4.2839177066246 5.26276665671642,6.74081294029851 0.80194134384858,7.16399364353312 - + 1 diff --git a/python/plugins/processing/tests/testdata/expected/single_to_multi.gml b/python/plugins/processing/tests/testdata/expected/single_to_multi.gml index d86824848d8..de7731f91e6 100644 --- a/python/plugins/processing/tests/testdata/expected/single_to_multi.gml +++ b/python/plugins/processing/tests/testdata/expected/single_to_multi.gml @@ -11,11 +11,6 @@ - - - 0.80194134384858,7.16399364353312 0.672499728706625,4.76932376340694 5.20295625867508,4.2839177066246 5.26276665671642,6.74081294029851 0.80194134384858,7.16399364353312 - - 0.210196746268657,2.19860362686567 0.439859014925373,1.05029228358209 1.15436385074627,1.02477425373134 0.720557343283582,4.0359017761194 0.210196746268657,2.19860362686567 @@ -23,14 +18,8 @@ - - 0.592967194029851,-0.17457314925373 1.58817035820896,-2.06290735820895 2.37922928358209,-1.3739205522388 2.63440958208955,0.284751388059703 0.592967194029851,-0.17457314925373 - 3 - - - - - 6.30900588059701,4.21452798507463 6.00278952238806,2.60689210447761 8.4525203880597,1.81583317910448 8.96288098507463,4.26556404477612 8.24837614925373,7.04702929850746 6.30900588059701,4.214527985074633.96134713432836,1.68824302985075 3.93582910447761,-1.14425828358209 8.27389417910448,-1.50151070149254 8.120786,0.64200380597015 3.96134713432836,1.68824302985075 + + 0.80194134384858,7.16399364353312 0.672499728706625,4.76932376340694 5.20295625867508,4.2839177066246 5.26276665671642,6.74081294029851 0.80194134384858,7.163993643533126.30900588059701,4.21452798507463 6.00278952238806,2.60689210447761 8.4525203880597,1.81583317910448 8.96288098507463,4.26556404477612 8.24837614925373,7.04702929850746 6.30900588059701,4.214527985074633.96134713432836,1.68824302985075 3.93582910447761,-1.14425828358209 8.27389417910448,-1.50151070149254 8.120786,0.64200380597015 3.96134713432836,1.68824302985075 1 @@ -40,4 +29,10 @@ 2 + + + 0.592967194029851,-0.17457314925373 1.58817035820896,-2.06290735820895 2.37922928358209,-1.3739205522388 2.63440958208955,0.284751388059703 0.592967194029851,-0.17457314925373 + 3 + +