Graphics Reference
In-Depth Information
Chapter 7. Selecting and Editing Features
in a PyQGIS Application
When running the QGIS application, the user has a range of tools available to create and
manipulate geospatial features. For example, the Add Feature tool lets the user create a
new feature, while the Move Feature tool and the Node tool allow the user to move and
edit existing geospatial features. However, these tools are only available within QGIS it-
self—if you want to write an external application on top of the PyQGIS library, these built-
in tools aren't available, and you will have to implement these features yourself.
In this chapter, we will look at what is involved in adding functionality to a PyQGIS ap-
plication so that the user can select and edit geospatial features. In particular, we will exam-
ine:
• How to work with selections
• How the layer editing mode can be used to save or undo the changes the user has
made to a map layer
• How to create map tools that will allow the user to add and edit Point geometries
• How to let the user remove a geometry from a map layer
• How to implement custom map tools that allow the user to add LineString and
Polygon geometries to a map layer
• How to let the user edit a LineString or Polygon geometry
Search WWH ::




Custom Search