“Underlying each vector layer in QGIS is a flat table - the columns of which can be removed or added.”
Behind every vector layer in QGIS you will find a data table (attribute table). The data in this table describe the attributes of each feature. Depending on the origin of this data, the table can be a relational database table or view, a file-based table (e.g. .dbf or .csv), or remote data (e.g. a WFS layer). When QGIS has the needed permissions to edit the actual structure of that table, you can use its field management functions to do so.
In this exercise, we will take a look at how.
Goal: To add and remove columns from a layer's data table
Check your results
Scroll across to the right of the table - do you see your newly added column?
Name | Expectation |
---|---|
Countries layer |
ne_10m_admin_0_countries in the exercise data |
Fields to delete |
name_alt, name_local |
Field to add |
|
|
visited |
|
Have I visited this country |
|
text |
|
3 |
Type | Notes |
---|---|
Whole number (integer and 64-bit integer) | Use 64 bit when you need to store large whole numbers |
Decimal | Use when storing floating-point numbers |
Text | Use for free-form text - be sure to choose an appropriate length |
Date | Use for storing dates (without time) |
Time | Use for storing times (without dates) |
Date & time | Use when you need to store both data and time |
After removing a column and saving your edits, you can press undo to get it back again:
Indicate which statements are correct:
Is it possible to organize the order for the columns you have created:
In the attribute table you can create columns using the New Field tool or Field calculator. What are the key differences betwen the two methods: