You can count polygons in a QGIS layer using the "Count Features" tool in the Processing Toolbox. This tool provides a simple way to determine the total number of polygons within a selected layer.
Here's how to use the tool:
- Open the Processing Toolbox: Go to Processing > Toolbox.
- Search for "Count Features": Type "Count Features" in the search bar.
- Select the Tool: Double-click on the "Count Features" tool.
- Choose the Layer: Select the polygon layer you want to count features in.
- Run the Tool: Click "Run".
The results will appear in the "Log Panel", showing the total number of polygons in the layer.
Alternatively, you can use the following methods:
- "Identify Features" tool: Click on a polygon in the layer, and the "Identify Results" panel will display the number of features selected.
- "Select by Attribute" tool: Select polygons based on specific attributes, and the "Attribute Table" will show the number of selected features.
- Python script: Use the "PyQGIS" console to write a script that iterates through the layer's features and counts the polygons.
These methods provide different ways to count polygons in QGIS, depending on your specific needs and workflow.