Exemplo n.º 1
0
 def __init__(self, descriptionfile):
     GeoAlgorithm.__init__(self)
     self.descriptionFile = descriptionfile
     self.defineCharacteristicsFromFile()
     self.numExportedLayers = 0
     #GRASS console output, needed to do postprocessing in case GRASS dumps results to the console
     self.consoleOutput = []
Exemplo n.º 2
0
 def __init__(self, descriptionfile):
     GeoAlgorithm.__init__(self)
     self.hardcodedStrings = []
     self.allowUnmatchingGridExtents = False
     self.descriptionFile = descriptionfile
     self.defineCharacteristicsFromFile()
     self._icon = None
Exemplo n.º 3
0
 def __init__(self, descriptionfile):
     GeoAlgorithm.__init__(self)
     self.hardcodedStrings = []
     self.descriptionFile = descriptionfile
     self.defineCharacteristicsFromFile()
     self.numExportedLayers = 0
     self._icon = None
Exemplo n.º 4
0
 def __init__(self, descriptionfile):
     GeoAlgorithm.__init__(self)
     self.roiFile = None
     self.descriptionFile = descriptionfile
     self.defineCharacteristicsFromFile()
     self.numExportedLayers = 0
     self.hasROI = None;
Exemplo n.º 5
0
 def __init__(self, descriptionFile):
     self.descriptionFile = descriptionFile
     with open(self.descriptionFile) as f:
         self.description = json.load(f)
     GeoAlgorithm.__init__(self)
     self._group = ''
     self._name = ''
Exemplo n.º 6
0
    def __init__(self):
        self.slotOsmParser = SLOT("osmParser()")

        self.FILE = 'FILE'
        self.TABLE = 'TABLE'

        GeoAlgorithm.__init__(self)
Exemplo n.º 7
0
    def __init__(self):
        self.NAME_FILE = 'NAME'
        self.OUTPUT_INI = 'INI'

        self.__queries = {}
        self.__names = []

        GeoAlgorithm.__init__(self)
Exemplo n.º 8
0
 def __init__(self, descriptionFile, script=None):
     GeoAlgorithm.__init__(self)
     self.script = script
     self.descriptionFile = descriptionFile
     if script is not None:
         self.defineCharacteristicsFromScript()
     if descriptionFile is not None:
         self.defineCharacteristicsFromFile()
Exemplo n.º 9
0
 def __init__(self):
     self.FIELD_KEY = 'FIELD_KEY'
     self.FIELD_VALUE = 'FIELD_VALUE'
     self.FIELD_EXTENT = 'FIELD_EXTENT'
     self.FIELD_NOMINATIM = 'FIELD_NOMINATIM'
     self.FIELD_OSM_OBJECTS = 'FIELD_OSM_OBJECTS'
     self.FIELD_TIMEOUT = 'FIELD_TIMEOUT'
     self.OUTPUT_QUERY = 'OUTPUT_QUERY'
     GeoAlgorithm.__init__(self)
 def __init__(self):
     GeoAlgorithm.__init__(self)
     # holds the algorithm object, the mode (normal or batch) and instructions
     self._steps = list()
     self.name = ''
     self.group = ''
     self.descriptionFile = None
     self.parameters = [ParameterString("Info", "Workflow can not be run as a batch process. Please close this dialog and execute as a normal process.", "", False)]
     self.showInModeler = False
Exemplo n.º 11
0
 def __init__(self, descriptionfile):
     self.resample = True #True if it should resample
                          #in case several non-matching raster layers are used as input
     GeoAlgorithm.__init__(self)
     self.descriptionFile = descriptionfile
     self.defineCharacteristicsFromFile()
     if self.resample:
         #reconsider resampling policy now that we know the input parameters
         self.resample = self.setResamplingPolicy()
Exemplo n.º 12
0
    def __init__(self):
        self.INI_FILE_PATH = 'QUERY_FILE'
        self.LAYERS = ['multipolygons', 'multilinestrings', 'lines', 'points']
        self.WHITE_LIST = {}

        for layer in self.LAYERS:
            self.WHITE_LIST[layer] = 'WHITE_LIST_' + layer

        GeoAlgorithm.__init__(self)
Exemplo n.º 13
0
 def __init__(self, descriptionFile, script=None):
     '''The script parameter can be used to directly pass the code of the script without a file.
     This is to be used from the script edition dialog, but should not be used in other cases'''
     GeoAlgorithm.__init__(self)
     self.script = script
     self.descriptionFile = descriptionFile
     if script is not None:
         self.defineCharacteristicsFromScript()
     if descriptionFile is not None:
         self.defineCharacteristicsFromFile()
Exemplo n.º 14
0
    def __init__(self):
        self.name = self.tr('Model', 'ModelerAlgorithm')
        # The dialog where this model is being edited
        self.modelerdialog = None
        self.descriptionFile = None
        self.helpContent = {}

        # Geoalgorithms in this model. A dict of Algorithm objects, with names as keys
        self.algs = {}

        # Input parameters. A dict of Input objects, with names as keys
        self.inputs = {}
        GeoAlgorithm.__init__(self)
Exemplo n.º 15
0
    def __init__(self, descriptionfile):
        GeoAlgorithm.__init__(self)
        self.hardcodedStrings = []
        self.descriptionFile = descriptionfile
        self.defineCharacteristicsFromFile()
        self.numExportedLayers = 0
        self.uniqueSufix = unicode(uuid.uuid4()).replace('-', '')

        # Use the ext mechanism
        name = self.commandLineName().replace('.', '_')[len('grass7:'):]
        try:
            self.module = importlib.import_module('processing.algs.grass7.ext.' + name)
        except ImportError:
            self.module = None
Exemplo n.º 16
0
    def __init__(self, descriptionfile):
        GeoAlgorithm.__init__(self)
        self.hardcodedStrings = []
        self.descriptionFile = descriptionfile
        self.defineCharacteristicsFromFile()
        self.numExportedLayers = 0
        self._icon = None
        self.uniqueSufix = str(uuid.uuid4()).replace('-', '')

        # Use the ext mechanism
        name = self.commandLineName().replace('.', '_')[len('grass7:'):]
        try:
            self.module = importlib.import_module('processing.algs.grass7.ext.' + name)
        except ImportError:
            self.module = None
Exemplo n.º 17
0
    def __init__(self):
        self.slotOsmParser = SLOT("osmParser()")

        self.FILE = 'FILE'

        self.LAYERS = ['multipolygons', 'multilinestrings', 'lines', 'points']
        self.WHITE_LIST = {}
        self.OUTPUT_LAYERS = {}
        for layer in self.LAYERS:
            self.WHITE_LIST[layer] = 'WHITE_LIST_' + layer
            self.OUTPUT_LAYERS[layer] = layer + "_LAYER"

        self.progress = None

        GeoAlgorithm.__init__(self)
Exemplo n.º 18
0
    def __init__(self, descriptionFile, script=None):
        """The script parameter can be used to directly pass the code
        of the script without a file.

        This is to be used from the script edition dialog, but should
        not be used in other cases.
        """

        GeoAlgorithm.__init__(self)
        self.script = script
        self.descriptionFile = descriptionFile
        if script is not None:
            self.defineCharacteristicsFromScript()
        if descriptionFile is not None:
            self.defineCharacteristicsFromFile()
Exemplo n.º 19
0
    def __init__(self):
        self.slotOsmParser = SLOT("osmParser()")

        self.FILE = 'FILE'

        self.LAYERS = ['multipolygons', 'multilinestrings', 'lines', 'points']
        self.WHITE_LIST = {}
        self.OUTPUT_LAYERS = {}
        for layer in self.LAYERS:
            self.WHITE_LIST[layer] = 'WHITE_LIST_' + layer
            self.OUTPUT_LAYERS[layer] = layer + "_LAYER"

        self.progress = None

        GeoAlgorithm.__init__(self)
    def __init__(self,
                 compoundname,
                 compoundgroup,
                 thememap=False,
                 fractileplot=False,
                 depthplot=False,
                 scatterplot=False):
        self.compoundname = compoundname
        self.compoundgroup = compoundgroup

        self.thememap = thememap
        self.fractileplot = fractileplot
        self.depthplot = depthplot
        self.scatterplot = scatterplot

        GeoAlgorithm.__init__(self)
Exemplo n.º 21
0
    def __init__(self, descriptionFile, script=None):
        """The script parameter can be used to directly pass the code
        of the script without a file.

        This is to be used from the script edition dialog, but should
        not be used in other cases.
        """

        GeoAlgorithm.__init__(self)
        self._icon = QIcon(os.path.join(pluginPath, 'images', 'script.png'))

        self.script = script
        self.allowEdit = True
        self.noCRSWarning = False
        self.descriptionFile = descriptionFile
        if script is not None:
            self.defineCharacteristicsFromScript()
        if descriptionFile is not None:
            self.defineCharacteristicsFromFile()
Exemplo n.º 22
0
    def __init__(self, descriptionFile, script=None):
        """The script parameter can be used to directly pass the code
        of the script without a file.

        This is to be used from the script edition dialog, but should
        not be used in other cases.
        """

        GeoAlgorithm.__init__(self)
        self._icon = QgsApplication.getThemeIcon("/processingScript.svg")

        self.script = script
        self.allowEdit = True
        self.noCRSWarning = False
        self.descriptionFile = descriptionFile
        if script is not None:
            self.defineCharacteristicsFromScript()
        if descriptionFile is not None:
            self.defineCharacteristicsFromFile()
Exemplo n.º 23
0
    def __init__(self, descriptionFile, script=None):
        """The script parameter can be used to directly pass the code
        of the script without a file.

        This is to be used from the script edition dialog, but should
        not be used in other cases.
        """

        GeoAlgorithm.__init__(self)
        self._icon = QIcon(os.path.join(pluginPath, 'images', 'script.png'))

        self.script = script
        self.allowEdit = True
        self.noCRSWarning = False
        self.descriptionFile = descriptionFile
        if script is not None:
            self.defineCharacteristicsFromScript()
        if descriptionFile is not None:
            self.defineCharacteristicsFromFile()
Exemplo n.º 24
0
    def __init__(self, descriptionFile, script=None):
        """The script parameter can be used to directly pass the code
        of the script without a file.

        This is to be used from the script edition dialog, but should
        not be used in other cases.
        """

        GeoAlgorithm.__init__(self)
        self._icon = QgsApplication.getThemeIcon("/processingScript.svg")

        self.script = script
        self.allowEdit = True
        self.noCRSWarning = False
        self.descriptionFile = descriptionFile
        if script is not None:
            self.defineCharacteristicsFromScript()
        if descriptionFile is not None:
            self.defineCharacteristicsFromFile()
Exemplo n.º 25
0
    def __init__(self):
        self._name = self.tr('Model', 'ModelerAlgorithm')
        # The dialog where this model is being edited
        self.modelerdialog = None
        self.descriptionFile = None
        self.helpContent = {}
        self._group = ''

        # Geoalgorithms in this model. A dict of Algorithm objects, with names as keys
        self.algs = {}

        # Input parameters. A dict of Input objects, with names as keys
        self.inputs = {}
        GeoAlgorithm.__init__(self)

        classes = [
            ParameterRaster, ParameterVector, ParameterTable,
            ParameterTableField, ParameterBoolean, ParameterString,
            ParameterNumber
        ]
        self.parameters = []
        for c in classes:
            for inp in list(self.inputs.values()):
                if isinstance(inp.param, c):
                    self.parameters.append(inp.param)
        for inp in list(self.inputs.values()):
            if inp.param not in self.parameters:
                self.parameters.append(inp.param)
        self.parameters.sort(key=attrgetter("description"))

        self.outputs = []
        for alg in list(self.algs.values()):
            if alg.active:
                for out in alg.outputs:
                    modelOutput = copy.deepcopy(
                        alg.algorithm.getOutputFromName(out))
                    modelOutput.name = self.getSafeNameForOutput(
                        alg.modeler_name, out)
                    modelOutput.description = alg.outputs[out].description()
                    self.outputs.append(modelOutput)
        self.outputs.sort(key=attrgetter("description"))
Exemplo n.º 26
0
    def __init__(self, gpfAlgorithmProvider):

        self.name = self.tr('GpfModel', 'GpfModelerAlgorithm')

        # The dialog where this model is being edited
        self.modelerdialog = None
        self.descriptionFile = None
        self.helpContent = {}
        # Geoalgorithms in this model. A dict of Algorithm objects, with names as keys
        self.algs = {}
        #Input parameters. A dict of Input objects, with names as keys
        self.inputs = {}

        # NOTE:
        # This doesn't seem used so remove it later from BEAMParmetersPanel and S1TbxAlgorithm
        self.multipleRasterInput = False

        GeoAlgorithm.__init__(self)

        self.provider = gpfAlgorithmProvider
        self.programKey = GPFUtils.getKeyFromProviderName(
            self.provider.getName())
Exemplo n.º 27
0
    def __init__(self):
        GeoAlgorithm.__init__(self)

        # The dialog where this model is being edited
        self.modelerdialog = None
        self.descriptionFile = None

        # Geoalgorithms in this model
        self.algs = []

        # Parameters of Geoalgorithms in self.algs. Each entry is a
        # map with (paramname, paramvalue) values for algs[i].
        # paramvalues are instances of AlgorithmAndParameter.
        self.algParameters = []

        # Algorithms that each algorithm depends on. This is just a
        # list of dependencies not set by outputs and inputs but
        # explicitly entered instead, meaning that an algorithm must
        # 'wait' for another to finish. Each entry is a list with
        # algorithm indexes
        self.dependencies = []

        # Outputs of Geoalgorithms in self.algs. Each entry is a map
        # with (output, outputvalue) values for algs[i]. outputvalue
        # is the name of the output if final. None if is an
        # intermediate output
        self.algOutputs = []

        # Hardcoded parameter values entered by the user when defining
        # the model. Keys are value names.
        self.paramValues = {}

        # Position of items in canvas
        self.algPos = []
        self.paramPos = []
        self.outputPos = []  # same structure as algOutputs

        # Deactivated algorithms that should not be executed
        self.deactivated = []
Exemplo n.º 28
0
    def __init__(self):
        GeoAlgorithm.__init__(self)

        # The dialog where this model is being edited
        self.modelerdialog = None
        self.descriptionFile = None

        # Geoalgorithms in this model
        self.algs = []

        # Parameters of Geoalgorithms in self.algs. Each entry is a
        # map with (paramname, paramvalue) values for algs[i].
        # paramvalues are instances of AlgorithmAndParameter.
        self.algParameters = []

        # Algorithms that each algorithm depends on. This is just a
        # list of dependencies not set by outputs and inputs but
        # explicitly entered instead, meaning that an algorithm must
        # 'wait' for another to finish. Each entry is a list with
        # algorithm indexes
        self.dependencies = []

        # Outputs of Geoalgorithms in self.algs. Each entry is a map
        # with (output, outputvalue) values for algs[i]. outputvalue
        # is the name of the output if final. None if is an
        # intermediate output
        self.algOutputs = []

        # Hardcoded parameter values entered by the user when defining
        # the model. Keys are value names.
        self.paramValues = {}

        # Position of items in canvas
        self.algPos = []
        self.paramPos = []
        self.outputPos = []  # same structure as algOutputs

        # Deactivated algorithms that should not be executed
        self.deactivated = []
Exemplo n.º 29
0
    def __init__(self):
        self._name = self.tr('Model', 'ModelerAlgorithm')
        # The dialog where this model is being edited
        self.modelerdialog = None
        self.descriptionFile = None
        self.helpContent = {}
        self._group = ''

        # Geoalgorithms in this model. A dict of Algorithm objects, with names as keys
        self.algs = {}

        # Input parameters. A dict of Input objects, with names as keys
        self.inputs = {}
        GeoAlgorithm.__init__(self)

        classes = [ParameterRaster, ParameterVector, ParameterTable, ParameterTableField,
                   ParameterBoolean, ParameterString, ParameterNumber]
        self.parameters = []
        for c in classes:
            for inp in list(self.inputs.values()):
                if isinstance(inp.param, c):
                    self.parameters.append(inp.param)
        for inp in list(self.inputs.values()):
            if inp.param not in self.parameters:
                self.parameters.append(inp.param)
        self.parameters.sort(key=attrgetter("description"))

        self.outputs = []
        for alg in list(self.algs.values()):
            if alg.active:
                for out in alg.outputs:
                    modelOutput = copy.deepcopy(alg.algorithm.getOutputFromName(out))
                    modelOutput.name = self.getSafeNameForOutput(alg.modeler_name, out)
                    modelOutput.description = alg.outputs[out].description()
                    self.outputs.append(modelOutput)
        self.outputs.sort(key=attrgetter("description"))
Exemplo n.º 30
0
 def __init__(self, descriptionfile):
     GeoAlgorithm.__init__(self)
     self.hardcodedStrings = []
     self.allowUnmatchingGridExtents = False
     self.descriptionFile = descriptionfile
     self.defineCharacteristicsFromFile()
Exemplo n.º 31
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     # this algorithm is deprecated - use Centroids instead
     self.showInToolbox = False
Exemplo n.º 32
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     self.showInModeler = False
Exemplo n.º 33
0
 def __init__(self):
     self._translateUi()
     GeoAlgorithm.__init__(self)
Exemplo n.º 34
0
    def __init__(self):
        GeoAlgorithm.__init__(self)

        self.exportedLayers = {}
Exemplo n.º 35
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     self._icon = None
Exemplo n.º 36
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     # this algorithm is deprecated - use GridPolygon instead
     self.showInToolbox = False
Exemplo n.º 37
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     self.mapping = None
Exemplo n.º 38
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     # this algorithm is deprecated - use SplitWithLines instead
     self.showInToolbox = False
Exemplo n.º 39
0
 def __init__(self, descriptionFile):
     self.descriptionFile = descriptionFile
     with open(self.descriptionFile) as f:
         self.description = json.load(f)
     GeoAlgorithm.__init__(self)
Exemplo n.º 40
0
 def __init__(self):
     self.configParser = ConfigParser()
     self.configParser.read(os.path.dirname(__file__) + "/COLOR_SCHEMA.ini")
     self.availableColorSchemas = self.configParser.sections()
     GeoAlgorithm.__init__(self)
Exemplo n.º 41
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     # this algorithm is deprecated - use Centroids instead
     self.showInToolbox = False
Exemplo n.º 42
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     # this algorithm is deprecated - use SplitWithLines instead
     self.showInToolbox = False
Exemplo n.º 43
0
 def __init__(self):
     self.allowUnmatchingGridExtents = True
     self.hardcodedStrings = []
     GeoAlgorithm.__init__(self)
Exemplo n.º 44
0
 def __init__(self, process, bookmark=False):
     self.process = process
     self.bookmark = bookmark
     GeoAlgorithm.__init__(self)  #calls defineCharacteristics
Exemplo n.º 45
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
Exemplo n.º 46
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
Exemplo n.º 47
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     self.showInModeler = False
Exemplo n.º 48
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     # this algorithm is deprecated - use BasicStatistics instead
     self.showInToolbox = False
Exemplo n.º 49
0
    def __init__(self, tablename, groupname):
        self.tablename = tablename
        self.groupname = groupname

        GeoAlgorithm.__init__(self)
Exemplo n.º 50
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     self._icon = None
Exemplo n.º 51
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     # this algorithm is deprecated - use GridPolygon instead
     self.showInToolbox = False
Exemplo n.º 52
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     # this algorithm is deprecated - use BasicStatistics instead
     self.showInToolbox = False
Exemplo n.º 53
0
 def __init__(self, descriptionfile):
     GeoAlgorithm.__init__(self)
     self.descriptionFile = descriptionfile
     self.defineCharacteristicsFromFile()
     self.numExportedLayers = 0
Exemplo n.º 54
0
 def __init__(self, descriptionfile):
     GeoAlgorithm.__init__(self)
     self.descriptionFile = descriptionfile
     self.defineCharacteristicsFromFile()
     self._icon = None
Exemplo n.º 55
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     self.pluginDir = os.path.dirname(os.path.realpath(__file__))
     self._load_translations()
Exemplo n.º 56
0
 def __init__(self):
     GeoAlgorithm.__init__(self)
     self.mapping = None
    def __init__(self, compoundname, compoundgroup):
        self.compoundname = compoundname
        self.compoundgroup = compoundgroup

        GeoAlgorithm.__init__(self)