Location Referencing ライセンスで利用可能です。
概要
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.
図
使用法
- 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.
構文
arcpy.locref.ModifyRouteIdPadding(in_feature_class, route_id_padding)
パラメーター | 説明 | データ タイプ |
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.
| Value Table |
派生した出力
名前 | 説明 | データ タイプ |
out_feature_class | The updated network feature layer. | Feature Layer |
コードのサンプル
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
# Check out license
arcpy.CheckOutExtension("LocationReferencing")
# 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)
# Check in license
arcpy.CheckInExtension('LocationReferencing')
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')
ライセンス情報
- Basic: 次のものが必要 ArcGIS Location Referencing
- Standard: 次のものが必要 ArcGIS Location Referencing
- Advanced: 次のものが必要 ArcGIS Location Referencing