Labels

icon_labels.png Labels layers place text at desired locations in a map.    We can add labels to maps for cartographic explication and clarity, or simply to provide technical readouts of attributes for features such as the names of towns or the lengths of road segments.  Labels are created from drawings.   Labels can also be created from drawings which are, in turn, created from a query.

 

Labels are based on drawings and their associated tables.  Please read the Drawings and Tables topics before continuing.  The techniques used for editing labels are very similar to those used for editing drawings, so it is a good idea to read the Editing Drawings topic as well.

 

il_labels_cycle01_00.png

 

The illustration above shows two labels layers in a map, one called Regions Labels and the other called Cities Labels.    See the Style: Labels topic for details on formatting labels.

Creating Labels

Sometimes we would like to create a new, blank labels layer where we can create labels manually that are not bound to an existing drawing, where we can manually specify the text for each label:

 

To create a new, blank labels component:

 

  1. Choose File - Create - New Labels, or right-click onto a blank location in the Project pane and choose Create - New Labels.

  2. Specify a Name for the new labels component.

  3. The Based on box automatically will be loaded with <new drawing> to indicate a new drawing will be created.

  4. In the Text box, provide the name of the field to be created in the new drawing's table that will host the text of the label, if some name other than the default field name of 'Text' is desired.

  5. Change the coordinate system if some projection other than the default coordinate system is desired.

  6. Press Create Labels.  A new labels component will appear in the project, along with a new, blank drawing and new table.

 

By default, new labels components are created using the EPSG:3857 Pseudo-Mercator coordinate system, as used by almost all modern web mapping data sources.

 

Adding new labels to a new, blank labels layer:

 

  1. Drag and drop the new labels component into a map that provides some reasonable background context so labels may be created in the desired locations.

  2. From the drop-down menu for the mode button in the main toolbar, choose a label creation tool, such as Create Points.

  3. Click into the map to create the anchor for the label.   The Record panel will pop open.

  4. In the Record panel's Style tab, specify the text for the label.  Press Ctrl-Enter or Add Record to create the label.

  5. To change formatting from defaults, open the new labels component and then use Style to specify desired formatting.

  6. To enable individual formatting for each label, in the Contents - Style pane for the labels layer, click the New Field button to add a new field for hosting style override info and then check the Use style overrides box.   When style overrides are enabled, in addition to specifying the text for a label as it is being created we can also specify the individual style for that label such as colors, font and font size.

 

Most of the time we would like to create labels for an existing drawing, which automatically appear for objects in the drawing and which automatically take the text for the label from one of the drawing's fields:

 

Creating labels for an existing drawing:

 

  1. Right-click onto the existing drawing in the Project pane and choose Create - New Labels.

  2. In the New Labels dialog provide the Name desired for the new labels component.

  3. The Based on box automatically will be loaded with the name of the existing drawing.

  4. In the Text box, choose the field to use for the text of the label.

  5. Press Create Labels. A new labels component will appear in the project.

  6. Drag and drop the labels component as a layer into the same map as the drawing.

  7. To change formatting from defaults, click on the layers tab in the map and then use Style to specify desired formatting.

 

When a label component is created based on an existing drawing it will automatically inherit the projection used by that drawing.   If desired, the New Labels dialog allows us to specify a different coordinate system.

 

Positioning:  Labels will be positioned at the location of points, aligned to and slightly offset from lines and approximately in the center of areas.   Label positioning is dynamic: if we zoom into a drawing so that only part of an area is visible, the system will attempt to position the label for that area so it is visible.

 

Creating labels for a drawing based on a query:

 

  1. Right-click onto the existing drawing in the Project pane and choose Create - New Labels.

  2. In the New Labels dialog provide the Name desired for the new labels component.

  3. The Based on box automatically will be loaded with the name of the existing drawing.

  4. In the Text box, choose the field to use for the text of the label.

  5. Press Create Labels. A new labels component will appear in the project.

  6. Labels created from drawings based on queries will appear only when used as a layer in a map that contains at least one other layer.

  7. To update the labels after any changes in source table data, choose View - Refresh.

 

If the query text is changed, we must run the query at least once after changing the text, so that any future refreshes of the labels component will use the new query text.

Labels are Based on a Drawing

In the above procedures, the labels component is based on a drawing, getting the text to be displayed in the label from a field in the drawing's table.  When using an existing drawing the labels are created based on the points, lines or areas in that existing drawing, being created at the locations of those objects and taking their text from the specified field for each object.   If a new object is added to the drawing, then a new label for that drawing will be automatically created.

 

When labels are created in a new, blank labels component and not from an existing drawing, Manifold automatically creates a new, blank drawing and associated table to support the new labels layer.  We can then add the new, blank labels layer to our map.   As we click on locations in the map to create new labels and enter the text for that label, a new object is created in the drawing that supports the labels layer with the desired text added to that object's text field in the table.  

Layers in a Labels Window

Labels windows can contain layers just like a map.  See the discussion of layers in the Maps topic.  We can add images, drawings and labels as layers to a labels window, for temporary viewing.   A key difference between layers in a map and layers in a labels window is that hosting layers is the reason to have maps, while adding layers to a labels window is a temporary convenience to allow us to quickly see the labels component in the context of other layers.    In general, if we want to use layers we should use a map.  It is so easy to add layers to a labels window that it is easy to forget they are temporary.   To save work invested into a nice arrangement of layers added to a labels window, Manifold provides the Edit - Save as Map command.

 

A labels window always contains the originating labels component as a layer, and the labels window will always use whatever projection the labels component uses.   If we change the coordinate system of the labels component, the labels window will automatically use that different coordinate system as well.   If any other layer is added to a labels window, the labels window will re-project that layer on the fly into the coordinate system used by the labels component and the labels window.

 

To add a layer to a labels window:

 

  1. Open the labels window by double-clicking the labels component in the Project pane.  

  2. The labels component will appear as the only layer in the labels window.   The labels window will use the projection of the labels component.

  3. Drag and drop any additional desired layers from the Project pane into the labels window.

  4. The labels window will automatically re-project on the fly all layers into the coordinate system used by the labels component.

  5. Rearrange layers by dragging their tabs left or right, or by using the Layers panel.

  6. Layers in a labels window are temporary.   To save the layer arrangement, use Edit - Save as Map.

 

There are three key differences between layers in a map and layers in a labels window:

 

 

 

ico_nb_arrow_blue.pngLayers in labels windows are temporary:  when we add layers to a labels window and then arrange those layers in order, if we close the labels window and then open it again those layers will be gone.  To save the layer structure added to a labels window, choose Edit - Save as Map and save the window, together with the layers as specified, as a map.

 

Labels and Drawings

Labels components are always based on a drawing, which specifies the position of each label, with a field in the drawing's table providing the text for each label.

 

il_labels_from_table.png

The illustration above shows the drawing's table together with a labels layer in a map.   The same geom field that specifies where a point should be drawn in the drawing also specifies where the label for that object should be located.   The text field for the table provides text for labels, such as Montlucon for the selected record.   Selecting a record in the table selects the object for that record in the drawing (if it were open) and also selects the label associated with that record.   Likewise, selecting either the label or the object in the drawing would also select the associated record in the table.

 

The label component's Drawing property will specify the name of the parent drawing for that labels component.  The label component's FieldText property specifies the name of the field within that parent drawing's table to use for each label's text.    When we create a new labels component Manifold automatically rigs up that infrastructure so the label component's properties point to the desired drawing and field.   It is still nice to know how that works so if we want to use a different text field or a different drawing, we can just change that in the Properties for the labels component if we desire.

 

Each label that appears in labels layer is derived from one object in the drawing, that is, one record in the drawing's table.    The geometry field in that record specifies the location of the label, and, if the geometry defines a line or an area object, can by implication specify the orientation of the label as well.  Labels will be positioned at the location of points, aligned to and slightly offset from lines and approximately in the center of areas.  If we edit a drawing to move an object, the label created from that object automatically will also move.

 

The text that appears in the label will automatically be taken from the specified text field in the drawing's table.   If we edit the text contents of that field, the text that appears in labels will also automatically change.  

 

il_labels_cycle.png

In the diagram above we see the Cities Labels component with an orange arrow indicating the Properties dialog for Cities Labels.   We can see that Cities Labels is based on the Cities drawing and that it takes its text from the City field.    The Cities drawing contains point objects.   Each label appears at the location of a point in the Cities drawing, for example, the label for the city of Avord appears at the location of the point for that label.   The text for that label comes from the City field in the drawing's table, which is called Cities Table.  

 

il_labels_cycle_map.png

We can create a map that has the Cities drawing as a layer and Cities Labels as a layer.    That makes it easy to see how each label in Cities Labels appears at the location of the corresponding point in the Cities drawing.   

 

The location of the points in the Cities drawing automatically specifies the location of the associated label.   If we move a point in the Cities drawing the associated label in Cities Labels will also move.

il_labels_cycle01_01.png    il_labels_cycle01_02.png

For example, if using the techniques in Editing Drawings we move the point for the city of Avord in the Cities drawing, the associated label in Cities Labels will also move.  If we have both the drawing and the labels component open in their own windows at the same time, when we move either the point object or the label the corresponding label or point will also move.

il_labels_cycle01_03.png

In the map we can see how moving the point will move the label as well.

 

il_labels_cycle01_04.png

 

Likewise, changing the text in the City field in the Cities Table will automatically change the text used in the label.     Suppose we change Avord to Harry as seen above (just before we press Ctrl-Enter to commit the edit).

 

il_labels_cycle01_05.png  il_labels_cycle01_06.png

 

The text used in the labels will also change, automatically being updated in the Cities Labels window as well as in the map window where Cities Labels is a layer.

Labels can Appear in a Map without Their Drawing

When we create labels using an existing drawing we usually do so because we want to label objects, such as showing the names of cities, that are being displayed.  We most often will show both the labels layer as well as the drawing on which that labels layer is based together in a map.   But we do not have to do that if we do not want.  We can show only the labels layer and not the drawing on which it is based.

 

il_labels_no_drawing01_01.png  il_labels_no_drawing01_02.png

 

On the left above we see a map with a drawing of French regions. Another layer in the map shows a drawing of centroid points for the regions.   On the right above we have used the Centroids drawing to create labels positioned at the centroid of each region.   Since our objective is to label the regions and to not clutter the display with centroid points, we have removed the Centroids layer from the map, showing only the labels created from the centroids.   Labels can take their position and text even from drawings which do not participate in the map.  tech_angus_sm.png

 

Why use centroids?  Given that Manifold automatically tries to position labels for areas at the centroid of the area, why might we want to manually create centroids and then create labels from those centroids?   We can do that to force labels to always appear at the centroid.    When creating labels for areas, Manifold will dynamically position those labels so as many areas in view as possible are labeled.   If the entire area is in view Manifold will try to position the label at the centroid, if that centroid falls within the area.   If we zoom into the view so only part of an area is visible, Manifold will dynamically re-position the label to move it to the part of the area that is visible.   If we do not want such dynamic repositioning to happen, we can first create centroids for each area and then create labels from those centroids.  

 

il_labels_no_drawing01_03.png  il_labels_no_drawing01_04.png

 

At left above in the map we see a layer that shows all France as a single object (creating using the Transform panel's Union Areas template).  The labels created from centroids also appear, conveniently labeling different regions of France without the clutter of region outlines.   On the right we have added the Centroids drawing as a layer to illustrate how the labels take their position from the Centroids drawing upon which they are based.

 

Of course, in a cartographic composition like the illustration at above left we would not include the centroids.   But sometimes when creating such a composition it is convenient to show the drawing from which labels take their position, so we can change the position of labels by moving the objects that specify their position.  We can then remove or turn off the layer that shows those objects to reduce visual clutter for the final presentation.

 

il_labels_no_drawing01_05.png  il_labels_no_drawing01_06.png

For example, at left we have Alt-clicked the point that defines the Occitanie label (and then clicked the Coordinates tab in the Record panel that pops open) so we can drag the point to a new location, more to the northwest.    When we accept the edit, we see that both the centroid point and the label associated with it have moved to the new position.

il_labels_no_drawing01_07.png  il_labels_no_drawing01_08.png

Moving labels about by moving their objects is such a common task that Manifold allows a shortcut: instead of showing the drawing upon which the labels are based and moving objects around in that drawing, we can move the labels themselves and "behind the scenes" Manifold will automatically move their associated objects even though the drawing for those objects is unseen and not a part of the map.

 

At left above we have just the labels layer and the background layer of France.   We Alt-click onto the Occitanie label (and then click the Coordinates tab in the Record panel that pops open) just as we Alt-clicked onto the centroid point in the drawing.   Just as before, a big preview box handle appears that we can drag to a new location.

 

At right we see that when we accept the edit the label jumps to the new position.    It seems that we have just Alt-clicked a label and have dragged the label to a new position.  That is indeed the effect, but what has gone on behind the scenes is that when we dragged the label to a new position, Manifold was also moving the point that defines that label to the new position in the drawing.   It is just an illusion provided by the short cut convenience in the user interface that we drag the label.

 

All of the above effects are exploited when we create labels using their own drawing.   Recall that at the beginning of this topic we read two procedures to create labels, the first procedure to create labels for an existing drawing and the second procedure to create labels using their own drawing.    When we create labels using their own drawing, Manifold automatically creates a blank drawing and associated table for us that the labels can use behind the scenes.

 

We can drag and drop the new labels layer into a map and we can thereafter work with that labels layer as in the last two illustrations above, moving labels about, editing their text and so on, without ever opening up the drawing or table that powers those labels.   We can almost pretend that we are working with a "labels" layer that is its own independent thing without being based on a drawing.  That is certainly OK to do as a matter of convenience, but we should remember that every labels layer is based on a drawing somewhere, even if that drawing is normally used in just a support role behind the scenes.

Dynamic Label Positioning

When creating labels for areas, the system will try to position labels at or near the center of the area, but will also move labels about to attempt to resolve conflicts with other labels or to keep labels in view when only part of an area is in view.

 

il_labels_dynamic01_01.png

 

The illustration above shows the provinces of France as they were before the consolidation into a fewer number of provinces in 2016.    Most provinces show their labels at or near the center of the area representing the province, with four exceptions:

 

 

il_labels_dynamic01_02.png

 

Zooming further in we see how the label for Languedoc-Roussillon has moved to a more central position.   Labels for other provinces have moved from their central positions to the edges of the areas, so more of the areas can be labeled.

 

il_labels_dynamic01_03.png

 

Zoomed very far in, Manifold will attempt to keep as many labels visible as possible, moving labels for areas to the very edges of the areas.

 

Labels from Lines

The illustrations above show labels that are based on points.   Labels can also be based on lines or areas.  

 

il_labels_cycle01_07.png

 

We can add a line to the Cities drawing, as seen above.

 

il_labels_cycle01_08.png

 

In the table we add the text value Loire to the record that was automatically created when we added a line.   We know, of course, that the Loire is a river, not a city, but for the sake of this example we will add it to the Cities table anyway.

 

 

il_labels_cycle01_09.png    il_labels_cycle01_10.png

 

As soon as we enter a non-NULL text value for the City field for that object, Manifold automatically creates a label using that text.  It automatically appears as a label in Cities Labels and also in the Cities Labels layer in the map.     Manifold will automatically align to their parent line labels that are based on lines.

 

In most cases when we work with labels we will create labels from a drawing because we want to label objects in that drawing, such as cities.   Sometimes we might also want to create a labels component to manually enter labels at locations we choose.    Knowing how labels are based on drawings is useful even if we use just the labels and we do not include the drawing on which they are based in our maps.   That knowledge is useful because if we know how labels are based on objects in drawings, we can achieve finer control over the placement of labels by moving about the objects on which labels are based.

Example

The following example shows the process to create the Cities Labels layer used above with step by step illustrations.   In real life the procedure is so quick and easy an experienced Manifold user could do it in seconds, with just a few mouse clicks.

il_labels02_01.png

We start with a project that has a drawing called Cities which displays data from a table called Cities Table.   The drawing shows a selection of towns and cities in France.

 

il_labels02_02.png

 

Opening the map we see that the Cities drawing, the only layer in the map, shows points.   We have used Style to apply a yellow fill color.  The diamond shape used for the Point style is simply the square box point style with a Point rotation of 45 applied.

il_labels02_03.png

 

For less clutter in this example, we zoom into the map to show fewer points.

 

il_labels02_04.png

 

Opening the Cities table we see that each point represents a city in France, with the name of the city given by the City field.  A Geom field provides the geometry data to locate each point.

 

Creating Labels

il_labels02_05.png

 

In the Project pane, right click onto the Cities drawing and choose New Labels.

 

il_labels02_06.png

 

The New Labels dialog launches with the Cities drawing automatically loaded into the Based on box and a suggested default name of Cities Labels, which we will use.  The Text box is loaded with a pull-down menu of all fields in the drawing that contain data types from which labels can be constructed.  

 

il_labels02_07.png

 

We choose the City field, since that gives the name of each city.

 

il_labels02_08.png

Press the Create Labels button to create a new labels component.     Like many Manifold dialogs, there is also an Edit Query button which we could have used to command the system to automatically write the SQL that would be used to create that labels component and then open it in a Command Window.    That is a useful way of learning how to use SQL.

 

il_labels02_09.png

When we click the Create Labels button a new labels component appears in the Project pane.

 

il_labels02_10.png

 

We drag and drop the Cities Labels component into the map.   Labels appear using the default format.  With labels displayed we can see we have zoomed into the heart of France's famous valley of the Loire, home to numerous chateaux and Loire valley vineyards.   

 

Two of the Cities points, one for the city of Orleans just to the southeast of Châteaudun (spelled in this US-origin data set without a circumflex â accent over the a) , and the second for the town of Bourges just to the west of Avord, do not have labels.  Why not?   The labeling engine for Manifold by default has clipped those labels, that is, has hidden them, to prevent them from being too close or overlapping adjacent labels.  

 

il_labels02_10a.png

 

If we zoom into the region near Avord so there is more distance between labels we see that the label for Bourges automatically appears.

 

il_labels02_11.png

 

Clicking off the Cities layer allows us to better see the default text used.   For examples of different formatting that can be used to style labels, see the Style: Labels topic.

Offset Labels

The illustrations above show a limitation of current editions of Release 9, a limitation that will soon be eliminated: Labels appear directly on top of points without the ability to offset offsets automatically from their parent point.  Upcoming editions will allow specification of offsets so labels do not appear directly on top of their parent points.    Until that new feature arrives, we can use a manual process to generate offset labels.

 

Exploring the manual process is not a waste of time, because it teaches useful notions about copy and paste, the Transform panel, how it is easy to move objects about, and how we can use combinations of labels and objects in different layers to get a greater variety of visual effects.  

 

We will create offset labels by first making a copy of the Cities points layer, moving that layer a bit, creating labels from the moved layer, and then displaying those labels created from the moved layer together with the original Cities points layer.   Because the city points in the moved layer will be slightly offset from the original city points, the labels created from those moved points will also be slightly offset from the original city points, which is the effect we want.

Create a Copy of the Cities Layer

il_labels02_12.png

Ctrl-click the Cities drawing and the Cities Table table to highlight both.

 

il_labels02_13.png

Click the Copy button to copy them to the clipboard.   We could also do a Ctrl-C to copy using the usual Windows keyboard shortcut.

 

il_labels02_14.png

 

Next we click Paste to paste.  We could also have done a Ctrl-V to paste using the usual Windows keyboard shortcut.

 

il_labels02_15.png

 

The result is that a copies of the drawing and the drawing's table appear in the Project pane, using default naming.

 

il_labels02_16.png

 

We drag and drop the Cities 2 drawing into the map.  Until we change the color of the points, the drawing appears exactly as the Cities drawing using yellow diamond symbols.   We use Style to change the color to green: this step is not illustrated with only the results shown above.   Although both layers are turned on for display, we see only the green pints in the Cities 2 layer because they precisely overlap and cover the yellow Cities points in the layer below.

 

il_labels02_17.png

Clicking the Cities 2 layer tab to make sure it is the active layer, we click on the Contents pane tab and then in the Contents pane we choose the Transform panel.   The panel automatically targets the Geom field of the drawing.   We choose the Shift transform that is documented in the Transform Templates - Drawings topic, and then we enter values in the Shift X and Shift Y boxes to move the points in the Cities 2 drawing by those amounts in the X and Y directions.   

 

Since the coordinate system used by the drawing is the pseudo-Mercator default, the numeric values of 8000 and 12000 are in meters.  We are shifting the points in Cities 2 drawing by 8 km to the right (East) and 12 km up (North).

 

il_labels02_18.png

 

As soon as we change the values in the Transform panel, the panel shows the shifted positions of the points in blue preview color.    We tinker with the values, looking at the preview, until the offset is what we would like.   We then press Update Field to apply the changes.

 

il_labels02_19.png

 

We see that the points in the Cities 2 drawing have been shifted from their original positions.  Now, we will create labels from the Cities 2 points.

 

il_labels02_20.png

 

Right-click the Cities 2 drawing and choose New Labels.

 

il_labels02_21.png

 

In the New Labels dialog we choose City as the source field for label text and then we choose Create Labels.

 

il_labels02_22.png

 

We drag and drop the new Cities Labels 2 labels component into the map.  We then double-click off the Cities 2 layer to get the display above.  The labels are offset because they are being created using the offset Cities 2  labels.     That's great, but we still have a problem with the labels for Bourges and Avord colliding, as well as a problem with the Orleans label colliding with Châteaudun.   That is easy to fix.

 

We will move those two points in the Cities 2 points layer to locations further from the points with which their labels collide, so the labels created from them will also move.    There are two ways to move those points: we can alt-click on a point, choose the Coordinates tab to enable editing and then simply click and drag the point to a new location as discussed in the Editing Drawings topic.  Or, we can select the points and then use the Transform panel to move both at once using the Shift template.    We will use the Transform panel.

 

il_labels02_23.png

 

We click off the Cities Labels 2 layer to reduce clutter.  Next, we click on the Cities 2 layer to make it the active layer, and then we Ctrl-click on the Cities 2 points for Avord and Orleans to select those points.  The selected points are shown in red selection color.

 

il_labels02_24.png

 

Once again we choose the Shift template in the Transform panel, but this time we check the Restrict to selection box so that the dialog operates only on selected objects.   We enter -5000 into the Shift X box, to shift the point 5 km to the left (West) and we enter -25000 to shift the point 25 km down (South).

 

il_labels02_25.png

 

As before, the Transform panel instantly previews the results of the Shift template within the map in blue preview color, but this time since we have checked the Restrict to selection box only the points for Avord and Orleans will move in the preview.   We press the Update Field button to apply the previewed changes.

 

il_labels02_26.png

 

The result is that the selected points have been moved down and slightly to the left.   This will move the associated label away from an overlap conflict.

 

il_labels02_27.png

 

If we click off the Cities 2 layer and click on the Cities Labels 2 layer we can see the Avord and Orleans labels have moved away from positions where they conflicts with adjacent labels.

 

The method shown above has two obvious disadvantages:

 

 

Despite those disadvantages it is nonetheless a useful technique when using labels in a casual way within Manifold for illustrations.   

Additional Improvements

We can create a more appealing display by using the Style dialog to change the font and style of the labels as well as the points in the Cities layer, and we can use Contents - Layers to alter the color of the background from a too-glaring white to a calmer beige.     Given time and a willingness to experiment with Style we can use various formatting tricks to create a variety of appealing effects.  Not bad for a database tool.

 

Adding New Labels Individually

Creating labels as shown above in this topic automatically creates labels all at once for an entire drawing, automatically taking the text for the label from some designated field.   That is tremendously convenient, of course, but sometimes we would like to create labels individually, clicking at a spot in the map where we would like a label and entering the text for that label.

 

Creating any labels layer means using a drawing somewhere.   The position of a label is taken from an object in a drawing, such as a point, and the text of the label is taken from a field for that object in the drawing's table.   If we want to create labels at a few designated locations in a map, one way or another we will end up creating a drawing with objects where we want the labels to be and a labels component that automatically shows labels for those objects.

 

Creating a new labels layer with a drawing to serve it is such a frequent task that Manifold can do that automatically for us.  We create a new Labels component and choose <new drawing> in the New Labels dialog, and Manifold will automatically create a drawing with a text field in that drawing's table to use for the label's text.    The New Labels dialog thus creates three new components for us in the project: the drawing's table, the drawing, and a labels component that automatically takes the position and content of labels from the drawing and the drawing's table.     

 

All three components start out blank, with no records, objects or labels in them.  If we add an object to the drawing a label for that will be created automatically.  Manifold also allows us to add a label to the labels component and have an object created for that label automatically as well.

 

We can create labels individually in a casual way wherever we like using two different styles of workflow: by adding objects to the drawing at the desired positions and letting the labels layer automatically create labels for them, or by using the labels layer as the interface and having the system automatically create an object in the drawing at spots where we place a label.  The two different styles are just a matter of workflow to the same end,  whether we want to mark locations for labels using a drawing layer or whether we want to do so using a labels layer.

 

 

 

In both of the above two workflow styles we end up creating objects in a drawing from which labels are created.   Which of the two workflows we prefer depends on our taste and the specifics of our task.  For example, if we want to create individual labels at locations closely tied to existing objects we might prefer using the drawing as an interface.  If we casually create labels based purely on visual appearance we might prefer to use the labels layer as the interface.   Both ways work and the workflow from both ways can be mingled as one way or the other is more convenient.

Creating New Labels Components

We can create a new labels component using a new, blank drawing as follows:

 

We begin by right-clicking into a blank location in the Project pane and choosing New Labels.

 

il_labels02_28.png

 

Since we did not right-click onto an existing drawing, the New Labels dialog opens with a default name for a labels component to be Based on a <new drawing>.    We choose an existing drawing in the pull-down menu if we wanted, but we will keep the <new drawing> choice.   By default, the dialog will also create a new table for the new drawing with an nvarchar field (Unicode, variable length text field) called Text for the text to use in the labels.   We can change the coordinate system from the default if we like.  We will leave it as is.

 

il_labels02_29.png

We change the Name of the new labels component to be Notes and then we press the Create Labels button.

 

il_labels02_30.png

Three new components appear in the Project pane: a Notes Drawing, the drawing's table called Notes Table, and a Notes labels component.

 

il_labels02_31.png

Clicking open the table we see it is empty.

 

il_labels02_31a.png

 

Dragging and dropping the Notes Drawing and the Notes labels layers into the map, we see those (of course) are empty as well.  

 

We now have the infrastructure we want to add labels individually wherever we want in the map.   We will show the step-by-step procedure for both approaches, either using a drawing layer as the interface or using a labels layer as the interface.

Adding Individual Labels using a Drawing Layer as the Interface

We click on the Notes Drawing tab to make it the active layer.   Labels are created based on the type of object to which they are bound.  If we want to create labels for point locations we use a "create point" tool.

il_switch_cursor_mode02a.png

 

btn_create_point.png

In the main toolbar we chose the Create Point tool from the drop-down menu for the mode button, and then we  click on a location in the map, approximately between Le Mans and Tours,  to create a point where we want a label to appear.

 

il_labels02_32.png

 

A small blue square appears at the clicked location.  The blue preview color of the square indicates this is where the proposed point will go.

 

il_labels02_33.png

When we click to add a new point to a drawing using the Create Point tool the Contents pane automatically switches to the Record panel.  In the Values tab, we enter the text we want for the new label, "Beauce," the traditional name of that natural region in France, famous for agriculture, in the triangle between Le Mans, Tours and Orleans.   We press the Add Record button to create the point at that location with the attributes specified in the Values tab.

 

il_labels02_34.png

 

A point appears in the Notes Drawing at the location previewed, and a new label corresponding to that new point also appears, using the specified text,  in the Notes labels layer.   Using Style we have styled the label to use an all caps font, brown color and larger, 16 point, font size.

 

il_labels02_35.png

 

We add another label by adding another point to the controlling drawing.  With the Notes Drawing layer tab to make it the active layer and still using the Create Point tool,  we click into the Notes Drawing layer to add another point, to the west of Tours.   The proposed new point appears as a small square icon using blue preview color.

 

il_labels02_36.png

 

In the Record panel's Value tab, we add the text Loire to the Text cell for that point.  The Loire region is the valley of the Loire, famous for chateaux and fine wine.   We press the Add Record button to create the point.  

 

il_labels02_37.png

 

As we do, automatically the new point appears in the Notes Drawing layer, and a corresponding new label appears in the Notes labels layer.

 

il_labels02_38.png

 

We can click off the Notes Drawing layer to clean up the display.   We have added labels to our map showing the names of natural regions as locals might use.  

 

il_labels02_39.png

Opening the Notes Table, we can see we have added two records to the table, one for each point.  The records contain the geom value that specifies where the point is located, and the value of the text.      

 

In the workflow above we specified the text for each new label by entering the text into the Record - Values tab as we created the point.   We could have done it slightly differently, by first creating the points and then quickly entering the text into the table.    Manifold is happy to leave the table window open, and Manifold will dynamically update all windows as we change text in the table.  

 

A very quick way of creating several labels at different locations is to rapidly click, click, click to create those points and then to rapidly edit the text values in the table.   Using fast techniques shown in the Editing Tables topic we can edit one Text cell in a table, press the down arrow key to move to the next one down, edit that and so on very rapidly.  Manifold automatically updates the labels for us.

 

The above process is slightly different than that used in various GIS packages but it is just as easy.   Many GIS packages will allow adding a label at a clicked location and will pop open a dialog allowing the text for that label to be entered.   In the above case we clicked a point location and used the already-open Record panel to enter the desired text for the label.

 

Adding Individual Labels using a Labels Layer as the Interface

If we prefer to add individual labels using a process more similar to classic GIS, where we just add labels to a labels layer, we can do that in Manifold as well.    We will take the process from the very beginning, creating a new labels layer.

 

il_labels02_40.png

 

Right-click into an empty portion of the Project pane and choose New Labels.   Give the new layer a name of Wines and confirm it is based on a <new drawing>.  Press Create Labels.

 

il_labels02_41.png

 

A new ensemble of a table, a drawing and a labels component appears in the project.  

 

il_labels02_42.png

 

We drag and drop the Wines labels component into the map, as the uppermost layer.  To clean up the display we have right-clicked onto tabs for unused layers and have deleted them from the map.

 

il_labels02_43.png

 

With the focus on the Wines labels layer in the map, we click on the Style panel in the Contents pane.    We would like the labels we create to be visually different from other labels, so we take a moment to set the main color to a dark red color, we change the font to an italic, all-caps font, and we set the font size to 12 points.

 

il_switch_cursor_mode02a.png

 

With the focus still on the Wines labels layer in the map, we choose the Create Point tool from the drop-down menu for the mode button.

 

il_labels02_45.png

 

Back in the map, in the Wines layer we click a spot just to the east of Tours to mark the location where we would like to create a new label.   A blue preview color square appears to show the point location that will be used as the anchor point for the new label.

 

il_labels02_46a.png

 

The Record panel automatically appears in the Contents pane, open to the Values tab.   We Double-click into the Text value for the label.

 

il_labels02_46b.png

 

 We enter the text desired for the label.   We enter Vouvray, the name of a fine, white wine created near Tours, and then press Enter. 

 

il_labels02_46.png

 

We press Add Record to create the label.

 

il_labels02_47.png

 

A new label appears in the map at the location we clicked with the Create Point tool, using the Style properties such as color and font specified.   

 

What is going on behind the scenes is that we created a point in the associated drawing, and the label that has just appeared takes its geometry and text information from that point.   As a matter of convenient workflow, Manifold allows us to use the labels layer as the interface, with Manifold behind the scenes automatically creating the point object for the label in the drawing.

 

il_labels02_48.png

Since the Create Point tool is active until we click back onto the default cursor tool, we can click on another location where we would like to place a label.  We click at a location slightly to the northwest of the Loire label.

 

il_labels02_49.png

 

In the Record panel's Values tab, for the Text of the label we enter Chinon, the name of another fine, Loire valley wine.   We press Add Record to create the label.

 

il_labels02_50.png

 

A new label appears for Chinon, a superb red wine not well known outside of France.  Bordeaux and Burgundy are famous in export markets, but locals will often choose Chinon for the outstanding price/performance it offers.  

 

il_labels02_51.png

 

We can continue on in this way, adding more labels as desired and adding some background map layers from web servers, like the Google Terrain view used in the illustration above.   We might want to turn on per-record formatting, so each of the new labels could be individually styled to use a different color.  We could then use red color for red wines like Chinon and a lighter color for white wines like Vouvray and (usually) Cheverny.

Selection and Labels

We can select labels just as we might objects in drawings, either using mouse selection or using the Select panel in the Contents pane.   The Select panel can select labels based on the fields in the drawing on which the labels are based.

il_contents_select_labels01_01.png

 

Consider a map with a labels layer as seen above.  The Cities Labels layer is based on the same Cities drawing and Cities Table used in prior examples in this topic.   The text for each label is taken from a City field in the table.

 

il_contents_select_labels01_02.pngil_contents_select_labels01_03.png

 

In the Select panel we choose the Text Starts with template using the City field and we search for the text 'Ch' to find all labels for which the label text starts with Ch.    Three labels are previewed in the window above.   We press Replace Selection.

 

il_contents_select_labels01_04.png

Immediately, the desired labels are selected.  Once labels are selected we can do further operations, for example, copying or deleting the selected labels.

 

Transform Panel and Labels

The Transform panel also operates on labels, applying to whatever fields we want in the drawing upon which the labels are based.   We will use the Transform panel to vandalize the names of cities in and near the valley of the Loire river in France.

 

il_contents_transform_labels01_01.pngil_contents_transform_labels01_02.png

 

We begin by showing how the Restrict to selection box can be used to apply the transform only to selected labels.   In the illustrations above we have selected two labels by Ctrl-clicking them with the mouse.   English speakers often do not know if the Ch characters at the beginning of a French name should be pronounced with sound like the beginning of the word "Charles" or a sound like the beginning of "should."   We will assist them by replacing the Ch at the beginning of Châteaudun and Chateauroux with Sh.   The two labels on which the template will operate are shown in blended color, since they are both selected (using red selected color) and are also previewed (in blue preview color) as affected by the template.  We press Update Field to apply the change.

 

il_contents_transform_labels01_03.pngil_contents_transform_labels01_04.png

 

In the above illustrations we have continue to vandalize the ancient names of cities in the region.  "Anger" seems negative so we have changed it to Happy.  "Man" has political issues in modern times so the city is now Le Womans.   We are in the process, having selected Nevers to replace the value in the City field for that label to rename the city to the more positive Always.  

 

Setting aside the feeble, humor of the above, the ability to apply Transform templates to labels makes it easy to make sweeping changes that are useful in cartography, which can be accomplished in a highly dynamic workflow when combined with selections.   The following sequence also appears in the Manifold 9 - Select Labels and Dynamically Transform video.

 

il_contents_transform_labels01_06.pngil_contents_transform_labels01_07.png

 

Consider the illustrations above.  Our task is to assign cities in the region to our company's regional sales district number 28.    We use the Transform panel's Concatenate template, with Restrict to selection checked, to add the number 28 to the name of each label that we have selected.   We can dynamically select and de-select labels in the map and automatically their names will change to have 28 added to their names or not.

 

In the above we have selected some labels, which automatically have 28 added.   We can Shift-Ctrl-click onto Poitiers to de-select it and we can Ctrl-click onto Le Mans and Châteaudun to select them.

 

il_contents_transform_labels01_08.pngil_contents_transform_labels01_07.png

 

As we do, instantly the blue preview provided by the Transform panel shifts to show additions of 28 to the newly-selected cities and not to the de-selected Poitiers.   If we like the preview, we press the Update Field button to apply the changes.

 

Layers in Images are Temporary

We can add layers to a labels window as a temporary convenience and the labels window will show those layers like a map window does.   However, while a map maintains its layer structure even after the map window is closed, layers in a labels window last only as long as that window is open.   If we close the labels window and then open it again, it will have only one layer, the labels component itself.

 

If we have added layers to a labels window and want to keep that organization of layers with the labels window for later use, we choose Edit - Save as Map to save that window with its collection of layers as a map.    Maps take zero space since in actuality they do not store any data: they are simply references to other components that are the constituent layers of the map.   Therefore, we should not hesitate to ever use Edit - Save as Map to save any interesting or useful collection of layers we have added to a labels window.

 

Notes

Measurements - We can measure distances and bearings in labels layers using the Tracker tool.

 

Create points, lines or areas to make labels?   - In the workflow shown above to add a label to a labels component we used the Create Point tool.  Why are there also Create Line and Create Area tools in the toolbar for a labels layer?   That is to allow us to create labels that are based on lines or areas.   See the visual demonstration of how that works in the Manifold 9 - New Labels Features in 9 video in the Gallery page on the Manifold website.

 

Deletions are Confirmed - Deleting labels displays a confirmation dialog. The default button in the confirmation dialog is set to Cancel.  If we do not want to see the confirmation dialog, we can check the Never show this again box.  That will remove the confirmation dialog for deleting frames in layouts, for deleting objects in drawing layers, for deleting labels, and for deleting records in tables.    Another way to eliminate the confirmation dialog is to uncheck the Confirm deleting records box in the Tools - Options dialog.  Labels are records in the associated drawing's table, hence the "records" terminology.

 

il_labels01_14.png

 

Unicode is OK - Manifold can handle Unicode within labels, as seen above and as illustrated in the Example: Format the Size of City Points by Population topic.  (The Chinese characters used in the illustration above are placeholders, the names of various Manifold web sites in Chinese, and are not translations of the city names from French into Chinese.)  A variety of formatting tricks have been applied to create a more appealing display.

 

il_labels_romorantin.png

 

il_mur_des_beaunes.png

Romorantin, Cour-Cheverny and François - By happenstance our choice of zoomed views in the example centers on the town of Romorantin, also seen in the view above with background terrain layer and river layers added, the home of Romorantin grapes used in Cour-Cheverny wine.   

 

The great king François I,  good friend, patron and protector of Leonardo da Vinci in his old age, planted the first large vineyard of Romorantin in 1517 near his mother's chateau at Romorantin.   The stone wall bordering the original vineyard planted by François I still stands, seen in a French government survey photo from the 1930's at right.   

 

Cour-Cheverny is the fabulous white wine produced of 100% Romorantin grapes, by local mythology all said to be descendents of the vines of François I, and harvested exclusively from the region around Romorantin.   Whatever the true origin of the Romorantin vines, they produce an outstanding, dry white wine that is rarely exported, it is so valued by locals.

 

The neighboring town of Cheverny, also known for a famous chateau still owned by the same family as it has been for six centuries, is home to a related, crisp white wine made primarily of Sauvignon Blanc, along with Chardonnay, Menu PIneau and Chenin Blanc.

 

François considered building a new chateau at Romorantin to plans drawn up by Leonardo but instead built the largest chateau of all, seen below, at Chambord not far away.  Leonardo designed the immense double-helix stone staircase at the center of the chateau.    Leonardo is buried at the royal fortress of Amboise, almost exactly in the center of the map above just to the East of Tours.

 

il_chambord.png

 

 

Even small towns can have a chateau - Many tourists visit the famous chateaux of the valley of the Loire, but even smaller towns in the region often have historically important chateaux.  Seen below is a view of the chateau at Châteaudun, built from 1170 AD to the early 1500s.   

 

il_chateaudun.png

 

Set on a promontory that commands the valley of the Loir river, a tributary of the famous and larger Loire, the fortress at Châteaudun has existed since Celtic times and was a major fortress of the Romans.   The medieval tower, with walls several meters thick, was built in the late 1100s after Viking attacks leveled the predecessor fortification.  

 

il_dunois.pngThe Gothic fortress behind the great tower was converted from a fighting fortress into a residential chateau by Jean de Dunois, the illegitimate son of Louis I.   Jean Dunois was a companion of Joan of Arc, leading the French forces at Orleans to relieve the English siege in the Hundred Years War, a battle memorably brought to life in the film The Messenger, in which Jean Dunois is portrayed by Tchéky Karyo.  Seen at left, Karyo resembles Dunois as seen in the portrait at right.

 

il_jean_dunois.png

Dunois led the Orleans branch of the royal family for many years, the only adult male in the family left alive in France after his half-brother Charles was taken prisoner at Agincourt.   

 

Jean handled affairs so well he was able finally to ransom Charles from twenty five years captivity by the English.    When Charles became Charles VII, King of France, in gratitude he gave Jean the castle in Châteaudun and the surrounding territory.  Jean continued to fight in the Hundred Years War, eventually playing a key role in the conquest of Normandy.

 

The descendents of Jean Dunois continued expanding the chateau, adding a new wing in Renaissance style.  Today, we may tour the great chateau in person, or take a walk through the chateau using Google maps.  Zoom into the chateau in Châteaudun, drop the Google Street View man into the chateau and Street View allows a walk through the interior.  The Google Cultural Institute page provides remarkably detailed information, with online tours, about the chateau.

 

 

Poitiers and Tours - Also in the example drawing of Cities we see both Poitiers and Tours, somewhere between which on 10 October 732 was fought the famous battle between allied Frankish and Burgundian forces led by Charles Martel against the Umayyad Caliphate army led by Abdul Rahman Al Ghafiqi, the great general and governor of the Caliphate's Andalusian territory.  Al Ghafiqi was killed in the battle while in person rallying his men against the onslaught of Frankish infantry.  

 

Significantly outnumbered by the Muslim army, Martel had chosen the site of the battle well, seeking to use terrain and trees to weaken the advantage of Al Ghafiqi's calvary against Martel's exclusively infantry forces.  For seven days the armies skirmished until on the seventh day Muslim heavy cavalry charged the Franks, launching a brutal, day-long battle.   Martel's seasoned infantry fought off charge after charge, keeping their nerve in a defensive square before counter-attacking on foot to kill Al Ghafiqi, winning a decisive victory.

 

Already in control of much of the Iberian peninsula and Southern France, the advance by Al Ghafiqi so far into central France marked the greatest advance of Muslim armies into Western Europe.   The victory by Charles earned him his nickname of "Martellus," Latin for "The Hammer," cemented the power of the Franks and led to the development of Western Europe over the next twelve centuries as a primarily Christian culture.

 

Six centuries after Martel, Edward, the Black Prince, of England on 19 September 1356 won a stunning victory at Poitiers against King John II of France, capturing the king, his son and many French nobles.  Poitiers was the second of three epic English victories in the Hundred Years' War, coming ten years after the battle of Crécy and almost 60 years before Agincourt in 1415.

 

Who knew there was so much history in one small illustration?

Videos

Manifold 9 - Select Labels and Dynamically Transform - In this quick and easy video we show how to select labels and then dynamically transform the field behind the label using the Transform panel.

 

Manifold 9 - New Labels Features in 9 - Take a look at new Labels features in Release 9 that can be used in the latest, free Manifold Viewer Edge as well. With two clicks we add labels to a map where each label automatically takes its text from fields in a drawing layer. Next we use a single click to create a labels layer that allows us to interactively add a label wherever we want, as a point label or along a line we draw. We see how to turn on per-label formatting so each label can be styled differently.

See Also

File - Create - New Labels

 

Tables

 

Drawings

 

Layer Opacity

 

Tracker: Measurements

 

Style

 

Style: Drawings

 

Style: Labels

 

Contents Pane

 

Contents - Layers

 

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 panel.

 

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.