Label Overlaps

When labels are too close together, the system will clip, that is, hide, some labels to prevent them from overlapping adjacent labels.  As we zoom in and out and pan the view, labels will be dynamically clipped as needed.   By default, labels are clipped only within the same labels layer.   We can change that so overlaps between labels in multiple layers in the same map can be resolved with clipping.  


There are two primary controls used to manage how labels are clipped:




If the overlap mode setting for a labels layer in the Layers pane is layer, the overlap spacing parameter for that layer guides the resolution of overlaps for just that layer.  If the overlap mode setting is map, the overlap spacing parameter will guide the resolution of overlaps in that layer as well as in any other labels layer in the map that also has an overlap mode setting of map.


Overlaps between labels in different layers using map overlap mode are resolved only for visible labels layers in a map.   If a labels layer has been turned off, the labels in that layer do not participate in any way in clipping of labels in other layers.


The example we use in this topic is a map that shows traditional regions of France along with a few cities that have been picked more or less at random as examples.



The map has two labels layers: a layer that provides the names of cities and a layer that provides the names of regions. A layer with darker brown diamond symbols shows the locations of the cities for which labels have been created.  The illustration above shows the default result for the zoom level used, where two cities labels, marked with magenta arrows in the illustration, have been clipped because they are too close to other labels.

Overlap Spacing

The Overlap spacing parameter controls how close labels can be to each other within the same layer before they become candidates for clipping.  The default distance is 1 point.  With the focus on the Cities Labels layer we can change that setting in the Style pane.


To change overlap spacing:


  1. With the focus on the desired layer, in the Style pane click the Total Style or Symbol button.
  2. Choose More... in the resulting menu.
  3. In the dialog click the Position tab.
  4. Change the Overlap spacing parameter as desired.
  5. Press OK.


In the Style pane, we can access the Position tab from dialogs launched by either the Total Style button or the Symbol button.



Click either onto the Total Style button or the Symbol button and choose More... in the resulting menu.



Click on the Total Style button and in the resulting menu choose More... to launch the Label Style dialog.  If desired, click on the Symbol button and choose More... to launch the Symbol dialog.



Click the Position tab to make it active.   Change the Overlap spacing parameter (marked with a magenta arrow in the illustration) as desired and then press OK.



The Overlap spacing value is a distance in points.   For example, we can change the value from the default of 1 to 0.  A value of 0 tells the system to clip only labels that actually overlap at the given zoom, and are not just close to each other.


Press OK.



The new setting of 0 points means that only those labels which actually overlap, and are not simply near each other, can be clipped.  Relaxing the overlap criteria in this way in the Ile de France region allows a label for the city of Melun to appear near Etampes, and in the Centre region allows a label to appear for the city of Vierzon, near Bourges.


If we would like a much sparser display, we can drill back down into the Label Style dialog to change the Overlap spacing parameter to 20 points.



The result is fewer labels at the same zoom level.   Note that the clipping when labels conflict is not predictable, so as we zoom in and out and the clipping algorithm chooses which labels to clip the results may not be to our liking.


For example, if we zoom out, we might see that with reasonably high priority labels like Paris are being clipped:



Future builds are expected to add prioritization based on a field or other factors.  In the meantime, we can control how labels get clipped by putting higher priority labels into different layers, and then using the overlap mode to control how labels are clipped between layers.  

Overlap Mode

The overlap spacing parameter assigns spacing between labels within a single layer.  The overlap mode controls how label overlaps are resolved across multiple layers in a map. With the focus on the map window we can change the overlap mode setting in the Layers pane.


To change overlap mode:


  1. With the focus on the map window, in the Layers pane click the Filter button in the Layers pane toolbar.
  2. Choose Show Overlap Mode in the resulting menu.  That will show the overlap mode for labels layers.
  3. Double-click the overlap mode cell for the labels layer to be changed.
  4. Choose either layer or map as desired.
  5. Choose map as the overlap mode for all layers between which layer overlaps are to be resolved.


In the Layers pane changing the overlap mode for any selected layer will change the overlap mode to that setting for all selected layers.  Ctrl-click layers to select them.   


Overlap mode status is shown in the Layers pane only for labels layers, with a choice of:





For labels layers which are set to map overlap mode, labels from lower layers in the map are given priority over labels from higher layers, that is, labels in higher layers will be clipped if they overlap with labels in lower layers.   When overlap mode is set for a map, labels will be clipped in displays using that map that are created for the map window, in layout frames that show that map, and during printing of layouts.



We start with the same example map used previously, with all label overlap settings at default values.   Note that the Cities label for Angers is positioned on top of the Regions label for Pays de la Loire.  There are also some Cities labels near Regions labels, such as the Blois label near Centre, and the Coulummiers label near Ile-de-France.



 To see the status of overlap resolution between layers, with the focus on the map window, in the Layers pane we press the Filter button and choose Show Overlap Mode.  



That replaces the default opacity listing for each layer with a report of overlap mode, either layer or map.  To change overlap mode for a layer, we can double-click into that layer and choose the desired mode.  To simultaneously change overlap mode for multiple layers, we first select the layers to be changed, and then change the overlap mode for any of them.  The overlap mode chosen will be applied to all selected layers.


For example, we can Ctrl-click both the Cities Labels layer as well as the Region Labels layer to select them, and then double-click the overlap mode cell for the Regions Labels layer, changing it to map.  That will change the setting for both selected layers to map.



Immediately, the Angers, Blois, and Coulummiers labels disappear, because those either directly overlap or fall within the 1 point overlap spacing distance that is used for both the Cities and Regions labels layers.


Note that clipping for label overlaps has no effect on drawing layers, such as the A Few Cities layer that shows the locations of cities using diamond shaped point symbols.



We can simplify the display a bit by double-clicking the A Few Cities layer tab to turn it off.   That gives us a clear view of the labels which appear.


We can arrange for a few more labels to appear by changing the Overlay spacing parameter for the labels layers.



With the focus on the Cities Labels layer, in the Style pane we change Overlay spacing from the default value of 1 to 0.   That allows a label for Melun to appear in the Ile-de-France region as well as for Vierzon in the Centre region, as marked with magenta arrows in the illustration.


Changing Overlay spacing in the Regions Labels layer from 1 to 0 has no visible effect.  All of the Regions labels are far from each other, and there are no Cities labels where a change from 1 point distance to zero points distance from a Regions label will cause the Cities label to appear.

No Overlap Clipping

Choosing none as the label overlap mode will render all labels, including those which overlap each other.



We zoom out a bit and turn off all layers except the Cities Labels and Regions layers to simplify the display.   



The illustration above uses the default, layer, setting for label overlaps, so labels which overlap are clipped to reduce conflicts.



We change the overlap mode for the Cities Labels layer from layer to none.



The map window immediately updates to render all labels.   Changing the overlap mode to none usually is best reserved for zoomed in views where not many labels are in the view.  

Prioritizing Label Layers

The example above uses a small number of Cities labels that are spaced relatively far from each other, so most will appear.   When many labels are in a layer, however, the random effect of how they are clipped when labels overlap can result in labels not appearing as a result of clipping which we would prefer to see, with "less important" labels being clipped instead.



We can see that by using a layer with many more labels. The All Cities layer seen above shows 2020 cities and towns as diamond symbols.  These are, all French populated places with populations above 5000 people.



The labels layer created from the All Cities drawing, is seen above with Overlap spacing set to 0 to maximize the number of labels shown.   There are many cases where labels overlap, with overlapping labels being clipped so that only one of the overlapping labels appears.   However, labels are clipped more or less at random, and that can result in what we might regard as "important" labels not appearing.  


For example, many labels overlap the label for Paris at the zoom level used in the illustration.  The winner of the clipping contest is Torcy, a town with approximately 22,000 people, and not Paris, with fifty times large population.


We can cause labels to appear in prioritized order by splitting up a single large layer into multiple layers based on population, and then arranging those layers in the vertical display stack in the order we want labels to be prioritized during overlap resolution.



We take the All Cities drawing and make three copies, called Cities 1, Cities 2, and Cities 3.  In each copy, we select only a certain category of cities and delete all others.  The data we are using comes from the US global names information system where cities have categories such as admin or minor or no rating in one of the attributes.  We can use those to split up the entire data set so that the Cities 1 drawing has only major administrative centers, such as the capitals of regions, Cities 2 has less important cities, and Cities 3 has all other cities down to a population of 5000.  We then create labels layers for each of those drawings.


The illustration above shows the Cities 1 Labels layer, which has only 13 cities in all of France.



The illustration above shows the Cities 2 Labels layer.  There are 304 cities in that layer, so in the display above some have no doubt been clipped because of overlaps as the zoom scale of the view.



The Cities 3 Labels layer has labels for 1732 cities, with many labels being clipped in the view above.



If we turn on all three of the Cities labels layers we get a mess as many labels overlap each other.   We will clean that up by assigning an Overlap mode of map to all three Cities labels layers as well as the Regions labels layer.



With the focus on the map window, in the Layers pane we select the layers of interest.  If the Layers pane is not set to show Overlap mode, we choose Show Overlap Mode in the Filter button menu.   We then double-click the layer overlap cell for any of the selected layers and choose map.   That sets the overlap mode to map for all of the selected layers.



Instantly, the display is cleaned up with labels in lower layers having priority in surviving any clipping done to handle label overlaps between layers.   That ensures that important city labels like Paris and Orleans will not get clipped by labels in less important layers.   The lower layer priority also ensures that none of the Regions labels will be clipped by Cities labels.



If we find the display too busy with all of the Cities 3 Labels visible, we can turn off that layer for a simplified presentation showing just administrative centers and labels taken from the 304 more important cities in France.   In the illustration above we have used a 10 point, Bold font for the  Cities 1 Labels layer and a 9 point, regular font for the Cities 2 Labels layer.



Another way to show many labels without overwhelming our audience is to use lighter colors or less opacity for less important layers.   The illustration above uses 8 point font for the Cities 3 Labels layer.   The Layers pane has been used to set 20% opacity for the Cities 3 Labels layer, 50% opacity for the Cities 2 Labels layer and 100% opacity for the Cities 1 Labels layer.


The result is a display that ensures capitals like Paris and Orleans will be visible while also retaining major cities like Chartres, Tours and Le Mans.   At the same time, it retains a sprinkling of small towns and cities, more of which automatically will become visible as we zoom into the view.




If it is not important to us to show Regions Labels without overlaps from other layers, we can change the overlap mode for that layer to layer, which will ensure that higher layers will not consider the contents of the Regions Labels layer when drawing their labels.   The effect is shown in the illustration above, where the opacity of the Regions Labels layer has also been reduced to 50%, to de-emphasize the labels in that layer.


We can see that labels from higher layers have now appeared since the Regions labels no longer prevent any overlapping labels from being drawn above them.   For example, labels for Blois and Romorantin have appeared near the Centre Regions label.  


Blois is the site of the famous royal chateau, regrettably overlooked by many tourists drawn to the chateaux of the Loire valley, while Romorantin is where, as legend has it, the great king François I planted vines imported from Burgundy to establish the rare Romorantin grape variety, which 100% comprises the distinctive and rarely-exported Cour-Cheverny white wine.  See the Labels topic for more on François I and Romorantin.   As luck would have it for wine drinkers, the illustration also includes Chinon, just to the West of tours, the home of Chinon red wine, an outstanding wine made almost exclusively of Cabernet Franc. Chinon is much less frequently exported than Bordeaux and Burgundy wines, with most production consumed within France.   

Overlap Spacing and Overlap Modes Interact

The simple way to explain how overlap spacing works is that it specified how close to each other two labels can be in the same layer without one of them being clipped.   A more precise way to describe how Overlap spacing works is to begin by noting that each label has its own overlap spacing  value.  Because the Style pane is used to set overlap spacing for an entire layer at a time, when we change the overlap spacing value in the Style pane we assign the new value to all labels in that layer.


If we have a Cities labels layer and we assign an overlap spacing value of 3, then each label in that layer will have an overlap spacing value of 3.  If the label for the city of Chartres is in that layer, the Chartres label will have an overlap spacing of 3.  Each label in that layer, such as the Chartres label, thinks that no other label in the layer can come closer than 3 points to it without an overlap conflict having to be resolved by one or the other label being clipped.


That each label has its own overlap spacing value also comes into play when there are multiple labels layers in the map that have map overlap mode set.   In that case, there can be multiple different labels from multiple different labels that are located at the same position or near the same position, perhaps with each such label having a different overlap spacing value.  


For example, suppose in addition to our Cities labels layer we also have a Towns labels layer with an overlap spacing value of 2 in that layer.  Each label in that Towns labels layer will have an overlap spacing of 2 as its spacing value.  If we have a Luisant label in that layer for the small, that label will have a spacing value of 2 and it will think that no other label can get within 2 points without an overlap conflict having to be resolved.


Suppose now we set map overlap mode for both the Cities and Towns labels layers.  When labels are drawn at any given zoom level, they will look around to see if any other labels are nearby from any other layer that has map overlap mode.  In the case of the Chartres and Luisant labels, which are populated places that are very close together,  the Luisant label will say that no other label can come closer than 2 points to it without causing an overlap issue.  However, the Chartres label based on its own spacing value will say that no other label can come closer than 3 points.  


The result is that at any zoom level where the Chartres and Luisant labels fall within 3 points of each other (the maximum of the spacing values for the labels involved) an overlap occurs and one of the two labels will have to be clipped.   If the Towns layer is above the Cities layer, Chartres will have a higher priority and Luisant will be clipped.


A clipping operation can have cascading effects beyond the original, pair wise clipping operation.   For example, if a label in a higher priority label clips a lower priority label that is has many characters in it, that may free up room for an even lower priority label to appear that otherwise would be clipped by the long label.


We can see the interaction between overlap spacing and overlap modes by looking at a display with only two (for simplicity) of our Cities layers turned on, Cities 3 Labels and Cities 2 Labels.



The illustration above shows both of the Cities labels layers using the default Overlay spacing of 1.  All labels in both of the layers have 1 as their spacing value.   The illustration also has an overlap mode of map assigned to the Regions Labels layer, so the Regions labels have maximum priority.



With the focus on the Cities 3 Labels layer, we change Overlay spacing to 0 in the Style pane.   There is no visible change, since many of the labels in the Cities 3 Labels layer have already been clipped by the higher priority labels in the Cities 2 Labels layer, seen in larger, darker font.



However, if with the focus on the Cities 2 Labels layer we change the Overlay spacing for labels in that layer to 0, then two labels appear in the Cities 3 Labels layer which previously were not seen.  Those are marked in the illustration above with magenta arrows.


Consider the Cities 3 label Jaunay-Clan that appeared next to the Parthenay label when we changed the Cities 2 Labels overlap spacing.  The Jaunay-Clan label did not appear when we changed the spacing for that label from 1 to 0 by changing the spacing in the Cities 2 layer.  Although the Jaunay-Clan was willing to appear only 0 points away from the Parthenay label, the Parthenay label was unwilling to allow any other label to get that close, since it still insisted no label could come closer to it than 1 point.  Since the Parthenay label is in a higher priority layer, it got its way and the Jaunay-Clan label was clipped.


However, once we changed the spacing for the Parthenay label to 0 points by changing the spacing for the Cities 3 Labels layer, then the Parthenay label was willing to allow other labels to get as close to it as 0 points.  That allowed the Jaunay-Clan label to appear.


Note that it does not matter what layer labels are in when it comes to comparing overlap spacing values to see if labels are willing to allow other labels to appear close to them.  What layer a label is in only matters when deciding which label survives an overlap conflict.

Zoom Level Affects Overlap Resolution

The closer we zoom into a view, the more space appears between labels.   As we zoom in and out, labels can appear and disappear as fewer or more overlap conflicts occur depending on the overlap spacing each label has.



For example, if we right-click and drag to zoom box into the region around Paris, we create a different display.



The zoomed-in view provides much more room between label locations, so more labels can appear without falling into the spacing zones of other labels and causing an overlap conflict.


The illustration above also shows how grouping labels into layers allows labels to be prioritized so labels appear with some reasonable connection to how important they are for the display we want to create.  The view automatically shows Paris as the most important label, and it shows many minor labels of interest, such as Coulummiers (home of a superb variant of Brie style cheese) while not allowing minor labels to clip regionally important labels like Argenteuil, Bobigny, Versailles, Palaiseau, Rambouillet, Meaux (what most people think of as "Brie" cheese) or, most important of all, Melun (the best Brie).



A million clicks - Rendering label layers with overlap mode set to none only stores click data for the first million labels. This avoids wasting large amounts of resources on data that is of very limited use.


Why are lower labels layers prioritized? - Lower labels layers are prioritized to win overlap conflicts when more than one layer has an overlap mode of map.   Lower labels are prioritized to provide a difference from the default behavior using an overlap mode of layer when the label styles are "solid" styles that use boxes or other design elements that hide lower labels.



Consider the display above, where the smaller font Cities 3 labels are in a layer above the larger font Cities 2 labels.   Both labels layers use layer overlap mode, so no overlap resolution occurs.  We start with this illustration to make it clear there are many situations where labels in the upper layer completely overlap labels in the lower layer.



Suppose the labels are styled using a box, so that a label that is higher in the display stack hides a label that is below it in the stack.   The effect is to "prioritize" labels in the higher layer, because those are seen while labels in the lower layer can be completely hidden.


In this example the upper layer uses smaller font, so the labels are slightly smaller and thus it is possible to see the outline of a box from a label in a lower layer, even if an upper layer is exactly above it.  But in the case of larger labels, especially multi-line labels, the upper label could completely hide lower labels and there would be visual cue that a lower label existed.


Suppose now we use the Layers pane to set an overlay mode of map for both labels layers.   If the rule was "higher layers have priority" there would be no visual change in such cases, because only the upper label would be displayed and the lower label would not be displayed.   Especially in cases where multiline or larger labels in upper labels completely hid labels in lower layers, there would be no visual change between an overlap mode of layer and an overlap mode of map for both layers.  



In contrast, when an overlay mode of map is applied both layers because the rule is "lower layers have priority" there is an immediate visual difference.  If we rely on overlap modes to ensure that more important labels will be visible, that rule ensures they will be visible, as seen above, even if they otherwise would be completely covered by less important, higher labels.


It's all about the Brie - Our original illustration, and many of those that followed, just happened to show three of the most famous places in the world of French cheese.



Meaux, Coulommiers, and Melun are three of the greatest forms of what may be France's most popular export cheese worldwide, Brie.  The region to the East and South of Paris is the home to numerous styles of producing Brie, but the two best known are Brie de Meaux and Brie de Melun.


Brie de Meaux cheese is the classic Brie cheese most people outside of France know.   Almost all supermarket brand "Brie" cheeses are variations on the Meaux style of making Brie: larger wheels with milder taste.  



Brie de Meaux cheese (attribution: Thesupermat, Wikimedia Commons / CC BY-SA 4.0)



Brie de Melun is made in smaller wheels using a slightly different process to produce a richer, stronger taste.  It is harder to find outside France but is worth the effort to find.   It is a very old cheese and may be the original "Brie" from which all other styles derived.




Brie de Melun cheese (attribution: Thesupermat, Wikimedia Commons / CC BY-SA 4.0)


Coulommiers is a Brie cheese that is made in smaller and thicker wheels in the commune of Coulommiers, with a taste profile similar to Brie de Melun but perhaps a touch sweeter with a note of almond.



Coulommiers cheese (attribution: Myrabella / Wikimedia Commons / CC BY-SA 3.0 & GFDL)



Camembert is a smaller and thicker wheel cheese made in Normandy that has a stronger flavor, often stronger than Brie de Melun.  It is a more rustic style cheese that is perfect for those occasions when you want something stronger than Brie de Melun.   Remember to age your Camembert just as with Brie.   The illustration below shows a cheese that to our minds could use some more aging.



Camembert cheese (attribution: Coyau / Wikimedia Commons / CC BY-SA 3.0)


The French eat Brie and Camembert on their own, perhaps on a slice of bread with many preferring to butter the bread as well.  Pull the cheese from the refrigerator at least a half hour before eating so it can warm up to room temperature. Chill the champagne, not the cheese.


Brie cheeses are often presented in a cheese plate course after the main meal but before desert.  You should have at least three varieties of cheese for a presentable cheese plate.   But there is nothing wrong with eating Brie on its own before the meal or as a snack.   When cutting white rind cheese, cut slices that are pie-piece shaped as in the illustrations above, so that everyone gets a slice that contains both the center of the wheel as well as the edge.  The flavor and texture are different from the middle of the wheel to the edge, with the center considered the best part.  It is bad form to eat only the center and to leave the edge for your dining companions.  


Eat the white rind.  It tastes great and not eating it, besides being gauche, is missing a big part of what such cheeses are about.


Cheeses like Brie and Camembert change texture when they age as the enzymes that the white mold rind releases migrate further into the interior and modify the cheese.  Young cheeses are harder and less creamy while older cheeses are softer, even liquefying slightly after three or so weeks in the refrigerator.  The illustrations of Brie de Melun show a perfectly aged cheese.   Check the date of production on the cheese you buy and keep it in the fridge until three weeks or so after the date of production.  As you gain more experience with cheeses from a given producer, adjust the aging time to suit your tastes.  


Reject any advice to pair Brie only with white wines.  Red wines that are fruity or lighter also go great with white rind cheeses like Brie, as do sparkling wines like Champagne or rose still wines.  Manifold highly recommends a fine Chinon.


High quality French supermarket brands of Brie and Camembert can be perfectly acceptable cheeses for everyday meals.  Just make sure to age them so they are creamy and soft.  You cannot beat a raw milk, artisanal Brie de Melun picked up from the market of your village in France, but when travelling abroad a decently aged French supermarket brand Brie, that is paired with a good wine will do in a pinch.  Any port in a storm!



5 Minute Tutorial - Label Overlap Modes - Label overlap modes make it easy to control how labels can overlap or not overlap even between different layers in maps. This short, fast video shows how, using Manifold Release 9 in Windows 11.  


See Also

File - Create - New Labels




Label Text


Style: Labels


Style: Label Placement


Style: Label Icon Placement


Layers Pane


Example: Add Labels to a Map - How to manually add labels to a map.


Example: Format the Size of City Points by Population - A common GIS task is to format the size of points in a drawing based on some value.  For example, the size of points that represent cities might be formatted based on the value of the city's population, with cities that have larger populations being marked by larger point icons.  This is an example of thematic formatting and is easy to do using the Style pane.


Example: Formatting Tricks - The visualization capabilities of Manifold using Style can be exploited to provide endless visual effects.   This topic provides some examples of how to use Style in unexpected ways to create a range of more elaborate effects.


Example: Style Overrides - Working with style overrides to individually style areas, to use or not use style overrides, to find all records using style overrides and to clear style overrides.