Relocate Events

Title  Relocate Events

Summary

Relocate events based on LRS network changes.


Usage


Syntax

Parameter Explanation
in_network

The LRS Network for which route edits will be inspected.

event_name

The LRS event layer to be relocated. You can choose from a list of registered external LRS events. This list is not filtered based on the Network Layer.

An error will be returned if this event layer does not belong to the network you have chosen.

last_invoked_time (Optional)

The last time this tool was executed. This value can be left empty or set to the Invoked Time output value from the previous execution of this tool. If you set this parameter, you will get events relocated for all LRS edits that have occurred after the Last Invoked Time. If you leave this value empty, you will get events relocated for all the LRS edits.

lrs_time (Optional)

The LRS view date for which route edits will be inspected.

last_lrs_time (Optional)

The LRS view date used for the previous execution of the tool.

output_format (Optional)

The data format of the output event records.

  • CSV—Comma-separated values file. This is the default.
  • JSON—JavaScript Object Notation file.
  • FEATURE_CLASS—Geodatabase feature class.
export_file (Optional)

Location and name of an output CSV or JSON file. This parameter is required when Output Format is CSV or JSON.

out_features (Optional)

The feature class containing the output event records. This parameter is required when Output Format is FEATURE_CLASS.

include_event_geometry (Optional)

Indicates if event shapes will be included with the output event records. This parameter is active when Output Format is JSON or FEATURE_CLASS.

  • Checked—Will include the event geometry with the output export file or feature class. This is the default.
  • Unchecked—Will not include the event geometry with the output export file or feature class.

Code Samples

RelocateEvents example 1 (Python window)

The following Python window script demonstrates how to use the RelocateEvents function in immediate mode.


# Local variables:
Network = "MilePoint"
External_Event_Name = "FunctionalClass_External"
Last_Invoked = "3/11/2014 10:00:00 AM"
LRS_Time = ""
Last_LRS_Time = ""
Output_Format = "FEATURE_CLASS"
Export_File = ""
Output = "C:\RoadsAndHighways\RelocateOutput.gdb\RelocateFunctionalClass"
Event_Geometry = "INCLUDE_EVENT_GEOMETRY"

# Process: Relocate Events
arcpy.RelocateEvents_locref(Network, External_Event_Name, Last_Invoked, LRS_Time, Last_LRS_Time, Output_Format, Export_File, Output, Event_Geometry)



                    

RelocateEvents example 2 (stand-alone script)

The following Python script demonstrates how to use the RelocateEvents function in stand-alone mode.


# Import arcpy module
import arcpy

# Check out any necessary licenses
arcpy.CheckOutExtension("Highways")

# Local variables:
Network = "C:\RoadsAndHighways\Data\RH_DOT.gdb\LRSN_MilePoint"
External_Event_Name = "FunctionalClass_External"
Output_Format = "CSV"
Include_Event_Geometry = "false"
Output = "C:\RoadsAndHighways\RelocateOutput\RelocateFunctionalClass.csv"


# Process: Make Feature Layer
arcpy.MakeFeatureLayer_management(Network, "network_lyr")

# Process: Relocate Events
arcpy.RelocateEvents_locref("network_lyr", External_Event_Name, "", "", "", Output_Format, Output, "", Include_Event_Geometry)


                    

Tags

Credits

Use limitations