O'Reilly logo

Mastering QGIS by GISP Dr. John Van Hoesen, GISP Dr. Richard Smith Jr., GISP Kurt Menke, Dr. Luigi Pirelli

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Editing features

After being able to parse all the features, it's necessary to learn how to modify them to satisfy our processing needs. Features can be modified in two ways:

  • Using the data providers of the vector
  • Using the methods of QgsVectorLayer

The difference that exists between these two ways is the ability to interact with some editing features of the QGIS framework.

Updating canvas and symbology

We will now modify the Alaska shapefile in the following subsections. If we modify some geometry of the legend classification, it will be necessary to refresh the canvas and/or layer symbology. The canvas can be refreshed with the following command:

iface.mapCanvas().refresh()

The symbology of a modified QgsVectorLayer instance saved in the myVector

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required