Conditional field calculator
From AWF-Wiki
(Difference between revisions)
Line 1: | Line 1: | ||
− | We would like to use the European Urban Atlas as an information vector layer to extract reference data for an | + | 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 and merge some classes and simplifying the scheme to be usable as training data input for land cover classification. |
# Click {{button|text=Add vector layer}} [[Image:QGIS_2.0_addvect.png|20px]] and select file ''geodata/vector/Subset-Goe_DE021L1_GOTTINGEN_UA2012_UTM32N.shp''. | # Click {{button|text=Add vector layer}} [[Image:QGIS_2.0_addvect.png|20px]] and select file ''geodata/vector/Subset-Goe_DE021L1_GOTTINGEN_UA2012_UTM32N.shp''. | ||
# 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. |
+ | # Formulate 5 conditional operations creating a new column named '''C_ID''' as shown in the screenshot: | ||
+ | [[File:Qgis_field_conditional.png|400px]] | ||
[[category:Working with Vector Data]] | [[category:Working with Vector Data]] |
Revision as of 12:54, 26 November 2017
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 and merge some classes and simplifying the scheme to be usable as training data input for land cover classification.
- Click Add vector layer and select file geodata/vector/Subset-Goe_DE021L1_GOTTINGEN_UA2012_UTM32N.shp.
- In the processing toolbar, type Field calculator to browse for the 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 C_ID as Integer.
- Formulate 5 conditional operations creating a new column named C_ID as shown in the screenshot: