Modify Route ID Padding (Location Referencing)

Available with Location Referencing license.

Summary

Modifies the padding, null, and length properties for fields that are part of a multifield route ID.

In the image example below, a route ID is configured with three fields: RouteType, RouteNumber, and RampNumber. Sample padding and null settings for the three fields are as follows:

  • RouteType is a text field with a length of 3. The maximum number of characters that can be entered is three; however, some routes may have one or two characters entered for this field. A hyphen is used as a padding character to the right.
  • RouteNumber is a short field type. The field will have values ranging from 0 to 99999. A zero (0) is used as a padding character to the left.
  • RampNumber is a text field with a length of 7; however, some routes will not have a value for this field and must be left blank. An underscore is used as a padding character to the left and right.

Illustration

Modify Route ID Padding tool illustration

Usage

  • Each field in the route ID can have its maximum length shortened; be variable or fixed length; or have padding characters added to the left, right, or both left and right sides, as well as have padding added to an empty field. Additionally, a null value can be used for one or more of the fields in a concatenated route ID.
  • The route ID for each record will be stored with padding and null values included. Each individual field used as part of the concatenated route ID will be stored without any padding character.

  • Padding and null settings can be changed once the network is created. Any routes loaded and created before changing these settings remain saved as is in the database. Any route loaded and created after changing the settings will use these updated settings while saving in the database.

  • Changing the length only changes the maximum number of characters that are expected in ArcGIS Roads and Highways for each field as part of a route in the network. The data should still be modeled in your geodatabase with the route ID field length being the sum of the lengths of the fields composing the concatenated route ID.

  • The Allow Null Values padding option must be checked if the Pad if Null padding option has been checked.

  • If you allow null values in a field, all fields to the right of that field must also allow null values.

  • A number sign (#) is not supported as a padding character.

Parameters

LabelExplanationData Type
LRS Network Feature Class

The input multifield route ID network layer that contains fields for padding, null, and length values that need to be modified.

Feature Layer
Route ID Padding

A table of values that specifies the field that will be modified and its corresponding padding, null, and length values.

  • FieldThe field that will be modified.
  • LengthThe length value of the field that will be modified. The field length should be between 1 and the length of the database field.
  • Variable LengthSpecifies whether the Length value is a variable value or a fixed value.
  • Enable PaddingSpecifies whether the field supports padding.
  • Padding CharacterThe padding character for the field. The default is a space.
  • Padding LocationSpecifies where the padding will be applied to the field value.
    • Left—The padding characters will be added to the left of the value in the field. This is the default.
    • Right—The padding characters will be added to the right of the value in the field.
    • Left and Right—The padding characters will be added to the left and right of the value in the field.
  • Pad if NullSpecifies whether the padding characters will be added when the field has a null value.
  • Allow Null ValuesSpecifies whether the field supports null values.
Value Table

Derived Output

LabelExplanationData Type
Output Network Feature Class

The updated network feature layer.

Feature Layer

arcpy.locref.ModifyRouteIdPadding(in_feature_class, route_id_padding)
NameExplanationData Type
in_feature_class

The input multifield route ID network layer that contains fields for padding, null, and length values that need to be modified.

Feature Layer
route_id_padding
[route_id_padding,...]

A table of values that specifies the field that will be modified and its corresponding padding, null, and length values.

  • FieldThe field that will be modified.
  • LengthThe length value of the field that will be modified. The field length should be between 1 and the length of the database field.
  • Variable LengthSpecifies whether the Length value is a variable value or a fixed value.
  • Enable PaddingSpecifies whether the field supports padding.
  • Padding CharacterThe padding character for the field. The default is a space.
  • Padding LocationSpecifies where the padding will be applied to the field value.
    • Left—The padding characters will be added to the left of the value in the field. This is the default.
    • Right—The padding characters will be added to the right of the value in the field.
    • Left and Right—The padding characters will be added to the left and right of the value in the field.
  • Pad if NullSpecifies whether the padding characters will be added when the field has a null value.
  • Allow Null ValuesSpecifies whether the field supports null values.
Value Table

Derived Output

NameExplanationData Type
out_feature_class

The updated network feature layer.

Feature Layer

Code sample

ModifyRouteIdPadding example 1 (Python window)

This example demonstrates how to use the ModifyRouteIdPadding tool in the Python window.

# Name: ModifyRouteIdPadding_inline.py
# Description: Modifies the padding, null, and length properties for fields that are part of a multifield route ID in the Python window.
# Requires: ArcGIS Location Referencing

# Tool variables 
in_feature_class = r"C:\Data\DOT.gdb\LRS\StateRoutes"

## Values format: "Field Length VariableLength EnablePadding PaddingCharacter PaddingLocation PadifNull AllowNullValues;Field2......" 
route_id_padding = "RouteSystem 3 false true @ LEFT false false;RouteNumber 10 true true 0 LEFT true true"

# Set current workspace
arcpy.env.workspace = "C:\Data\DOT.gdb"

# Execute the tool
arcpy.locref.ModifyRouteIdPadding(in_feature_class,route_id_padding)
ModifyRouteIdPadding example 2 (stand-alone script)

This example demonstrates how to use the ModifyRouteIdPadding tool in a stand-alone Python script.

# Name: ModifyRouteIdPadding_standalone.py
# Description: Modifies the padding, null, and length properties for fields that are part of a multifield route ID in standalone mode.
# Requires: ArcGIS Location Referencing

# Import arcpy module
import arcpy

# Check out license
arcpy.CheckOutExtension("LocationReferencing")

# Set local variables
in_feature_class = r"C:\Data\DOT.gdb\LRS\StateRoutes"

# Values format: "Field Length VariableLength EnablePadding PaddingCharacter PaddingLocation PadifNull AllowNullValues;Field2......" 
route_id_padding = "RouteSystem 3 false true @ LEFT false false;RouteNumber 10 true true 0 LEFT true true"

# Execute the tool
arcpy.locref.ModifyRouteIdPadding(in_feature_class,route_id_padding)

# Check in license
arcpy.CheckInExtension('LocationReferencing')

Environments

Licensing information

  • Basic: Requires ArcGIS Location Referencing (ArcGIS Pipeline Referencing or ArcGIS Roads and Highways)
  • Standard: Requires ArcGIS Location Referencing (ArcGIS Pipeline Referencing or ArcGIS Roads and Highways)
  • Advanced: Requires ArcGIS Location Referencing (ArcGIS Pipeline Referencing or ArcGIS Roads and Highways)

Related topics