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)
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)
def processCommand(alg): # Regroup rasters regroupRasters(alg, 'input', 'group', 'subgroup', {'signaturefile': 'sigset'})
def processCommand(alg): # Regroup rasters regroupRasters(alg, 'input', 'group', 'subgroup', {'signaturefile': 'sig'})
def processCommand(alg): # Regroup rasters regroupRasters(alg, 'input', 'group')