Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

After playing around with the Model Builder and looking at the python scripts of what I make, I noticed some syntax which I can't find the definition anywhere. Here is a snippet of the python script from a model:

outputs_13=processing.runalg("qgis:fieldcalculator", outputs_12['SAVENAME'], ID, 1, 10, 0, True, $rownum , None)
outputs_14=processing.runalg("qgis:deletecolumn", outputs_13['OUTPUT_LAYER'], longitude, None)
outputs_15=processing.runalg("qgis:deletecolumn", outputs_14['SAVENAME'], latitude, savename_alg15)
outputs_16=processing.runalg("qgis:clip", outputs_15['SAVENAME'], vectorlayer_layer1, None)
outputs_17=processing.runalg("qgis:fieldcalculator", outputs_16['OUTPUT'], Score, 0, 10, 0, True, 2, output_layer_alg17)

Can someone please explain the purpose of ['SAVENAME'], ['OUTPUT'] and ['OUTPUT_LAYER']?

I am trying to develop a script but keep getting errors linked to these terms and I am unsure as to how they are used.

share|improve this question

1 Answer 1

Look at Using processing algorithms from the console

import processing 
processing.alghelp("qgis:fieldcalculator")
 ALGORITHM: Field calculator
  INPUT_LAYER <ParameterVector>
  FIELD_NAME <ParameterString>
  FIELD_TYPE <ParameterSelection>
  FIELD_LENGTH <ParameterNumber>
  FIELD_PRECISION <ParameterNumber>
  NEW_FIELD <ParameterBoolean>
  FORMULA <ParameterString>
  OUTPUT_LAYER <OutputVector>

      FIELD_TYPE(Field type)
     0 - Float
     1 - Integer
     2 - String
     3 - Date
processing.alghelp("qgis:deletecolumn")
ALGORITHM: Delete column
LAYERNAME <ParameterVector>
COLUMN <ParameterTableField from LAYERNAME>
SAVENAME <OutputVector>
...
share|improve this answer
    
Thanks gene, it's made a bit more sense. Just for clarification: ['SAVENAME'] is used if you want to temporarily save a layer (eg. saving the layer as 'None'); ['OUTPUT'] is used if you want to call a layer later; and ['OUTPUT_LAYER'] is used when you want the final result to be loaded in the interface? –  Joseph Jun 2 at 9:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.