Attribute Table#
Each vector layer consists of geometric features (points, lines or polygons) and an attribute table. The attribute table contains information on each feature in the layer. The information is stored in rows and columns in the attribute table. Each row in the table represents a feature, while columns store attributes of that feature. You can use the attribute table to search, sort, filter, edit and select data.
Now it’s your turn!
You can complement this chapter by doing the steps with a vector layer of your choice. When working with geodata, you will always have to understand the information stored in the datasets, both the geometries as well as the attribute data.
Opening the attribute table#
Having a look into the attribute table is essential to understand and get an overview of the data you are working with. After downloading and import a dataset into QGIS, you will most likely open the attribute table to understand the data and see what information is available. Understanding what kind of information is available is indispensable when working with GIS software.
You can open the attribute table in two ways.
Right click on a layer in the Layers panel and select
Open Attribute Table
Select a layer in the Layers panel and click on the attribute table symbol in the toolbar.
Note
If you have multiple layers, only the attribute table of the layer currently selected in the layer panel will open.
Buttons of the attribute table
Icon |
Description |
Purpose |
Shortcut |
---|---|---|---|
Toggle editing mode |
Enable editing functionalities |
|
|
Toggle multi-edit mode |
Update multiple fields of many features |
||
Save edits |
Save current modifications |
||
Reload the table |
|||
Add feature |
Add new geometry-less feature |
||
Delete selected features |
Remove selected features from the layer |
||
Cut selected features to clipboard |
|
||
Copy selected features to clipboard |
|
||
Paste features from clipboard |
Insert new features from copied ones |
|
|
Select features using an Expression |
|||
Select All |
Select all features in the layer |
|
|
Invert selection |
Invert the current selection in the layer |
|
|
Deselect all |
Deselect all features in the current layer |
|
|
Filter/Select features using form |
|
||
Move selected to top |
Move selected rows to the top of the table |
||
Pan map to the selected rows |
|
||
Zoom map to the selected rows |
|
||
New field |
Add a new field to the data source |
|
|
Delete field |
Remove a field from the data source |
||
Organize columns |
Show/hide fields from the attribute table |
||
Open field calculator |
Update field for many features in a row |
|
|
Conditional formatting |
Enable table formatting |
||
Dock attribute table |
Allows to dock or undock the attribute table |
||
Actions |
Lists the actions related to the layer |
Sort the attribute table#
You can sort data in the attribute table by clicking on a column header. Text data will be sorted alphabetically and numeric data will be sorted by value. To reverse the sort order, click the header again. A small arrow in the column header indicates whether it is sorted in ascending or descending order.
Zoom in on a specific feature via attribute table#
You can zoom in on a specific feature if you need to locate it geographically or you want to get a closer look:
Zoom: Right click on a feature –>
Zoom To Feature
Close your attribute table. The map canvas will now show the selected feature.
Video: Zoom in on a feature
Manually select features in the attribute table#
To interact with features in a layer you have to select these features. One way to select features is via the attribute table.
Select: Click on the lines of the features.
Multi Select: To select multiple features press
Ctrl
and selectfeatures
.Show only selected features: In the bottom left of the attribute table open the dropdown menu and select
Show selected features
. To show again all features click onShow all features
.Only show unselected features: Select features and click on
Video: Manually select features in the attribute table
Zoom to selected area#
Now that you know how to select features, you can zoom onto your area of
interest. To do so you can click on the symbol on the toolbar or right click
on the layer and select Zoom to Selection
.
Save only selected features as a new file#
After you have selected your data, you might want to proceed with only the
selection. You can save your selection as new layer. To do so right click on the
layer - Export
-> Save only selected features
Now, you can choose the format, layer name and CRS.
Tip
We recommend use GeoPackage (.gpkg) instead of shapefile (.shp) in most cases. If you are unsure which format is most appropriate, check out the geodata types page on the wiki.