Пример #1
0
    def processAlgorithm(self, progress):
        cliPath = '"' + os.path.join(pktoolsUtils.pktoolsPath(), self.cliName()) + '"'
        commands = [cliPath]

        input=self.getParameterValue(self.INPUT)
        if input != "":
            commands.append('-i')
            commands.append('"' + input + '"')

        filter=self.FILTER_OPTIONS[self.getParameterValue(self.FILTER)]
        if filter != "none":
            commands.append("-f")
            commands.append(filter)
        if self.getParameterValue(self.DIM) != 0:
            commands.append("-dim")
            commands.append(str(self.getParameterValue(self.DIM)))

        if self.TYPE[self.getParameterValue(self.RTYPE)] != "none":
            commands.append('-ot')
            commands.append(self.TYPE[self.getParameterValue(self.RTYPE)])
        output=self.getOutputValue(self.OUTPUT)
        if output != "":
            commands.append("-o")
            commands.append('"' + output + '"')

        extra = str(self.getParameterValue(self.EXTRA))
        if len(extra) > 0:
            commands.append(extra)

        pktoolsUtils.runpktools(commands, progress)
Пример #2
0
    def processAlgorithm(self, progress):
        cliPath = '"' + os.path.join(pktoolsUtils.pktoolsPath(),
                                     self.cliName()) + '"'
        commands = [cliPath]

        input = self.getParameterValue(self.INPUT)
        commands.append('-i')
        commands.append('"' + input + '"')

        sample = self.getParameterValue(self.SAMPLE)
        commands.append('-s')
        commands.append(sample)

        layer = self.getParameterValue(self.LAYERS)
        if layer != '':
            layerValues = layer.split(';')
            for layerValue in layerValues:
                commands.append('-ln')
                commands.append(layerValue)

        commands.append("-r")
        commands.append(self.RULE_OPTIONS[self.getParameterValue(self.RULE)])

        output = self.getOutputFromName(self.OUTPUT)
        outFile = output.value
        formatIdx = self.getParameterValue(self.FORMAT)
        outFormat = '"' + FORMATS[formatIdx] + '"'
        commands.append('-f')
        commands.append(outFormat)
        ext = EXTS[formatIdx]
        if not outFile.endswith(ext):
            outFile += ext
            output.value = outFile
        commands.append('-o')
        commands.append('"' + outFile + '"')

        buffer = self.getParameterValue(self.BUFFER)
        if buffer > 1:
            commands.append("-buf")
            commands.append(str(buffer))

        srcnodata = self.getParameterValue(self.SRCNODATA)
        if srcnodata != "none":
            srcnodataValues = srcnodata.split(';')
            for srcnodataValue in srcnodataValues:
                commands.append('-srcnodata')
                commands.append(srcnodataValue)
        bndnodata = self.getParameterValue(self.BNDNODATA)
        bndnodataValues = bndnodata.split(';')
        for bndnodataValue in bndnodataValues:
            commands.append('-bndnodata')
            commands.append(bndnodataValue)

        extra = str(self.getParameterValue(self.EXTRA))
        if len(extra) > 0:
            commands.append(extra)

        pktoolsUtils.runpktools(commands, progress)
Пример #3
0
    def processAlgorithm(self, progress):
        cliPath = '"' + os.path.join(pktoolsUtils.pktoolsPath(),
                                     self.cliName()) + '"'
        commands = [cliPath]
        #outputtable = self.getOutputFromName(self.TABLE)

        input = self.getParameterValue(self.INPUT)
        commands.append('-i')
        commands.append('"' + input + '"')

        reference = self.getParameterValue(self.REFERENCE)
        commands.append('-ref')
        commands.append(reference)

        layer = self.getParameterValue(self.LAYERS)
        if layer != '':
            layerValues = layer.split(';')
            for layerValue in layerValues:
                commands.append('-ln')
                commands.append(layerValue)

        commands.append('-lr')
        commands.append(self.getParameterValue(self.LABELREF))

        nodata = self.getParameterValue(self.NODATA)
        if nodata != "none":
            nodataValues = nodata.split(';')
            for nodataValue in nodataValues:
                commands.append('-nodata')
                commands.append(nodataValue)

        commands.append("-cm")
        commands.append("-cmf")
        commands.append(self.CMFORMAT_OPTIONS[self.getParameterValue(
            self.CMFORMAT)])
        commands.append("-cmo")
        commands.append(self.getOutputValue(self.CMOUTPUT))

        output = self.getOutputFromName(self.OUTPUT)
        outFile = output.value
        formatIdx = self.getParameterValue(self.FORMAT)
        outFormat = '"' + FORMATS[formatIdx] + '"'
        commands.append('-f')
        commands.append(outFormat)
        ext = EXTS[formatIdx]
        if not outFile.endswith(ext):
            outFile += ext
            output.value = outFile
        commands.append('-o')
        commands.append('"' + outFile + '"')
        commands.append('-lc')
        commands.append(self.getParameterValue(self.LABELCLASS))

        extra = str(self.getParameterValue(self.EXTRA))
        if len(extra) > 0:
            commands.append(extra)

        pktoolsUtils.runpktools(commands, progress)
Пример #4
0
    def processAlgorithm(self, progress):
        cliPath = '"' + os.path.join(pktoolsUtils.pktoolsPath(),
                                     self.cliName()) + '"'
        commands = [cliPath]

        input = self.getParameterValue(self.INPUT)
        commands.append('-i')
        commands.append('"' + input + '"')

        if self.TYPE[self.getParameterValue(self.RTYPE)] != "none":
            commands.append('-ot')
            commands.append(self.TYPE[self.getParameterValue(self.RTYPE)])

        output = self.getOutputValue(self.OUTPUT)
        commands.append("-o")
        commands.append('"' + output + '"')

        commands.append('-nodata')
        commands.append(str(self.getParameterValue(self.NODATA)))

        band = str(self.getParameterValue(self.BAND))
        if band != '':
            bandValues = band.split(';')
            for bandValue in bandValues:
                commands.append('-b')
                commands.append(bandValue)

        theclass = str(self.getParameterValue(self.CLASS))
        if theclass != '':
            classValues = theclass.split(';')
            for classValue in classValues:
                commands.append('-c')
                commands.append(classValue)
        reclass = str(self.getParameterValue(self.RECLASS))
        if reclass != '':
            reclassValues = reclass.split(';')
            for reclassValue in reclassValues:
                commands.append('-r')
                commands.append(reclassValue)

        mask = str(self.getParameterValue(self.MASK))
        if mask != "None":
            commands.append('-m')
            commands.append(mask)
            msknodata = str(self.getParameterValue(self.MSKNODATA))
            msknodataValues = msknodata.split(';')
            for msknodataValue in msknodataValues:
                commands.append('-msknodata')
                commands.append(msknodataValue)

        extra = str(self.getParameterValue(self.EXTRA))
        if len(extra) > 0:
            commands.append(extra)

        pktoolsUtils.runpktools(commands, progress)
Пример #5
0
    def processAlgorithm(self, progress):
        cliPath = '"' + os.path.join(pktoolsUtils.pktoolsPath(), self.cliName()) + '"'
        commands = [cliPath]

        input=self.getParameterValue(self.INPUT)
        commands.append('-i')
        commands.append('"' + input + '"')

        band=self.getParameterValue(self.BAND)
        bandValues = band.split(';')
        for bandValue in bandValues:
            commands.append('-band')
            commands.append(bandValue)
        min=self.getParameterValue(self.MIN)
        if min != "none":
            minValues = min.split(';')
            for minValue in minValues:
                commands.append('-min')
                commands.append(minValue)
        max=self.getParameterValue(self.MAX)
        if max != "none":
            maxValues = max.split(';')
            for maxValue in maxValues:
                commands.append('-max')
                commands.append(maxValue)
        commands.append("-p")
        commands.append(self.OPERATOR_OPTIONS[self.getParameterValue(self.OPERATOR)])
        data=self.getParameterValue(self.DATA)
        if data != "none":
            dataValues = data.split(';')
            for dataValue in dataValues:
                commands.append('-data')
                commands.append(dataValue)
        nodata=self.getParameterValue(self.NODATA)
        if nodata != "none":
            nodataValues = nodata.split(';')
            for nodataValue in nodataValues:
                commands.append('-nodata')
                commands.append(nodataValue)
        if self.TYPE[self.getParameterValue(self.RTYPE)] != "none":
            commands.append('-ot')
            commands.append(self.TYPE[self.getParameterValue(self.RTYPE)])
        output=self.getOutputValue(self.OUTPUT)
        if output != "":
            commands.append("-o")
            commands.append('"' + output + '"')

        data=self.getParameterValue(self.DATA)

        extra = str(self.getParameterValue(self.EXTRA))
        if len(extra) > 0:
            commands.append(extra)

        pktoolsUtils.runpktools(commands, progress)
Пример #6
0
    def processAlgorithm(self, progress):
        cliPath = '"' + os.path.join(pktoolsUtils.pktoolsPath(),
                                     self.cliName()) + '"'
        commands = [cliPath]

        input = self.getParameterValue(self.INPUT)
        inputFiles = input.split(';')
        for inputFile in inputFiles:
            commands.append('-i')
            commands.append('"' + inputFile + '"')

        if self.TYPE[self.getParameterValue(self.RTYPE)] != "none":
            commands.append('-ot')
            commands.append(self.TYPE[self.getParameterValue(self.RTYPE)])

        output = self.getOutputValue(self.OUTPUT)
        if output != "":
            commands.append("-o")
            commands.append('"' + output + '"')

        commands.append("-n")
        commands.append(self.ATTRIBUTE_OPTIONS[self.getParameterValue(
            self.ATTRIBUTE)])
        commands.append("-comp")
        commands.append(self.COMPOSITE_OPTIONS[self.getParameterValue(
            self.COMPOSITE)])
        commands.append("-fir")
        commands.append(self.FILTER_OPTIONS[self.getParameterValue(
            self.FILTER)])
        if self.getParameterValue(self.DX) != 0:
            commands.append("-dx")
            commands.append(str(self.getParameterValue(self.DX)))
        if self.getParameterValue(self.DY) != 0:
            commands.append("-dy")
            commands.append(str(self.getParameterValue(self.DY)))
        #projwin = str(self.getParameterValue(self.PROJWIN))
        # regionCoords = projwin.split(',')
        # commands.append('-ulx')
        # commands.append(regionCoords[0])
        # commands.append('-uly')
        # commands.append(regionCoords[3])
        # commands.append('-lrx')
        # commands.append(regionCoords[1])
        # commands.append('-lry')
        # commands.append(regionCoords[2])
        commands.append('-nodata')
        commands.append(str(self.getParameterValue(self.NODATA)))

        extra = str(self.getParameterValue(self.EXTRA))
        if len(extra) > 0:
            commands.append(extra)

        pktoolsUtils.runpktools(commands, progress)
Пример #7
0
    def processAlgorithm(self, progress):
        cliPath = '"' + os.path.join(pktoolsUtils.pktoolsPath(),
                                     self.cliName()) + '"'
        commands = [cliPath]

        input = self.getParameterValue(self.INPUT)
        if input != "":
            commands.append('-i')
            commands.append('"' + input + '"')

        commands.append('-t')
        training = self.getParameterValue(self.TRAINING)
        commands.append(training)

        layer = self.getParameterValue(self.LAYERS)
        if layer != '':
            layerValues = layer.split(';')
            for layerValue in layerValues:
                commands.append('-ln')
                commands.append(layerValue)

        commands.append('-label')
        commands.append(str(self.getParameterValue(self.LABEL)))
        # if self.getParameterValue(self.CV):
        #     commands.append("-cv 2")
        commands.append('-g')
        commands.append(str(self.getParameterValue(self.GAMMA)))
        commands.append('-cc')
        commands.append(str(self.getParameterValue(self.COST)))

        mask = str(self.getParameterValue(self.MASK))
        if mask != "":
            commands.append('-m')
            commands.append(mask)
            msknodata = str(self.getParameterValue(self.MSKNODATA))
            msknodataValues = msknodata.split(';')
            for msknodataValue in msknodataValues:
                commands.append('-msknodata')
                commands.append(msknodataValue)

        extra = str(self.getParameterValue(self.EXTRA))
        if len(extra) > 0:
            commands.append(extra)

        output = self.getOutputValue(self.OUTPUT)
        if output != "":
            commands.append('-o')
            commands.append('"' + output + '"')

        pktoolsUtils.runpktools(commands, progress)
Пример #8
0
    def processAlgorithm(self, progress):
        cliPath = '"' + os.path.join(pktoolsUtils.pktoolsPath(), self.cliName()) + '"'
        commands = [cliPath]

        input=self.getParameterValue(self.INPUT)
        commands.append('-i')
        commands.append('"' + input + '"')

        mask=self.getParameterValue(self.MASK)
        maskFiles = mask.split(';')
        for maskFile in maskFiles:
            commands.append('-m')
            commands.append(maskFile)

        commands.append(str(self.getParameterValue(self.MSKBAND)))
        mskband=self.getParameterValue(self.MSKBAND)
        mskbandValues = mskband.split(';')
        for mskbandValue in mskbandValues:
                commands.append('-mskband')
                commands.append(mskbandValue)
        commands.append(str(self.getParameterValue(self.MSKNODATA)))
        msknodata=self.getParameterValue(self.MSKNODATA)
        msknodataValues = msknodata.split(';')
        for msknodataValue in msknodataValues:
                commands.append('-msknodata')
                commands.append(msknodataValue)

        commands.append("-p")
        commands.append(self.OPERATOR_OPTIONS[self.getParameterValue(self.OPERATOR)])
        nodata=self.getParameterValue(self.NODATA)
        commands.append('-nodata')
        commands.append(nodata)
        if self.TYPE[self.getParameterValue(self.RTYPE)] != "none":
            commands.append('-ot')
            commands.append(self.TYPE[self.getParameterValue(self.RTYPE)])
        output=self.getOutputValue(self.OUTPUT)
        if output != "":
            commands.append("-o")
            commands.append('"' + output + '"')

        extra = str(self.getParameterValue(self.EXTRA))
        if len(extra) > 0:
            commands.append(extra)

        pktoolsUtils.runpktools(commands, progress)
Пример #9
0
    def processAlgorithm(self, progress):
        cliPath = '"' + os.path.join(pktoolsUtils.pktoolsPath(),
                                     self.cliName()) + '"'
        commands = [cliPath]

        input = self.getParameterValue(self.INPUT)
        if input != "":
            commands.append('-i')
            commands.append('"' + input + '"')

        method = self.METHOD_OPTIONS[self.getParameterValue(self.METHOD)]
        if method != "none":
            commands.append("-f")
            commands.append(method)
        commands.append("-pad")
        commands.append(self.PADDING_OPTIONS[self.getParameterValue(
            self.PADDING)])

        if self.TYPE[self.getParameterValue(self.RTYPE)] != "none":
            commands.append('-ot')
            commands.append(self.TYPE[self.getParameterValue(self.RTYPE)])
        output = self.getOutputValue(self.OUTPUT)
        if output != "":
            commands.append("-o")
            commands.append('"' + output + '"')

        if self.getParameterValue(self.DIM) != 0:
            commands.append("-dx")
            commands.append(str(self.getParameterValue(self.DIM)))
            commands.append("-dy")
            commands.append(str(self.getParameterValue(self.DIM)))
        nodata = self.getParameterValue(self.NODATA)
        if nodata != "none":
            nodataValues = nodata.split(';')
            for nodataValue in nodataValues:
                commands.append('-nodata')
                commands.append(nodataValue)
        extra = str(self.getParameterValue(self.EXTRA))
        if len(extra) > 0:
            commands.append(extra)

        pktoolsUtils.runpktools(commands, progress)
Пример #10
0
    def processAlgorithm(self, progress):
        cliPath = '"' + os.path.join(pktoolsUtils.pktoolsPath(),
                                     self.cliName()) + '"'
        commands = [cliPath]

        input = self.getParameterValue(self.INPUT)
        inputFiles = input.split(';')
        for inputFile in inputFiles:
            commands.append('-i')
            commands.append('"' + inputFile + '"')

        if self.TYPE[self.getParameterValue(self.RTYPE)] != "none":
            commands.append('-ot')
            commands.append(self.TYPE[self.getParameterValue(self.RTYPE)])
        output = self.getOutputValue(self.OUTPUT)
        if output != "":
            commands.append("-o")
            commands.append('"' + output + '"')
        if self.getParameterValue(self.DX) != 0:
            commands.append("-dx")
            commands.append(str(self.getParameterValue(self.DX)))
        if self.getParameterValue(self.DY) != 0:
            commands.append("-dy")
            commands.append(str(self.getParameterValue(self.DY)))
        if self.getParameterValue(self.EXTENT) != "":
            extent = self.getParameterValue(self.EXTENT)
            extentFiles = extent.split(';')
            for extentFile in extentFiles:
                commands.append('-e')
                commands.append('"' + extentFile + '"')
                if self.getParameterValue(self.CUT) == True:
                    commands.append('-cut')
        if self.getParameterValue(self.MASK) != "":
            commands.append('-m')
            commands.append(self.getParameterValue(self.MASK))
            commands.append('-mskband')
            commands.append(str(self.getParameterValue(self.MSKBAND)))
            commands.append('-msknodata')
            commands.append(str(self.getParameterValue(self.MSKNODATA)))
        projwin = str(self.getParameterValue(self.PROJWIN))
        if (str(projwin).find(',') > 0):
            regionCoords = projwin.split(',')
            commands.append('-ulx')
            commands.append(regionCoords[0])
            commands.append('-uly')
            commands.append(regionCoords[3])
            commands.append('-lrx')
            commands.append(regionCoords[1])
            commands.append('-lry')
            commands.append(regionCoords[2])

        nodata = self.getParameterValue(self.NODATA)
        if nodata != "none":
            nodataValues = nodata.split(';')
            for nodataValue in nodataValues:
                commands.append('-nodata')
                commands.append(nodataValue)
        band = self.getParameterValue(self.BAND)
        if band != '':
            bandValues = band.split(';')
            for bandValue in bandValues:
                commands.append('-b')
                commands.append(bandValue)
        commands.append("-r")
        commands.append(self.RESAMPLE_OPTIONS[self.getParameterValue(
            self.RESAMPLE)])

        extra = str(self.getParameterValue(self.EXTRA))
        if len(extra) > 0:
            commands.append(extra)

        pktoolsUtils.runpktools(commands, progress)
Пример #11
0
    def processAlgorithm(self, progress):
        cliPath = '"' + os.path.join(pktoolsUtils.pktoolsPath(),
                                     self.cliName()) + '"'
        commands = [cliPath]

        input = self.getParameterValue(self.INPUT)
        inputFiles = input.split(';')
        for inputFile in inputFiles:
            commands.append('-i')
            commands.append('"' + inputFile + '"')
        band = self.getParameterValue(self.BAND)
        if band != '':
            bandValues = band.split(';')
            for bandValue in bandValues:
                commands.append('-b')
                commands.append(bandValue)
        if self.TYPE[self.getParameterValue(self.RTYPE)] != "none":
            commands.append('-ot')
            commands.append(self.TYPE[self.getParameterValue(self.RTYPE)])
        output = self.getOutputValue(self.OUTPUT)
        if output != "":
            commands.append("-o")
            commands.append('"' + output + '"')
        commands.append("-cr")
        commands.append(self.CRULE_OPTIONS[self.getParameterValue(self.CRULE)])
        if self.getParameterValue(self.DX) != 0:
            commands.append("-dx")
            commands.append(str(self.getParameterValue(self.DX)))
        if self.getParameterValue(self.DY) != 0:
            commands.append("-dy")
            commands.append(str(self.getParameterValue(self.DY)))
        if self.getParameterValue(self.EXTENT) != "":
            extent = self.getParameterValue(self.EXTENT)
            extentFiles = extent.split(';')
            for extentFile in extentFiles:
                commands.append('-e')
                commands.append('"' + extentFile + '"')
                if self.getParameterValue(self.CUT) == True:
                    commands.append('-cut')
        if self.getParameterValue(self.MASK) != "":
            commands.append('-m')
            commands.append(self.getParameterValue(self.MASK))
            commands.append('-mskband')
            commands.append(str(self.getParameterValue(self.MSKBAND)))
            commands.append('-msknodata')
            commands.append(str(self.getParameterValue(self.MSKNODATA)))
        projwin = str(self.getParameterValue(self.PROJWIN))
        regionCoords = projwin.split(',')
        commands.append('-ulx')
        commands.append(regionCoords[0])
        commands.append('-uly')
        commands.append(regionCoords[3])
        commands.append('-lrx')
        commands.append(regionCoords[1])
        commands.append('-lry')
        commands.append(regionCoords[2])
        cb = self.getParameterValue(self.CB)
        cbValues = cb.split(';')
        for cbValue in cbValues:
            commands.append('-cb')
            commands.append(cbValue)
        srcnodata = self.getParameterValue(self.SRCNODATA)
        if srcnodata != "none":
            srcnodataValues = srcnodata.split(';')
            for srcnodataValue in srcnodataValues:
                commands.append('-srcnodata')
                commands.append(srcnodataValue)
        bndnodata = self.getParameterValue(self.BNDNODATA)
        bndnodataValues = bndnodata.split(';')
        for bndnodataValue in bndnodataValues:
            commands.append('-bndnodata')
            commands.append(bndnodataValue)
        commands.append('-dstnodata')
        commands.append(self.getParameterValue(self.DSTNODATA))

        minGUI = self.getParameterValue(self.MINGUI)
        if minGUI != "none":
            minValues = minGUI.split(';')
            for minValue in minValues:
                commands.append('-min')
                commands.append(minValue)
        maxGUI = self.getParameterValue(self.MAXGUI)
        if maxGUI != "none":
            maxValues = maxGUI.split(';')
            for maxValue in maxValues:
                commands.append('-max')
                commands.append(maxValue)
        commands.append("-r")
        commands.append(self.RESAMPLE_OPTIONS[self.getParameterValue(
            self.RESAMPLE)])
        extra = str(self.getParameterValue(self.EXTRA))
        if len(extra) > 0:
            commands.append(extra)

        pktoolsUtils.runpktools(commands, progress)