I am exploring the new Label engine of QGIS 2.12.2 and I found it a great improvement. However, I discover it is not yet up to ArcGIS "standard" when dealing with multipart polygons. As a workaround (unless I am missing some hidden property), is there a way, through an expression to be passed to the label engine, to label only the largest feature (in terms of area or perimeter) of a multipart polygon?
I had the same problem - QGIS was placing labels on some of the multi-polygon features inside / over the smallest polygon, while I wanted it to be centered between the two.
- Vector > Geoprocessing Tools > Convex Hull
- Select the layer you are interested in labeling. You can select individual features, or all features.
- Select "Create convex hulls based on input field", and "Add result to canvas"
- Join the new layer with the convex hulls with your source layer
- Make the convex hull layer transparent
- Apply labels to the convex hull layer
Additionally, you can edit the nodes on the convex hull layer's features to manually control where the label appears.
Update: QGIS should have this as default behavior (see my second answer). But if for some reason you want to make sure or need some variation (perimeter, smallest area or something else) this is the way to go:
- Have a unique multipolygon ID column (MID)
- Convert multiparts to singleparts (Vector / Geometry Tools)
- Create area column
- Use Group Stats plugin to calculate the maximum area per MID (maxarea)
- Save the result as CSV
- Join the result to singleparts through MID (Layer Properties / Joins)
- Select in singleparts where area = maxarea
- Two options here as final step:
- Populate selection with new column (ShowLbl) with 1 and use it in Labels / Rendering / Show label
- Save singleparts selection as new layer and label only these features over original layer without showing the polygons
Unfortunately I can't imagine anything easier at this moment. QGIS labeling tools are becoming way more powerful in last years but there is still lot to achieve.