7

I'm building a map for a certain region with many cities to be displayed. Some of the smaller cities should only be displayed if they don't overlay bigger cities.

While the labels of the smaller cities disappear when overlapping with bigger cities, the symbols of the small cities (city-marker-symbol) stays there.

Is there a possibility to show symbols only when an associated label can be displayed?

At the moment I use a hack where I utilize a rectangular background on the label itself to mimic a city-marker-symbol, but therefore the advanced label placements options aren't available.

4
  • Can you identify the smaller cities in terms of symbology? i.e. do they have a different symbology than bigger cities?
    – Joseph
    Oct 5, 2016 at 10:37
  • If you use two separate layers and big and small cities and you want the small cities to dissapear when overlapped by the big cities, you could try changing the Control rendering order from the Layer Order Panel and make sure the layer with big cities is above the other layer.
    – Joseph
    Oct 5, 2016 at 12:59
  • Thank you Joseph. The problem stays also if only one layer with one type of cities and symbology is present. If there is not enough space to display a city-label, then label will not be displayed but the symbology stays. I uploaded a screenshot: imgur.com/a/uLQpw where you can see the city-marker-symbols is displayed but the associated labels are missing (see the marker displayed under the city "Friedrichshof".
    – 21cdb
    Oct 5, 2016 at 13:17
  • Not an answer to your good question, but cannot you use a filter for the small cities? Something like this: (within($geometry, buffer (collect($geometry,filter:="New"=1 ),0.01))=0) AND "New" =0 with "New" the criteria for your big cities, and replacing the 0.01 by a scale dependent expression?
    – Victor
    Dec 6, 2019 at 14:23

1 Answer 1

1

I would think this would need to be handled by porting your cities into separate feature layers. You can then create new group layers for however many 'size' classes you want. For example you would sort them into groups of 'large' 'medium' and 'small'.

From there you can then use different symbology for each of the separate cities, that way you can distinguish between the cities even when they're all displayed, but you can assign a separate scale range per size group.

This way you can assign separate labeling, symbology and scale range to your groups.

My area sounds more rural than yours so my visuals won't do this justice, but I've separated it to show some sort of visual. By assigning the scale range to the entire group you can ensure that the small cities only populate into the map when they are at a scale that won't interfere with labeling of the larger cities.

enter image description here

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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