January 2019
Beginner
164 pages
3h 15m
English
We can look at each layer by accessing some of the properties. To get the name of the layer, use the .name() function:
Airport_layer.name()
The output is as follows:
'airports'
To count the number of records in the layer, use the featureCount() function:
Airport_layer.featureCount()
The output is as follows:
76
To print the attributes for all these 76 layers, use a for loop:
airportFeatures = Airport_layer.getFeatures()for feature in airportFeatures: print (feature.attributes()
Remember to use the indentation. The result will look similar to this:

Read now
Unlock full access