Skip to content
Permalink
Browse files

Cleanup some imports, remove use of dataobjects

  • Loading branch information
nyalldawson committed Jul 11, 2017
1 parent d92583c commit 7bb1b7ade00e8292ff8bec1faa4db856cb43383c
@@ -32,13 +32,8 @@
from qgis.analysis import QgsAspectFilter
from qgis.core import (QgsProcessingParameterRasterLayer,
QgsProcessingParameterNumber,
QgsProcessingParameterRasterDestination,
QgsProcessingOutputRasterLayer,
QgsFeatureSink)
QgsProcessingParameterRasterDestination)
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
from processing.core.parameters import ParameterRaster
from processing.core.parameters import ParameterNumber
from processing.core.outputs import OutputRaster
from processing.tools import raster
from processing.tools.dataobjects import exportRasterLayer

@@ -32,11 +32,9 @@
from qgis.PyQt.QtGui import QIcon

from qgis.core import (QgsStatisticalSummary,
QgsFeatureSink,
QgsStringStatisticalSummary,
QgsDateTimeStatisticalSummary,
QgsFeatureRequest,
QgsProcessingUtils,
QgsProcessingParameterFeatureSource,
QgsProcessingParameterField,
QgsProcessingParameterFileDestination,
@@ -26,9 +26,7 @@

__revision__ = '$Format:%H$'

from qgis.core import (QgsFeatureRequest,
QgsFeature,
QgsGeometry,
from qgis.core import (QgsFeature,
QgsFeatureSink,
QgsWkbTypes,
QgsProcessing,
@@ -29,7 +29,6 @@
QgsFields,
QgsProcessingParameterVectorLayer,
QgsProcessingParameterField,
QgsProcessingParameterDefinition,
QgsProcessingOutputVectorLayer)

from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
@@ -27,9 +27,7 @@

from qgis.core import (QgsVectorLayerExporter,
QgsSettings,
QgsApplication,
QgsFeatureSink,
QgsProcessingUtils,
QgsProcessingParameterFeatureSource,
QgsProcessingParameterString,
QgsProcessingParameterField,
@@ -26,8 +26,7 @@

__revision__ = '$Format:%H$'

from qgis.core import (QgsApplication,
QgsProcessingParameterString)
from qgis.core import (QgsProcessingParameterString)
from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.tools import postgis
@@ -25,10 +25,8 @@

__revision__ = '$Format:%H$'

from qgis.core import (QgsApplication)
from qgis.PyQt.QtCore import QVariant
from qgis.core import (QgsExpression,
QgsProcessingUtils,
QgsProcessingParameterVectorLayer,
QgsProcessingParameterField,
QgsProcessingParameterEnum,
@@ -32,13 +32,13 @@
from qgis.core import (QgsMapToPixelSimplifier,
QgsMessageLog,
QgsFeatureSink,
QgsProcessing,
QgsProcessingParameterFeatureSource,
QgsProcessingParameterFeatureSink,
QgsProcessingParameterEnum,
QgsProcessingParameterNumber)

from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
from processing.tools import dataobjects

pluginPath = os.path.split(os.path.split(os.path.dirname(__file__))[0])[0]

@@ -62,7 +62,7 @@ def __init__(self):
def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT,
self.tr('Input layer'),
[dataobjects.TYPE_VECTOR_POLYGON, dataobjects.TYPE_VECTOR_LINE]))
[QgsProcessing.TypeVectorPolygon, QgsProcessing.TypeVectorLine]))
self.methods = [self.tr('Distance (Douglas-Peucker)'),
'Snap to grid',
'Area (Visvalingam)']
@@ -26,13 +26,13 @@
__revision__ = '$Format:%H$'

from qgis.core import (QgsFeatureSink,
QgsProcessing,
QgsProcessingParameterFeatureSource,
QgsProcessingParameterFeatureSink,
QgsProcessingParameterNumber)

from processing.algs.qgis.QgisAlgorithm import QgisAlgorithm
from processing.core.GeoAlgorithmExecutionException import GeoAlgorithmExecutionException
from processing.tools import dataobjects


class Smooth(QgisAlgorithm):
@@ -51,7 +51,7 @@ def __init__(self):

def initAlgorithm(self, config=None):
self.addParameter(QgsProcessingParameterFeatureSource(self.INPUT,
self.tr('Input layer'), [dataobjects.TYPE_VECTOR_POLYGON, dataobjects.TYPE_VECTOR_LINE]))
self.tr('Input layer'), [QgsProcessing.TypeVectorPolygon, QgsProcessing.TypeVectorLine]))
self.addParameter(QgsProcessingParameterNumber(self.ITERATIONS,
self.tr('Iterations'),
defaultValue=1, minValue=1, maxValue=10))
@@ -27,7 +27,6 @@
__revision__ = '$Format:%H$'

from qgis.core import (QgsDataSourceUri,
QgsApplication,
QgsProcessingParameterVectorLayer,
QgsProcessingParameterString)

0 comments on commit 7bb1b7a

Please sign in to comment.
You can’t perform that action at this time.