[GIS] Reducing size of labels automatically to fit within polygons

labelingqgis

I want to make labels automatically smaller so they fit within the polygons. The biggest font-size is 12 and I want to decrease the font-size to be restricted to the boundary of the polygons.

There is a time consuming option using the field calculator by using the polygons area field. Is there another way like using a plugin or similar to reduce the font-size automatically?

enter image description here

Best Answer

  • You can make the font size constant in metres rather than points, so it will scale with the map. In Layer Styling, select Metres at Scale instead of Points.

  • You can also make the size in points (or metres) a function of polygon area, using an expression.

    The polygons below are 10000 square km on the outside, and smaller in the middle of the map. The expression for the size (metres at scale) was simple:

    $area/200000
    

    A more complex formula may be useful.

enter image description here

Zoomed in, it scales with the map:

enter image description here

You can base the font size on the area of the polygon.

Related Question