Skip to content

Commit

Permalink
Adds Editing vector layer attributes lesson
Browse files Browse the repository at this point in the history
  • Loading branch information
SrNetoChan committed Sep 13, 2017
1 parent 0d7fa69 commit 3e7353e
Show file tree
Hide file tree
Showing 50 changed files with 1,975 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
In a vector layer, each feature is made of a geometry and a set of
alphanumerical attributes. In QGIS, there are different ways of editing
those attributes. In this lesson, we show how to edit attributes using
the attribute table and the feature form.

Click **Next step** when you are ready to start.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The current project has a layer called *Buildings*. During the lesson,
we will edit some of its attributes. We will start by editing using the
attribute table, so, let's start by opening the layer's attribute table.

- In the Layers Panel, right-click the *Buildings* layer and
choose **Open Attribute Table**.

![open_attribute_table.png](open_attribute_table.png)

- Alternatively, having the *Buildings* layer active,
you can click the **Open Attribute Table** button in the **Attributes
toolbar**.

![open_attribute_table_button.png](open_attribute_table_button.png)

An **Attribute Table** window for the *Buildings* will open
listing all of the layer's 536 features attributes in a table.

![attribute_table_example.png](attribute_table_example.png)

Click **Next step** once you are done.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Before you can edit a layer, it must be in Edit mode. There are several
ways of changing a layer to edit mode, but, for our example, using the
button available in the Attribute table is more straightforward.

- In the Attribute table toolbar, click the **Toggle edit mode**.

![toggle_editing_mode.png](toggle_editing_mode.png)

Alternatively, you can use a similar button located in the *Digitizing
toolbar*, in QGIS's main window, or right-click the *Buildings* layer in
the *Layers Panel* and choose *Toggle Editing*.

![toggle_editing_alternatives.png](toggle_editing_alternatives.png)

Click **Next step** once you are done.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
In the map canvas, notice the residential building in the corner. It
matches the first row in the attribute table, which we will edit.

![building_before_editing](building_before_editing.png)

- Back in the attribute table, in the first row, click the cell in the
*DESCRIPTIO* column to start editing it.

![edit_description](edit_description.png)

- Type in `COMMERCIAL` and press **Enter**.

If you go back to the map canvas, you can confirm that the building
representation has changed.

![building_after_editing](building_after_editing.png)

Click **Next step** once you are done.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
A (sometimes) more convenient way of editing attributes is using the
feature form through the **Identify Features** tool, as it allows you to
choose which features to edit, directly in the map.

First, we need to make sure the **Identify Features** tool settings are
correct.

- If not visible yet, enable the **Identify Results** panel in **View >
Panels > Identify Results**

- In the bottom, make sure the mode is set to `Current layer` and that
the **Auto open form** is enabled.

![identify_settings](identify_settings.png)

Ith this settings, when you click on a single feature from the currently
active layer on the map canvas, the corresponding **Feature Attributes**
form opens.

Click **Next step** once you are done.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Since we set the identify features tool mode to *Current Layer*, we need
to have an active layer before we can use it. Since we want to edit a
feature in the *buildings* layer, we need to make sure it's active.

- In the **Layers Panel**, click the *Buildings* layer, so it becomes
the active layer.

![make_buildings_active.png](make_buildings_active.png)

Now, with *Buildings* as the active layer, we can enable the
*Identify Features* tool.

- In menus, go to **View > Identify Features**.

![enable_identify_tool_from_menus.png](enable_identify_tool_from_menus.png)

- Alternatively, you can click the **Identify Feature** button in the
**Attributes toolbar**.

![enable_identify_tool_from_toobar.png](enable_identify_tool_from_toobar.png)

Click **Next step** once you are done.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
- With *Building* as the active layer, and the identify tool active, click
on the building that we have edited earlier.

![identify_feature](identify_feature.png)

The *Feature Attributes* dialog opens showing the feature attribute's values.

![feature_form](feature_form.png)

- Change the *UPDATE_DAT* attribute to a more recent date. Click
**OK** to apply the changes and close the feature form.

![edit_in_feature_form](edit_in_feature_form.png)

Click **Next step** once you are done.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Until now all the changes we have done are saved only in memory. Once
you are satisfied with all the changes you have made (which may include
changes to the features attributes and/or geometries), you must save
them permanently in the data source.

- In the **Digitizing toolbar**, click the **Save Layer Edits** button.

![save_layer_editis_button](save_layer_editis_button.png)

- Alternatively, in the **Attribute table** toolbar, click the
**Save Edits** button.

![save_edits_button](save_edits_button.png)

**Note:** Using the **Save** or **Save as** buttons in the Project
toolbar, **WILL NOT SAVE CHANGES TO THE DATA**.

![warning_save_buttons](warning_save_buttons.png)

Click **Next step** once you are done.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
When you are done with editing the layer attributes (or geometries), you
should turn off editing for the layer.

- In the Attribute table toolbar, click the **Toggle edit mode**.

![toggle_editing_mode_off.png](toggle_editing_mode_off.png)

- Alternatively, you can use a similar button located in the *Digitizing
toolbar*, in QGIS's main window, or right-click the *Buildings* layer in the
*Layers Panel* and choose *Toggle Editing*.

![toggle_editing_alternatives_off.png](toggle_editing_alternatives_off.png)

**Note:** If you try to turn off editing before saving your changes, a
warning message will prevent you from losing any work by mistake. This
can also be used to revert any unsaved changes by clicking **Discard**.

![warning_save](warning_save.png)

This step ends the lesson, click **Finish Lesson**.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJCS["NAD83_North_Carolina_ftUS",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",36.16666666666666],PARAMETER["standard_parallel_2",34.33333333333334],PARAMETER["latitude_of_origin",33.75],PARAMETER["central_meridian",-79],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["Foot_US",0.30480060960121924]]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJCS["NAD83 / North Carolina (ftUS)",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",36.16666666666666],PARAMETER["standard_parallel_2",34.33333333333334],PARAMETER["latitude_of_origin",33.75],PARAMETER["central_meridian",-79],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foot",0.3048006096012192,AUTHORITY["EPSG","9003"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","2264"]]
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
UTF-8
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJCS["NAD83_North_Carolina_ftUS",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",36.16666666666666],PARAMETER["standard_parallel_2",34.33333333333334],PARAMETER["latitude_of_origin",33.75],PARAMETER["central_meridian",-79],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["Foot_US",0.30480060960121924]]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJCS["NAD83 / North Carolina (ftUS)",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",36.16666666666666],PARAMETER["standard_parallel_2",34.33333333333334],PARAMETER["latitude_of_origin",33.75],PARAMETER["central_meridian",-79],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foot",0.3048006096012192,AUTHORITY["EPSG","9003"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","2264"]]
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJCS["NAD83_North_Carolina_ftUS",GEOGCS["GCS_North_American_1983",DATUM["D_North_American_1983",SPHEROID["GRS_1980",6378137,298.257222101]],PRIMEM["Greenwich",0],UNIT["Degree",0.017453292519943295]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["standard_parallel_1",36.16666666666666],PARAMETER["standard_parallel_2",34.33333333333334],PARAMETER["latitude_of_origin",33.75],PARAMETER["central_meridian",-79],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["Foot_US",0.30480060960121924]]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
PROJCS["NAD83 / North Carolina (ftUS)",GEOGCS["NAD83",DATUM["North_American_Datum_1983",SPHEROID["GRS 1980",6378137,298.257222101,AUTHORITY["EPSG","7019"]],TOWGS84[0,0,0,0,0,0,0],AUTHORITY["EPSG","6269"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AUTHORITY["EPSG","4269"]],PROJECTION["Lambert_Conformal_Conic_2SP"],PARAMETER["standard_parallel_1",36.16666666666666],PARAMETER["standard_parallel_2",34.33333333333334],PARAMETER["latitude_of_origin",33.75],PARAMETER["central_meridian",-79],PARAMETER["false_easting",2000000],PARAMETER["false_northing",0],UNIT["US survey foot",0.3048006096012192,AUTHORITY["EPSG","9003"]],AXIS["X",EAST],AXIS["Y",NORTH],AUTHORITY["EPSG","2264"]]
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 10 additions & 0 deletions vector_layers_attributes/Editing_vector_layer_attributes/lesson.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
In a vector layer, each feature is made of a geometry and a set of
alphanumerical attributes. In QGIS, there are different ways of editing
those attributes. In this lesson, we show how to edit attributes using
the attribute table and the feature form.

**Estimated time:** 15 minutes

**Lesson by:** Alexandre Neto

![../_shared_images/boundless.png](../_shared_images/boundless.png)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
lesson:
en:
description: lesson.md
group: Vector layer attributes
name: 06. Editing vector layer attributes
steps:
- description: 01_introduction.md
name: Introduction
- description: 02_open_attribute_table.md
name: Open attribute table
- description: 03_turn_layer_into_editing_mode.md
name: Turn layer into editing mode
- description: 04_editing_the_attributes_in_the_attribute_table.md
name: Editing the attributes in the attribute table
- description: 05_changing_the_identify_tool_settings.md
name: Changing the identify tool settings
- description: 06_enable_identify_tool.md
name: Enable identify tool
- description: 07_editing_the_attributes_using_the_feature_form.md
name: Editing the attributes using the feature form
- description: 08_saving_changes_to_the_attributes.md
name: Saving changes to the attributes
- description: 09_turn_editing_mode_off.md
name: Turn editing mode off
nextLessons:
- group: Vector layer attributes
name: 07. Using the field calculator
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 3e7353e

Please sign in to comment.