In Exercise 1, 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 arcs 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.
Create labels for the lateral subtypes
If you closed ArcMap, start it and add the Laterals feature class to the map.
- Start ArcMap.
- Click the Catalog button on the Standard toolbar to open the Catalog window.
- Expand the Montgomery geodatabase in the Catalog window and expand the Water feature dataset.
- Drag the Laterals feature class from the Catalog window onto the map.
- Right-click the Laterals layer in the ArcMap Table of Contents and click Properties.
The Layer Properties dialog box appears.
- 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.
Define labels for 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 appears.
- Click Load.
A dialog box appears that allows you to navigate to the file you want to load.
- Browse 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.
Define labels for 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 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.
Define 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.
Set a reference scale for 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 the List By Drawing Order button on the ArcMap table of contents.
- Right-click Layers in the Table Of Contents, point to Reference Scale, and click Set Reference Scale.
Now, when you zoom in or out, the labels will get larger or smaller.
Convert labels to annotation
This section applies to ArcGIS Desktop Standard and ArcGIS Desktop Advanced 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 ArcGIS for Desktop Standard or Advanced license. With an ArcGIS for Desktop Basic license, you can create annotation from labels but not feature-linked annotation.
- Right-click Layers in the Table Of Contents and click Convert Labels to Annotation.
The Convert Labels to Annotation dialog box appears.
- Click in the Annotation Feature Class column for the Water laterals feature layer, and rename the output annotation feature class to LateralsAnno.
- Click the properties icon under Annotation Feature Class.
The Annotation Feature Class Properties dialog box appears.
- 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 map.
A relationship class is also created that links the annotation to the laterals. To see this, right-click the Water feature dataset in the Montgomery geodatabase in the Catalog window and click Refresh. A new Anno relationship class displays under the Water feature dataset.
- Close ArcMap, as you will perform the last two exercises in ArcCatalog.
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.