How to Calculate Polygon Area in the QGIS Field Calculator in Square Kilometers
- Primary Signal: How to Calculate Polygon Area in the QGIS Field Calculator in Square Kilometers
- Overview: Get accurate polygon areas in square kilometers with the QGIS field calculator: the right expression, the CRS trap to avoid, and how to save the result permanently....
- Verification: Analyzed and compiled by FreeSky GeoData editorial monitoring desk.
Calculating the area of polygons is bread-and-butter GIS work: parcel sizes, district coverage, forest loss, catchment extents. The QGIS field calculator makes it a one-expression job β but only if you understand the difference between the two area functions and the coordinate system trap that quietly produces wrong numbers.
QGIS offers $area and area($geometry). The dollar-sign version, $area, is ellipsoidal: it accounts for the earth's curvature using the project's ellipsoid setting, so it returns meaningful values even when your layer is in a geographic CRS like WGS84. The plain area($geometry) function is planimetric: it measures in the layer's own units, which are square degrees if your CRS is geographic β a meaningless number. For most area work, $area is the right choice.
Here is the step-by-step. Open the attribute table of your polygon layer, click the field calculator button (the abacus icon), and tick Create a new field. Name it area_sqkm, set the type to Decimal number with a sensible precision, and enter the expression $area / 1000000 β because $area returns square meters. Click OK and QGIS fills the new column for every feature.
Check the Project Properties first: under General, the Ellipsoid setting should match your data β WGS84 is the safe default for global datasets. If the ellipsoid is set to None/Planimetric while your layer is in degrees, even $area cannot save you. This single setting is the source of most 'my areas look wrong' complaints, so make it a habit to verify before calculating.
Remember that a field calculator result only lives in the layer if you save it. If the layer is editable, toggle editing off and save; if you used a temporary layer, export it with Save Features As. A virtual field is handy for display but vanishes with the project. Once your areas are safely stored, they combine naturally with proximity work β for instance, measuring the area inside a buffer zone around each site.
A few accuracy notes for the careful: multipart polygons report the total area of all parts, polygons with holes correctly subtract the hole area, and invalid geometries can produce nonsense β run Check Validity if numbers look absurd. For very large regions or legal-grade measurements, consider reprojecting to an equal-area projection first. And when you need the numbers in a shareable file, export the layer to a standard format so the area column travels with the geometry.