Conditional field calculator

From AWF-Wiki
(Difference between revisions)
Jump to: navigation, search
Line 3: Line 3:
 
# In the processing toolbar, type {{typed|text=Field calculator}} to browse for the {{mitem|text=QGIS --> Vector Table Tools --> Field calculator}} and open it.
 
# In the processing toolbar, type {{typed|text=Field calculator}} to browse for the {{mitem|text=QGIS --> Vector Table Tools --> Field calculator}} and open it.
 
# Define name and path of a new vector Output layer. Tick '''Create new field''', specify the Output field name {{typed|text=C_ID}} as '''Integer'''.
 
# Define name and path of a new vector Output layer. Tick '''Create new field''', specify the Output field name {{typed|text=C_ID}} as '''Integer'''.
# Formulate 5 conditional operations creating a new vector file adding a new column named '''C_ID''' as shown in the screenshot:
+
# Formulate 5 conditional operations creating a new vector file adding a new column named '''C_ID''':
 +
<pre>CASE </pre>
 
[[File:Qgis_field_conditional.png|500px]]
 
[[File:Qgis_field_conditional.png|500px]]
  

Revision as of 17:04, 16 December 2020

We would like to use the European Urban Atlas as an information vector layer to automatically extract reference data for an actual land cover classification. The original Urban Atlas classifcation scheme has 37 classes. We need to select or merge some classes simplifying the scheme to be usable as training data input for land cover classification.

  1. Click Add vector layer QGIS 2.0 addvect.png and select file geodata/vector/Subset-Goe_DE021L1_GOTTINGEN_UA2012_UTM32N.shp.
  2. In the processing toolbar, type Field calculator to browse for the QGIS --> Vector Table Tools --> Field calculator and open it.
  3. Define name and path of a new vector Output layer. Tick Create new field, specify the Output field name C_ID as Integer.
  4. Formulate 5 conditional operations creating a new vector file adding a new column named C_ID:
CASE 

Qgis field conditional.png

Personal tools
Namespaces

Variants
Actions
Navigation
Development
Toolbox
Print/export