# Calculating polygon area in QGIS without adding new field

Is it possible in QGIS to quickly calculate the area of a polygon using a Processing tool, plugin, script without adding attributes or creating a new layer?

Something launching the results window or even a point and click feature?

The identify tool does offer you this information.

Click any feature, then expand the topmost dropdown menu. Here all basic geometric information is hidden, incl. the area and circumfence.

• This is the kind of solution I was looking for, definitely. Some of the answers below are more helpful, but this is what I had in my mind for a quick check. Nov 13 '21 at 11:36

Create a label with the expressin \$area (I should have used round(\$area)):

• Most obvious and easy option.
– Erik
Nov 12 '21 at 11:34

I personally find the identify tool sometimes too clunky. Here another approach:

To show the area for a polygon without using an additional field, you can just use a formula for a label with the \$area function, e.g.:

round(\$area/10000,1)

will give you the area of the features in hectares.

As you just want to see the area when pointing/clicking, you could add

CASE
WHEN  is_selected() THEN round(\$area/10000,1)
END

When you now use the select tool pointing on a polygon, it will show the area label.

In case your polygons already have a label based on some field(s), you can extend the formula with an ELSE statement to switch between normal view and selected view:

CASE
WHEN  is_selected() is FALSE THEN "id"
ELSE round(\$area/10000,1)
END

Please mind that I never have used this approach myself, I just came up with this idea while reading your question.

• I tried both methods and it worked perfectly, an elegant solution. Nov 13 '21 at 11:42

Also possible by means of PyQGIS.

def feature_area(selected, _, __):
n = len(selected)

if n == 1:
g = iface.activeLayer().selectedFeatures()[0].geometry()
print("The area of selected feature is " + '{:0,.2f}'.format(g.area()) + " m²")

elif n > 1:
print("Select only one feature")

iface.activeLayer().selectionChanged.connect(feature_area)

Inspiration was found in: Determining number of vertices of selected object in QGIS 3

Another option is using the "Display" through RMC > Properties > Display.

Paste the following expression format_number(\$area,2,'de') into the 'Display Name' and press Apply.

Note: I made it in very intuitive way, more sophisticated output can be achieved via the 'HTML Map Tip'.

After hover over the feature and get the output