72

How do I calculate areas of an area shapefile in square meters or in acres (ha)?

I didn't find that functionality in the vector tools.

  • Follow up question: I have a layer in State Plane NAD83. When I use these commands it creates the area in feet. What if I want acres or square miles? Thanks – C_K Apr 17 '13 at 23:26
  • The two answers provided work but they are a bit slow to implement especially when one is trying to determine the area of many polygon vector files. Is there not a plug-in or some other way to get the area of a polygon simply by right clicking the polygon? The answers provided end up with a new field attribute (i.e. area) but the value doesn't update if the polygon is changed. So, in many cases there is no need to have the area displayed in a separate field attribute. If the area could just be shown as a number in a small chart, on the bottom of the page, etc it would be sufficient. So, is the – David Aug 16 '13 at 23:06
  • 2
    Using the identify tool, click on a polygon. Area is calculated and displayed under "Derived" in the identify window. You can change the units under settings. – csk Mar 31 '17 at 19:28
70

Make the layer editable, then use the field calculator (Layer>Open attribute table>Field Calculator/Ctrl+I or right click shapefile>Open attribute table>Field Calculator/Ctrl+I). There is an operator "$area" that will calculate the area of each row in the table. All units will be calculated in the units of the projection, so you probably want to project it to a projection that uses feet or metres before doing that, rather than lat/lon.

  • 6
    In current versions of QGIS if your data is in a Geographic CRS you can use the function transform() to project the geometries to a projected system (Preferably an equal area one) without the need to duplicate your data. In the Field calculator, something like this should work: area($geometry, 'EPSG:4326','EPSG:3763') – Alexandre Neto Feb 3 '16 at 23:11
  • 9
    @AlexandreNeto: Do you mean area(transform($geometry, 'EPSG:4326','EPSG:3763'))? – Stewart Macdonald Apr 20 '17 at 5:33
  • @smacdonald yes, my mistake. – Alexandre Neto Apr 20 '17 at 6:58
18

This can also be done with Vector|Geometry Tools|Add/export geometry columns, which creates a new shapefile with area and perimeter (or length) columns added.

Edit: (using the tool above, you can also unselect "save as new shape-file" in V1.8, the shapefile is now only updated!)

Using the field calculator is probably a better idea, though, as it doesn't require the creation of a new shapefile.

  • You can't change the attributes of the shapefile without enabling editing first, (calculating area counts as editing the attributes, you are adding a new column). Keep in mind that all units will be calculated in the units of the projection (meters bu default), so you to re-project it to a projected coordinate system first. – Hasan Mustafa Feb 4 '16 at 4:42
4

I wrote a script specifically for this. If you don't want to reproject your data, you can compute the area using ellipsoidal math.

Processing Toolbox -> Tools -> Get scripts from on-line scripts collection -> Ellipsoidal Area

You will find the script installed in Processing Toolbox -> Utils -> Ellipsoidal area

The tool should be self explanatory and will allow you to calculate area in units of your choice regardless of projection.

0

If the areas you are looking at are liable to change, such as looking at infrastructure layouts, catchment areas, study areas etc, I find it useful to simply label the areas, instead of adding them as attributes.

Label-> round($area/10000,2)||' ha'

This way you don't need to remember to update the catchment areas in the attribute tables as often.

protected by underdark May 6 '13 at 12:48

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.