@@ -77,9 +77,9 @@ def processAlgorithm(self, progress):
77
77
for current , f in enumerate (features ):
78
78
featGeometry = f .geometry ()
79
79
attrs = f .attributes ()
80
- pointsBefore += self . geomVertexCount ( featGeometry )
80
+ pointsBefore += featGeometry . geometry (). nCoordinates ( )
81
81
newGeometry = featGeometry .simplify (tolerance )
82
- pointsAfter += self . geomVertexCount ( newGeometry )
82
+ pointsAfter += newGeometry . geometry (). nCoordinates ( )
83
83
feature = QgsFeature ()
84
84
feature .setGeometry (newGeometry )
85
85
feature .setAttributes (attrs )
@@ -90,28 +90,3 @@ def processAlgorithm(self, progress):
90
90
91
91
ProcessingLog .addToLog (ProcessingLog .LOG_INFO ,
92
92
self .tr ('Simplify: Input geometries have been simplified from %s to %s points' % (pointsBefore , pointsAfter )))
93
-
94
- def geomVertexCount (self , geometry ):
95
- geomType = geometry .type ()
96
-
97
- if geomType == QgsWkbTypes .LineGeometry :
98
- if geometry .isMultipart ():
99
- pointsList = geometry .asMultiPolyline ()
100
- points = sum (pointsList , [])
101
- else :
102
- points = geometry .asPolyline ()
103
- return len (points )
104
- elif geomType == QgsWkbTypes .PolygonGeometry :
105
- if geometry .isMultipart ():
106
- polylinesList = geometry .asMultiPolygon ()
107
- polylines = sum (polylinesList , [])
108
- else :
109
- polylines = geometry .asPolygon ()
110
-
111
- points = []
112
- for l in polylines :
113
- points .extend (l )
114
-
115
- return len (points )
116
- else :
117
- return None
0 commit comments