30
30
QgsPoint ,
31
31
QgsWkbTypes ,
32
32
QgsApplication ,
33
+ QgsMessageLog ,
33
34
QgsProcessingUtils )
34
35
from processing .core .GeoAlgorithm import GeoAlgorithm
35
36
from processing .core .GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
36
- from processing .core .ProcessingLog import ProcessingLog
37
37
from processing .core .parameters import ParameterVector
38
38
from processing .core .parameters import ParameterNumber
39
39
from processing .core .outputs import OutputVector
@@ -100,8 +100,8 @@ def processAlgorithm(self, context, feedback):
100
100
elif geomType == QgsWkbTypes .LineString :
101
101
points = self ._gridify (geom .asPolyline (), hSpacing , vSpacing )
102
102
if len (points ) < 2 :
103
- ProcessingLog . addToLog ( ProcessingLog . LOG_INFO ,
104
- self .tr ('Failed to gridify feature with FID {0}' ).format (f .id ()))
103
+ QgsProcessingUtils . logMessage ( QgsMessageLog . INFO ,
104
+ self .tr ('Failed to gridify feature with FID {0}' ).format (f .id ()))
105
105
newGeom = None
106
106
else :
107
107
newGeom = QgsGeometry .fromPolyline (points )
@@ -112,8 +112,8 @@ def processAlgorithm(self, context, feedback):
112
112
if len (points ) > 1 :
113
113
polyline .append (points )
114
114
if len (polyline ) <= 0 :
115
- ProcessingLog . addToLog ( ProcessingLog . LOG_INFO ,
116
- self .tr ('Failed to gridify feature with FID {0}' ).format (f .id ()))
115
+ QgsProcessingUtils . logMessage ( QgsMessageLog . INFO ,
116
+ self .tr ('Failed to gridify feature with FID {0}' ).format (f .id ()))
117
117
newGeom = None
118
118
else :
119
119
newGeom = QgsGeometry .fromMultiPolyline (polyline )
@@ -125,8 +125,8 @@ def processAlgorithm(self, context, feedback):
125
125
if len (points ) > 1 :
126
126
polygon .append (points )
127
127
if len (polygon ) <= 0 :
128
- ProcessingLog . addToLog ( ProcessingLog . LOG_INFO ,
129
- self .tr ('Failed to gridify feature with FID {0}' ).format (f .id ()))
128
+ QgsProcessingUtils . logMessage ( QgsMessageLog . INFO ,
129
+ self .tr ('Failed to gridify feature with FID {0}' ).format (f .id ()))
130
130
newGeom = None
131
131
else :
132
132
newGeom = QgsGeometry .fromPolygon (polygon )
@@ -143,8 +143,8 @@ def processAlgorithm(self, context, feedback):
143
143
multipolygon .append (newPolygon )
144
144
145
145
if len (multipolygon ) <= 0 :
146
- ProcessingLog . addToLog ( ProcessingLog . LOG_INFO ,
147
- self .tr ('Failed to gridify feature with FID {0}' ).format (f .id ()))
146
+ QgsProcessingUtils . logMessage ( QgsMessageLog . INFO ,
147
+ self .tr ('Failed to gridify feature with FID {0}' ).format (f .id ()))
148
148
newGeom = None
149
149
else :
150
150
newGeom = QgsGeometry .fromMultiPolygon (multipolygon )
0 commit comments