calculate the area in % for each classes in a shp file using python
I have a .shp file with about 60 classes and would like to calculate the area of each class concerning the entire area.
Let’s say that there are two classes called “forest” and “roads” I would like to extract all the polygons that fall in the two previous classes automatically, calculate their corresponding area and then get the percentage area of each class for the entire area covered by all classes.
It would be great to do it with Python or QGIS