Labeling data with unit conversion
You can display values in labels with the appropriate rounding rule applied.
Schritte:
- Start ArcMap.Tipp:
If the ArcMap - Getting Started dialog box appears, you can open a new or existing map document. You can also check the Do not show this dialog box in the future check box and click Open.
- On the main menu, click Customize > Toolbars > Labeling.
- Klicken Sie auf die Schaltfläche Beschriftungs-Manager (in der Werkzeugleiste Beschriftung).
- Aktivieren Sie das Kontrollkästchen neben dem Layer, dem Sie Beschriftungen hinzufügen möchten.
- Wählen Sie unter dem Layer eine Beschriftungsklasse.
- Click Expression.
-
From the Label Expression dialog box, enter or load the appropriate label expression.
The following is an example of an expression to apply a rounding rule for labeling. You may have to replace DEPTH_M and DEPTH_M_RR with the field names that apply to your label.
Function FindLabel ( [DEPTH_M], [DEPTH_M_RR] ) if ISNULL( [DEPTH_M_RR] ) then FindLabel = "" else set ipLabelHelper = CreateObject("ESRI.Production.Nautical.LabelHelperClass") set ipRounder = ipLabelHelper.GetUnitsRounder( [DEPTH_M_RR] ) if ipRounder Is Nothing then FindLabel = "" else set ipValue = ipRounder.Round( [DEPTH_M] ) FindLabel = "<CLR red='1' green='1' blue='1'><BOL><FNT name=""Arial"" size=""12"">" & ipValue.IntegerString & "</FNT><FNT name=""Arial"" size=""15""><SUB>" & ipValue.FractionalString & "</SUB></FNT></BOL></CLR>" end if end if End Function
- Click Verify to make sure there are no syntax errors and click OK.
-
Click OK to close the Label Manager dialog box.
Features are labeled with the appropriate rounding rule applied to the destination field. If unit destination values are updated, the appropriate rounding is reapplied for the labels.
9/17/2010