Summary
Adds a sequential number to a new or existing field of a set of input features.
Usage
Using an existing field to number will overwrite the values in that field.
Features outside of the Input Area to Number will automatically have the Field to Number (Existing or New) set to Null.
When specifying a new field name to number in Field to Number (Existing or New), the first letter must be alpha, and the remaining letters must be alphanumeric or underscores.
When numbering features other than points, all features that are contained within or intersect the Input Area to Number will be numbered.
Syntax
NumberFeatures(in_features, field_to_number, {in_area}, {spatial_sort_method}, {new_field_type})
Parameter | Explanation | Data Type |
in_features | The input features to number. | Feature Set |
field_to_number | The input field to number. The field can be an existing short, long, or text field, or a new field. | Field |
in_area (Optional) | The area that will limit the features to number; only features within this area will be numbered. | Feature Set |
spatial_sort_method (Optional) | Specifies how features will be spatially sorted for the purpose of numbering. Features are not reordered in the table.
| String |
new_field_type (Optional) | Specifies the field type of the new field. This parameter is only used when the field name does not exist in the input table.
| String |
Derived Output
Name | Explanation | Data Type |
out_feature_class | The updated feature class. | Feature Class |
Code sample
The following Python window script demonstrates how to use the NumberFeatures function.
import arcpy
arcpy.env.workspace = r"C:/Data.gdb"
arcpy.NumberFeatures_defense("Structures", "structure_number", "AO", "LL",
"Short")
The following example uses the NumberFeatures function in an example workflow script.
# Convert building footprints to points and number the points.
# Import modules
import arcpy
# Set workspace
arcpy.env.workspace = r"C:/Data.gdb"
# Get building center points
result_points = "Building_Points"
arcpy.FeatureToPoint_management("Buildings_1", result_points)
# Number the points that represent buildings
arcpy.NumberFeatures_defense(result_points, "building_number", "AO", "LL",
"Short")
Environments
Licensing information
- Basic: No
- Standard: No
- Advanced: Yes