[Qgis-developer] Label polygons only outside of polygons

Nyall Dawson nyall.dawson at gmail.com
Mon Jul 20 03:46:31 PDT 2015


On 19 July 2015 at 23:14, Andreas Neumann <a.neumann at carto.net> wrote:
> Hi,
>
> I see that there are some recent new features regarding labelling:
>
> https://github.com/qgis/QGIS/commit/388e4047a75d155be0e677866f80d7423937ea30
> and
> https://github.com/qgis/QGIS/commit/3a44e294de08ee03c0386179693c61a3f76e5efe
>
> I have a question regarding Nyalls recent labelling improvements (the new
> options to act as obstacle layers).
> For a polygon layer, would it be possible to force the labels to always
> label outside of the feature? As an example I have a waste-water layer with
> small polygons representing special-form manholes (irregularly shaped).
> These polygons are usually too small to properly display the label inside
> the polygon and I would prefer to automatically place the label fully
> outside of the polygon.

Everything is possible, it's just a matter of how difficult it is ;)
It's a very valid use case though.

>
> So, can I have a layer act both, as a label layer and as an obstacle layer?
> Or have another option, something like "Force label to be outside of the
> polygon", to label always outside of the polygon of the feature?

I think a good solution would be adding an option to allow labels for
polygons within a certain distance of the feature, used in conjunction
with the new option to prevent labels which fall over the border of
the feature. I think this option would make most sense if it was
accompanied by the ability to draw leader lines to features. They
should probably be tackled together.

I'm almost finished with this current round of labelling work (it's
being done to facilitate a project I'm working on), but there's talk
of more labelling work being done later in the year. Maybe this could
be part of that.

Nyall


More information about the Qgis-developer mailing list