Exercise 6: Creating annotation
In Exercise 1: Organizing your data in the Catalog, you browsed through the existing feature classes in the Montgomery geodatabase. One of these feature classes contained annotation that was linked to features in the Distribmains feature classes. You then imported the water laterals from a coverage into the Water feature dataset. Now you will create labels for the water laterals in ArcMap and convert them to an annotation feature class that is linked to the laterals.
Creating labels for the lateral subtypes
Start ArcMap and add the Laterals feature class.
- Start ArcMap by clicking Start > All Programs > ArcGIS > ArcMap 10.
-
Set the Montgomery geodatabase as your default, since this is the geodatabase you will use in this tutorial. To do this, click the browse button on the ArcMap - Getting Started dialog box.
- Navigate to the location of the BuildingaGeodatabase tutorial folder, select the Montgomery geodatabase, then click Add.
- Click OK to open a new, empty map.
- Click the Catalog window button on the Standard toolbar to open the Catalog window.
- Navigate to the Montgomery geodatabase in the Catalog window.
- Expand the Water feature dataset.
- Click the Laterals feature class, hold down the left mouse button, and drag the feature class from the Catalog window onto the ArcMap window.
-
Right-click the Laterals feature class in the ArcMap table of contents and click Properties.
The Layer Properties dialog box opens.
- Click the Labels tab.
- Check the box to Label features in this layer.
- Click the Method drop-down arrow and click Define classes of features and label each class differently.
- Click Get Symbol Classes.
Because you created subtypes for the Laterals feature class, each subtype is automatically drawn with unique symbols. You will create different label classes for the subtypes.
Now the layer has several label classes defined—one for each subtype and one for other values.
Leave the Layer Properties dialog box open; you will use it in the next section.
Defining the labels for the hydrant laterals
The different subtypes of laterals have different roles in the water system. For example, service laterals bring water from the distribution mains to residences or businesses, and hydrant laterals bring water from mains to fire hydrants. You will make the labels for the hydrant laterals red to make it easy for map readers to differentiate hydrant laterals from other laterals.
- Click the Class drop-down list on the Labels tab of the Layer Properties dialog box and click Hydrant laterals.
- Click the text color drop-down arrow and choose a red swatch from the palette.
- Click the bold, B, and italic, I, buttons.
-
Click Expression.
The Label Expression dialog box opens.
-
Click Load.
This opens a dialog box that allows you to navigate to the file you want to load.
- Navigate to the Layers folder in the BuildingaGeodatabase tutorial folder.
- Choose the lateral_exp.lxp file and click Open.
- Click in the Expression box on the Label Expression dialog box and change the value in the If statement from 200 to 100.
-
Click Verify.
The expression is tested, and a sample is displayed.
- Click OK on the Label Expression Verification dialog box to close it.
-
Click OK on the Label Expression dialog box.
You have created an expression for the Hydrant laterals label class.
- Click Apply on the Layer Properties Layers tab to apply your changes.
Sometimes you want to label features with the content of a single field. The Label Field drop-down list lets you select a single field with which to label features. At other times, you may want to create more complex labels. The Label Expression dialog box lets you construct labels by concatenating one or more fields and other text. You can also add logic to the label expression using a script.
To create the labels for the hydrant laterals, you will load a label expression that has been saved to a file.
This script expression evaluates the length of each lateral; if its value is greater than 200, it labels the lateral with the contents of the DIAMETER field, a space, and the contents of the MATERIAL field. If the length is less than 200, it labels the lateral with the contents of the DIAMETER field.
You will adjust this expression for the Hydrant laterals so that Hydrant laterals longer than 100 feet get the more complete labels.
Next, you will create expressions for the label classes of the other subtypes.
Defining the labels for the service laterals
The service laterals tend to be shorter than the hydrant laterals. For this exercise, it is only important to show their material type when they are longer than 200 feet, so you will load the label expression again and use it without modifying it.
- Click the Class drop-down list on the Layer Properties dialog box and click Service laterals.
- Use the same procedure that you just used to define the labels for the Hydrant laterals, but make these labels black, and do not modify the label expression after you load it.
- Click Apply to apply your changes.
Now you can set up the label parameters for this label class.
Defining the labels for other laterals
You have loaded label expressions for the Hydrant laterals and Service laterals. Now you will define the labels for Fire laterals, Unknown laterals, and the <all other values> class. Since these classes are less common, and only the diameter is of interest, you will use the Diameter field alone to label these features.
- Click the Class drop-down arrow and click Fire laterals.
- Click the Label Field drop-down arrow and click DIAMETER.
- Click Apply.
- Use the same procedure to set the labels for the Unknown and <all other values> label classes.
-
Click OK on the Layer Properties dialog box.
The labels are drawn on the map. The Hydrant laterals are labeled in red, and because of the label expression, the longer ones are also labeled with their material type.
You have created labels for the different subtypes of laterals using the symbology classes in ArcMap to derive the label classes.
Now you will convert the labels to annotation in the geodatabase.
Setting the reference scale for the labels
Labels are dynamic—they are regenerated on the fly when you pan and zoom around the map. By default, they will be drawn using the same size symbol, regardless of the scale to which you zoom. Not all features can be labeled using an 8-point font at the full extent of the feature class, but if you zoom in, there will be more space around the features, so more labels will be drawn.
Unlike labels, annotation is static. Annotation features are stored. They have a fixed location and a reference scale, so when you zoom in, the text gets larger on the screen. You can make labels behave more like annotation by setting a reference scale. This should be the scale at which the map will most commonly be used. When you convert the labels to annotation, you want the annotation to have the right reference scale so it will be drawn at the right size, relative to the features, on the maps you create.
- Click the Zoom In tool on the ArcMap Tools toolbar and click and drag a box around some of the laterals on the eastern edge of the data.
-
Type 1000 in the Scale box and press Enter.
More labels are now drawn in the display.
- Click List by drawing order on the ArcMap table of contents.
-
Right-click Layers in the ArcMap table of contents, point to Reference Scale, then click Set Reference Scale.
Now, when you zoom in or out, the labels will get larger or smaller.
Converting the labels to annotation
This section applies to ArcEditor and ArcInfo only.
Now that the reference scale is set, you can convert the labels to annotation and store them in your geodatabase. You will convert the label classes into subtypes of a single feature-linked annotation feature class. This process requires an ArcEditor or ArcInfo licensed seat of ArcMap. With an ArcView seat, you can create annotation from labels but not feature-linked annotation.
-
Right-click Layers in the ArcMap table of contents and click Convert Labels to Annotation.
The Convert Labels to Annotation dialog box opens.
- Click in the Annotation Feature Class column for the Water laterals feature layer and rename the output annotation feature class LateralsAnno.
-
Click the properties icon under Annotation Feature Class.
The Annotation Feature Class Properties dialog box opens.
-
Check the box to Require symbol to be selected from the symbol table.
This will reduce the storage space needed in the geodatabase for the annotation. Each annotation feature will reference a symbology table in the geodatabase, rather than storing all its own symbology information. You will not be able to store graphics in this annotation feature class.
- Click OK to close the Annotation Feature Class Properties dialog box.
-
Click Convert on the Convert Labels to Annotation dialog box.
A message box appears showing the progress of the conversion process.
The labels are converted to a set of annotation classes within a single annotation feature class. This feature class has been added to the ArcMap table of contents.
A relationship class is also created that links the annotation to the laterals. To see this, click the Catalog tab in ArcMap to open the Catalog window. Right-click the Water feature dataset in the Montgomery geodatabase and click Refresh. A new Anno relationship class should display under the Water feature dataset.
-
Close ArcMap.
Tip:
You do not have to save the map, but you can if you want to do so.
The check boxes for the two feature-linked annotation editing behavior options are checked by default. New annotation will be created when new laterals are added, and existing annotation will move when laterals are moved or reshaped.
You have created an annotation feature class in the geodatabase. The annotation classes within it correspond to the subclasses of the laterals feature class. Some of these annotation classes have special symbology, as well as logic, to annotate certain features with extra information. When the Laterals feature class is edited in ArcMap, the corresponding annotation features will be created or modified using the symbology and annotation expression you defined.