Letter Features (Defense)

Summary

Adds a sequential letter to a new or existing field of a set of features.

Usage

  • Adding a sequential letter scheme to an existing field will overwrite the values in that field.

  • Features outside of the Input Area to Letter parameter value will automatically set the Field to Letter (Existing or New) parameter to Null.

  • When naming a new field to letter in the Field to Letter (Existing or New) parameter, the first letter must be an alpha character, and the remaining letters must be alphanumeric or underscores.

  • When lettering features other than points, all features that are contained in or intersect the Input Area to Letter parameter value will be lettered.

Parameters

LabelExplanationData Type
Input Features

The input features that will be lettered.

Feature Set
Field to Letter (Existing or New)

The input field that will be lettered. The field must be a new or existing text field.

Field
Input Area to Letter
(Optional)

The area that will limit the features to letter; only features within this area will be lettered.

Feature Set
Spatial Sort Method
(Optional)

Specifies how features will be spatially sorted for the purpose of lettering. Features are not reordered in the table.

  • Upper rightFeatures will be sorted starting at the upper right corner. This is the default.
  • Upper leftFeatures will be sorted starting at the upper left corner.
  • Lower rightFeatures will be sorted starting at the lower right corner.
  • Lower leftFeatures will be sorted starting at the lower left corner.
  • Peano curveFeatures will be sorted using a space-filling curve algorithm, also known as a Peano curve.
  • CenterFeatures will be sorted starting from a center point (the mean center will be used if no center is provided).
  • ClockwiseFeatures will be sorted starting from a center point and moving clockwise.
  • CounterclockwiseFeatures will be sorted starting from a center point and moving counterclockwise.
  • NoneNo spatial sort will be used. The same order as the feature class will be used.
String
Lettering Format
(Optional)

Specifies the labeling format that will be used for each feature.

  • Excel (A, B, C, ...)An alpha character (for example, A, B, C) will be used. This is the default.
  • Grid (AA, AB, AC, ...)A constant alpha character with an incrementing second alpha character grid (for example, AA, AB, AC) will be used.
  • Alternating Grid (AA, BB, CC, ...)A double alpha character that is incremented for each feature (for example, AA, BB, CC) will be used.
String
Starting Letter
(Optional)

The value that will be used to begin lettering.

String
Omit Letters
(Optional)

The values that will be omitted from the lettering sequence.

String
Center Point
(Optional)

The center point that will be used to sort and letter features.

Feature Set
Add Distance and Bearing to Center
(Optional)

Specifies whether fields will be added to the output for distance and bearing to a center point.

  • Do not add distance and bearingNo distance or bearing fields will be added to the output. This is the default.
  • Add distance and bearingDIST_TO_CENTER and ANGLE_TO_CENTER fields will be added to the output.
Boolean

Derived Output

LabelExplanationData Type
Output Feature Class

The updated feature class.

Feature Class

arcpy.defense.LetterFeatures(in_features, field_to_letter, {in_area}, {spatial_sort_method}, {lettering_format}, {starting_letter}, {omit_letters}, {center_point}, {add_distance_and_bearing})
NameExplanationData Type
in_features

The input features that will be lettered.

Feature Set
field_to_letter

The input field that will be lettered. The field must be a new or existing text field.

Field
in_area
(Optional)

The area that will limit the features to letter; only features within this area will be lettered.

Feature Set
spatial_sort_method
(Optional)

Specifies how features will be spatially sorted for the purpose of lettering. Features are not reordered in the table.

  • URFeatures will be sorted starting at the upper right corner. This is the default.
  • ULFeatures will be sorted starting at the upper left corner.
  • LRFeatures will be sorted starting at the lower right corner.
  • LLFeatures will be sorted starting at the lower left corner.
  • PEANOFeatures will be sorted using a space-filling curve algorithm, also known as a Peano curve.
  • CENTERFeatures will be sorted starting from a center point (the mean center will be used if no center is provided).
  • CLOCKWISEFeatures will be sorted starting from a center point and moving clockwise.
  • COUNTERCLOCKWISEFeatures will be sorted starting from a center point and moving counterclockwise.
  • NONENo spatial sort will be used. The same order as the feature class will be used.
String
lettering_format
(Optional)

Specifies the labeling format that will be used for each feature.

  • A_B_CAn alpha character (for example, A, B, C) will be used. This is the default.
  • AA_AB_ACA constant alpha character with an incrementing second alpha character grid (for example, AA, AB, AC) will be used.
  • AA_BB_CCA double alpha character that is incremented for each feature (for example, AA, BB, CC) will be used.
String
starting_letter
(Optional)

The value that will be used to begin lettering.

String
omit_letters
[omit_letters,...]
(Optional)

The values that will be omitted from the lettering sequence.

String
center_point
(Optional)

The center point that will be used to sort and letter features.

Feature Set
add_distance_and_bearing
(Optional)

Specifies whether fields will be added to the output for distance and bearing to a center point.

  • DONT_ADD_DISTANCENo distance or bearing fields will be added to the output. This is the default.
  • ADD_DISTANCEDIST_TO_CENTER and ANGLE_TO_CENTER fields will be added to the output.
Boolean

Derived Output

NameExplanationData Type
out_feature_class

The updated feature class.

Feature Class

Code sample

LetterFeatures example 1 (Python window)

The following Python window script demonstrates how to use the LetterFeatures function.

import arcpy
arcpy.env.workspace = r"C:/Data.gdb"
arcpy.defense.LetterFeatures("bldg_footprints", "bldg_letter")
LetterFeatures example 2 (stand-alone script)

The following example uses the LetterFeatures function in an example workflow script.

# Select buildings with a footprint over 5000 square feet and assign a letter

# Import system modules
import arcpy

# Set environment settings
arcpy.env.workspace = r"C:/Data.gdb"

# Project data
out_coordinate_system = arcpy.SpatialReference(3395)
proj_bldg = "bldg_footprint_proj"
arcpy.management.Project("Buildings",
                         proj_bldg,
                         out_coordinate_system)

# Calculate area
arcpy.management.CalculateGeometryAttributes(proj_bldg,
                                             "area AREA",
                                             '',
                                             "SQUARE_FEET_US")

# Export to a new feature class
expression = "area >= 5000"
arcpy.conversion.FeatureClassToFeatureClass(proj_bldg,
                                            arcpy.env.workspace,
                                            "bldg_over_5000",
                                            expression)

# Letter the buildings
arcpy.defense.LetterFeatures("bldg_over_5000",
                             "bldg_letter",
                              None,
                              "CENTER",
                              "A_B_C",
                              "A",
                              "D",
                              "neighborhood_center",
                              "ADD_DISTANCE")