March 2017
Intermediate to advanced
464 pages
8h 24m
English
This recipe measures the area of a polygon. Area calculation can be an end in itself to measure the size of a plot of land or a building. It can also be the input to other calculations such as land use maps.
For this recipe, we'll use a single-feature polygon shapefile, which you can download from the following link:
https://github.com/GeospatialPython/Learn/raw/master/Mississippi.zip
Unzip the shapefile and put it in a directory named qgis_data/ms within your root or home directory.
Perform the following steps to measure the area of a large polygon:
from qgis.core import QGis
lyr = QgsVectorLayer("/qgis_data/ms/mississippi.shp", ...Read now
Unlock full access