Labels are a visual component displaying text
from a field in a drawing's table. A labels component automatically
takes on the coordinate system used by the associated drawing. Labels
provide valuable text readouts of attributes associated with objects visualized
in drawings. Labels also provide a convenient way to check
the placement of objects in a drawing to ensure that work has been done
correctly.
The illustration above shows two labels layers in use in a map, with a variety of formatting tricks applied to create a more appealing display.
Most of the time we would like to create labels for an existing drawing. Here is how:
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.
The following example shows the above procedure with step by step illustrations. In real life the procedure is so quick and easy an experienced Manifold user could do it more quickly than most people could read the above list.
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.
Opening the map we see that the Cities drawing, the only layer in the map, shows points. We have used Edit - 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.
For less clutter in this example, we zoom into the map to show fewer points.
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.
In the Project pane, right click onto the Cities drawing and choose New Labels.
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.
We choose the City field, since that gives the name of each city.
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.
When we click the Create Labels button a new labels component appears in the Project pane.
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.
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: Formatting Drawings and Labels topic.
The illustration above shows a limitation of current editions (a limitation that will soon be eliminated): Labels appear directly on top of points and they can overlap each other, as in the case of the labels for Bourges and Avord. Pending enhancements to Manifold System GIS will automatically resolve label overlaps and will provide means to offset labels so they do not fall directly on top of the objects they label. With Radian Studio we can achieve similar effects, but we must do so manually as we must in the current version of Manifold. Manifold has such strong data manipulation capabilities that is relatively easy to do.
Ctrl-click the Cities drawing and the Cities Table table to highlight both.
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.
Next we click Paste to paste. We could also have done a Ctrl-V to paste using the usual Windows keyboard shortcut.
The result is that a copies of the drawing and the drawing's table appear in the Project pane, using default naming.
We drag and drop the Cities 2 drawing into the map. It appears exactly as the Cities drawing using yellow diamond symbols. We use the Edit - Style dialog to change the color to green (this step not illustrated, just the results are seen above).
Clicking the Cities 2 layer tab to make sure it is the active layer, we choose Edit - Transform to launch the Transform dialog. The dialog launches automatically targeting 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).
As soon as we change the values in the Transform dialog, the dialog will show 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, and then we press Close to close the Transform dialog.
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.
Right-click the Cities 2 drawing and choose New Labels.
In the New Labels dialog we choose City as the source field for label text and then we choose Create Labels.
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. That is easy to fix.
We click off the Cities Labels 2 layer to reduce clutter, we click on the Cities 2 layer, and then with the Cities 2 layer being the active layer we use Ctrl-click and drag to drag a selection box around the Avord point. That selects that point.
Once again we choose Edit - Transform to launch the Transform dialog, but this time we check the Restrict to selection box so that the dialog operates only on selected objects. As before we choose the Shift transform. 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).
As before, the Transform dialog instantly previews any change in the map in blue preview color, but this time since we have checked the Restrict to selection box only the point for Avord moves in the preview. We press the Update Field button to apply the transform, and then we press Close to close the Transform dialog.
The result is that the selected point has been moved down and slightly to the left. This will move the associated label away from an overlap conflict.
If we click off the Cities 2 layer and click on the Cities Labels 2 layer we can see the Avord label has moved away from a position where it conflicts with other labels.
The method shown above has two obvious disadvantages:
It is manual, not automatic, and thus not something we would do to resolve many conflicts.
It only makes sense at a limited range of zooms. Moving points to where offsets at a given zoom level are what we want creates the desired visual effect only at that zoom level. Zooming significantly in or out will ruin the effect.
Despite those disadvantages it is nonetheless a useful technique when using labels in a casual way within Manifold for illustrations.
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 the Layers pane 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.
In the above examples we created labels based on an existing drawing. We can also create a new labels component using a new, blank drawing as follows:
We begin by right-clicking into the Project pane and choosing New Labels.
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.
We change the Name of the new labels component to be Notes and then we press the Create Labels button.
Three new components appear in the Project pane: a Notes Drawing, the drawing's table and a Notes labels component.
Clicking open the table we see it is empty.
We drag and drop the Notes Drawing into the map. Using the procedure described in the Drawings topic we have added a point to the drawing in the location seen above. Using Edit - Style we have styled it to appear as a small purple square.
In the drawing's table we see that a record has appeared for a point. The Text value is <NULL>. We will change that by editing that cell.
Using the procedure given in the Editing Tables topic (totally easy to do in a second or two) we have changed that text value to Beauce, the name of a natural region in France.
Now, when we drag and drop the Notes labels layer into the map the label Beauce appears. Using Edit - Style we have styled the label to use an all caps font, brown color and larger font size.
We add another layer by adding another point to the controlling drawing. We click on the Notes Drawing layer tab to make it the active layer and then we add another point in the desired location.
In the drawing's table we add the text Loire to the Text cell for that point.
As we do, automatically the new label appears in the map.
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.
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. Because Manifold allows us to leave the drawing's table open we can use a simpler approach where we leave the table open, we click into the map to make points where we want a label to appear and then we can enter the text into the table for the label to use. Manifold automatically updates the labels for us.
Labels for areas - Some illustrations show labels within an area, but by default the labels are created at the location of some coordinate point that defines an area, such as on the border. How can labels be created in the center of an area? Easy. First, take a few seconds to use the Transform dialog to create a centroids drawing for the areas and then create labels using the centroids drawing. By default the centroids will inherit text fields from the areas. We can then use the labels in a map without also needing to include a centroids layer. That is how the Regions Labels layer in the accompanying illustrations was created.
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.
Romorantin, Cour-Cheverny and François - By happenstance our choice of zoomed views in the example above centers on the town of Romorantin, 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.
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 Frankish and Burgundian forces led by Charles Martel against the Umayyad Caliphate army led by Abdul Rahman Al Ghafiqi, the great governor and general 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 Gafiqi 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?
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 dialog.
Example: Formatting Tricks - The visualization capabilities of Manifold using Style can be exploited to provide many visual effects. This topic provides some examples of how to use Style in unexpected ways to create a range of more elaborate effects.