Skip to content

Commit

Permalink
Fix processing algs
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Aug 3, 2021
1 parent 75c787a commit 4f56a42
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions python/plugins/processing/algs/qgis/Buffer.py
Expand Up @@ -21,7 +21,8 @@
__date__ = 'August 2012'
__copyright__ = '(C) 2012, Victor Olaya'

from qgis.core import (QgsFeature,
from qgis.core import (Qgis,
QgsFeature,
QgsGeometry,
QgsFeatureRequest,
QgsFeatureSink)
Expand Down Expand Up @@ -57,7 +58,7 @@ def buffering(feedback, context, sink, distance, field, useField, source, dissol

inGeom = inFeat.geometry()

buffered_geometries.append(inGeom.buffer(float(value), segments, endCapStyle, joinStyle, miterLimit))
buffered_geometries.append(inGeom.buffer(float(value), segments, Qgis.EndCapStyle(endCapStyle), Qgis.JoinStyle(joinStyle), miterLimit))

current += 1
feedback.setProgress(int(current * total))
Expand All @@ -81,7 +82,7 @@ def buffering(feedback, context, sink, distance, field, useField, source, dissol
value = distance
inGeom = inFeat.geometry()
outFeat = QgsFeature()
outGeom = inGeom.buffer(float(value), segments, endCapStyle, joinStyle, miterLimit)
outGeom = inGeom.buffer(float(value), segments, Qgis.EndCapStyle(endCapStyle), Qgis.JoinStyle(joinStyle), miterLimit)
outFeat.setGeometry(outGeom)
outFeat.setAttributes(attrs)
sink.addFeature(outFeat, QgsFeatureSink.FastInsert)
Expand Down
5 changes: 3 additions & 2 deletions python/plugins/processing/algs/qgis/CheckValidity.py
Expand Up @@ -26,7 +26,8 @@
from qgis.PyQt.QtGui import QIcon
from qgis.PyQt.QtCore import QVariant

from qgis.core import (QgsApplication,
from qgis.core import (Qgis,
QgsApplication,
QgsSettings,
QgsGeometry,
QgsFeature,
Expand Down Expand Up @@ -156,7 +157,7 @@ def doCheck(self, method, parameters, context, feedback, ignore_ring_self_inters

valid = True
if not geom.isNull() and not geom.isEmpty():
errors = list(geom.validateGeometry(method, flags))
errors = list(geom.validateGeometry(Qgis.GeometryValidationEngine(method), flags))
if errors:
valid = False
reasons = []
Expand Down

0 comments on commit 4f56a42

Please sign in to comment.