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.

A route ID is configured with three fields: RouteType, RouteNumber, and RampNumber. Sample padding and null settings for the three fields are shown below.

  • RouteType is a text field with a length of 3. The maximum number of characters that will 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; 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 need to be left blank. An underscore is used as a padding character to the left and right.

Illustration

Sample input and output for route ID padding

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 uses these updated settings while saving in the database.

  • Changing the length only changes the maximum number of characters that ArcGIS Roads and Highways expects for each field as part of a route in the network. Your 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 check box must be checked if the Pad if Null check box has been checked.

  • If you allow null values in a field, all fields to the right of that field must also allow null values. However, if the Pad If No Value Provided check box is checked, fields to the right do not have to 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 to be modified and its corresponding padding, null, and length values.

  • FieldThe field to be modified.
  • LengthThe length value of the field to be modified. The field length should be between 1 and the length of the database field.
  • Variable LengthSpecifies if the Length value is a variable value or a fixed value.
  • Enable PaddingSpecifies if the field supports padding.
  • Padding CharacterThe padding character for the field. The default is a space.
  • Padding LocationSpecifies where the padding should be applied to the field value.
    • Left—Adds the padding characters to the left of the value in the field. This is the default.
    • Right—Adds the padding characters to the right of the value in the field.
    • Left and Right—Adds the padding characters to the left and right of the value in the field.
  • Pad if NullSpecifies if the padding characters are added when the field has a null value.
  • Allow Null ValuesSpecifies if 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 to be modified and its corresponding padding, null, and length values.

  • FieldThe field to be modified.
  • LengthThe length value of the field to be modified. The field length should be between 1 and the length of the database field.
  • Variable LengthSpecifies if the Length value is a variable value or a fixed value.
  • Enable PaddingSpecifies if the field supports padding.
  • Padding CharacterThe padding character for the field. The default is a space.
  • Padding LocationSpecifies where the padding should be applied to the field value.
    • Left—Adds the padding characters to the left of the value in the field. This is the default.
    • Right—Adds the padding characters to the right of the value in the field.
    • Left and Right—Adds the padding characters to the left and right of the value in the field.
  • Pad if NullSpecifies if the padding characters are added when the field has a null value.
  • Allow Null ValuesSpecifies if 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)

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)

Demonstrates how to use the ModifyRouteIdPadding tool as 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