Beispiel #1
0
def processCommand(alg):
    # Remove output
    output = alg.getOutputFromName('output')
    alg.removeOutputFromName('output')

    # Create output parameter
    param = getParameterFromString("ParameterString|output|output basename|None|False|False")
    param.value = alg.getTempFilename()
    alg.addParameter(param)

    # Regroup rasters
    regroupRasters(alg, 'input', 'group', 'subgroup', {'signature': 'sig'})

    # re-add output
    alg.addOutput(output)
Beispiel #2
0
def processCommand(alg):
    # Remove output
    output = alg.getOutputFromName('output')
    alg.removeOutputFromName('output')

    # Create output parameter
    param = getParameterFromString("ParameterString|output|output basename|None|False|False")
    param.value = alg.getTempFilename()
    alg.addParameter(param)

    # Regroup rasters
    regroupRasters(alg, 'input', 'group', 'subgroup', {'signature': 'sig'})

    # re-add output
    alg.addOutput(output)
Beispiel #3
0
def processCommand(alg):
    # Transform output files in string parameter
    signatureFile = alg.getOutputFromName('signaturefile')
    origSigFile = signatureFile.value
    shortSigFile = path.basename(origSigFile)
    alg.setOutputValue('signaturefile', shortSigFile)

    signatureFile = file2Output(alg, 'signaturefile')

    # Regroup rasters
    group, subgroup = regroupRasters(alg, 'input', 'group', 'subgroup')

    # Re-add signature files
    alg.addOutput(signatureFile)

    # Find Grass directory
    interSig = path.join(Grass7Utils.grassMapsetFolder(), 'PERMANENT', 'group', group, 'subgroup', subgroup, 'sig', shortSigFile)
    moveFile(alg, interSig, origSigFile)
    alg.setOutputValue('signaturefile', origSigFile)
Beispiel #4
0
def processCommand(alg):
    # Transform output files in string parameter
    signatureFile = alg.getOutputFromName('signaturefile')
    origSigFile = signatureFile.value
    shortSigFile = path.basename(origSigFile)
    alg.setOutputValue('signaturefile', shortSigFile)

    signatureFile = file2Output(alg, 'signaturefile')

    # Regroup rasters
    group, subgroup = regroupRasters(alg, 'input', 'group', 'subgroup')

    # Re-add signature files
    alg.addOutput(signatureFile)

    # Find Grass directory
    interSig = path.join(Grass7Utils.grassMapsetFolder(), 'PERMANENT', 'group',
                         group, 'subgroup', subgroup, 'sig', shortSigFile)
    moveFile(alg, interSig, origSigFile)
    alg.setOutputValue('signaturefile', origSigFile)
Beispiel #5
0
def processCommand(alg):
    # Regroup rasters
    regroupRasters(alg, 'input', 'group', 'subgroup',
                   {'signaturefile': 'sigset'})
Beispiel #6
0
def processCommand(alg):
    # Regroup rasters
    regroupRasters(alg, 'input', 'group', 'subgroup', {'signaturefile': 'sig'})
Beispiel #7
0
def processCommand(alg):
    # Regroup rasters
    regroupRasters(alg, 'input', 'group')
Beispiel #8
0
def processCommand(alg):
    # Regroup rasters
    regroupRasters(alg, 'input', 'group')