Creating polygons

Finally, in this vector editing section, we will take a look at editing polygons. All the techniques we have learned for lines and points apply. Again, create a new layer in your GeoPackage, and this time call it Island_Outline. We are not going to be creating any fields, so accept the defaults shown in the following screenshot:

Creating a polygon Layer

Select the new layer in the Layers panel, click Toggle Editing and digitize the island. Don't worry about being too detailed. The result will be a digitized island. In QGIS, the new polygon layer will appear similar to the following screenshot:

Overview of editing inside QGIS

Now let's create a field called area and populate its actual area. To do this, we will use the Field Calculator tool in Attributes Toolbar. With Island_Outline selected, click on the Field Calculator button (the abacus icon). Enter the following values: Create a new field called area, set it as Whole number, and in the Expression box enter $area. This is shown in the following screenshot:

Field Calculator

Click on OK. This will turn on Toggle Editing, create a new field called area, and populate it with the area. If you have multiple features, all the areas will be calculated. Or, you can select the features you want to calculate the area for by using the selection tools. The Field Calculator tool is a flexible and very powerful tool. The resulting area is shown in the attribute table. When calculating area remember all units will be calculated in the units of the projection. If you wanted to check the area, you could use the measure tool shown in Chapter 2Loading Data, to verify this measurement. Untoggle the edit session and save the project.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset