2

When I run the field calculator to update area, the resulting areas are too large. This happens whether I use QGIS 2.18 or QGIS 3.4.

The default CRS is set to: ESPG:27700, OSGB 1936 / British National Grid. However, somehow, the CRS has changed to ESPG:4325, WGS 84. When I change it back, the polygons do not appear on screen. If I recalculate $area, the amounts are '0.0000'.

Area default set as hectare, layer is a vector layer and all polygons are single part.

Example: using measuring tool gives area of 1 polygon at 7.441, but field calculator $area = 12.1819.

Any suggestions?

4
  • 1
    Please precise witch software you are using and if it's the CRS of the layer, of the project or both ? – J.R Nov 27 '19 at 13:03
  • I've just updated my post re: projection. I am usuing QGIS 2.18 (but have the same result with the most recent stable version, 3.4) – DS7 Nov 27 '19 at 13:14
  • 2
    Please specify what you mean by "default CRS is set to". Do you mean the project's CRS? Or did you set the layer CRS? What CRS is the shapefile in? Where does it disappear to? Have you enabled on the fly reprojection? – Erik Nov 27 '19 at 13:16
  • Have a look at this link: gis.stackexchange.com/questions/23355/… – GBG Nov 27 '19 at 15:39
4

There are many ways to get the area of a geometry. I leave here a summary.


The $area expression returns the ellipsoidal area (if there is a defined ellipsoid) in the units defined in the Project Properties, in the Measurements section of the General tab.

1


The Measure Area tool, takes the coordinates from the canvas, but if an ellipsoid is selected in the Project Properties, General, Measurement section, it converts the coordinates to that ellipsoid and calculates the ellipsoidal areas. You can change the units for the tool.

2


The area($geometry) expression, returns the planimetric area, calculated through the coordinates of the geometries in their layer CRS, with the units of their layer CRS.


With the Identify tool, you can get both, ellipsoidal (based on project ellipsoid) and planimetric (based on layer CRS) areas for a feature geometry.

3


You can set None / Planimetric in the Ellipsoid field of the Project Properties, General tab, Measurement section.
In that case, the $area function and the Measurement Area tool will return the planimetric area calculated from the canvas coordinates. The Identify tool will no return an ellipsoidal area.

Canvas coordinates are based on the Project CRS (Project Properties, CRS tab). If the project don't have a CRS defined, you will see in the canvas rendered the layers in their original coordinates (without on the fly reprojection).

In Settings menu, Options, CRS tab you can define a defaul CRS for new projects, but you can change the project (canvas) CRS when you want trough the Project Properties, CRS tab.
Also, you can define a default CRS to assign to new layers when they have not a valid CRS already defined (I recommend you the Prompt CRS option, to find out when a layer without CRS is loaded).

The coordinates of a feature geometry in a layer, are defined in the layer CRS. Changing the layer CRS don't change the geometries coordinates. Reprojecting (or Exporting to a different CRS of) the layer change them.

4
  • Thanks very much, Gabriel. The first suggestion worked, with the correct measurements (although it doesn't work with hectares, only square metres). But now the layer is not visible on screen. When I 'pan to selection', the layer does appear, but none of the other layers (background maps) show. The same thing happens when I change from WGS84 to OSGB 1936 (the latter is the one I want to use, and the one I thought I'd selected!) I've got the data I need, but I would like to get this all to work for future projects. – DS7 Nov 28 '19 at 16:02
  • @DS7 You are welcome. You can set Hectares in the Units for area measurement configuration of the Project Properties. Also you can use the $area/10000 expression to convert square meters to hectares only in that field. – Gabriel De Luca Nov 28 '19 at 16:07
  • Setting hectares takes me back to the wrong calculations, but I have previously used the $area/10000 expression, so no problem there. Any idea why the layers disappear from the screen? – DS7 Nov 28 '19 at 16:09
  • Re my last question. I've opened the project in QGIS 3.4 and it seems to be working fine, allowing me to set both project and layer projections as the same CRS. Point taken about being more specific. – DS7 Nov 28 '19 at 16:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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