ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Append Events

Available with Location Referencing license.

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Appends event records from a table, layer, or feature class to an existing ArcGIS Roads and Highways event feature class.

Usage

  • An LRS dataset is required to run this tool.

  • The Input Event can be a table, layer, or feature class.

    Learn more about fields required by the Roads and Highways events data model

  • The Target Event should be a layer or feature class registered with Roads and Highways.

  • This tool supports point and polyline features. The feature type in the input and target event parameters should match.

  • If the Generate Event ID GUIDs for loaded events parameter is checked and you want GUIDs generated, either do not map the EventID field in the field mapping section or be sure to have Null records in the EventID column in the source event data. If the EventID field in a source event record is populated and the Generate Event ID GUIDs for loaded events parameter is checked, the value in the source event record EventID field will be loaded into the target event.

Syntax

arcpy.locref.AppendEvents(in_dataset, in_target_event, field_mapping, {load_type}, {generate_event_ids}, {generate_shapes})
ParameterExplanationData Type
in_dataset

The source event records to append.

Table View
in_target_event

The Roads and Highways event layer or feature class into which the source event records will be appended.

Feature Layer
field_mapping

Controls how the attribute information in fields of the in_dataset is transferred to the in_target_event.

Because the data of in_dataset is appended into an existing event that has a predefined schema (field definitions), fields cannot be added or removed from the target dataset. While you can set merge rules for each output field, the tool ignores those rules.

The ArcPy FieldMappings class can be used to define this parameter.

Field Mappings
load_type
(Optional)

Specifies how appended events with measure or temporality overlaps with identical Event IDs as Target Event records will be loaded into the event feature class.

  • ADD —Appends the Input Event records to the Target Event. No changes are made to Target Event records.
  • RETIRE_OVERLAPS —Appends the Input Event records to the Target Event and retires any records in the Target Event with measure or temporality overlaps as the appended events. If the appended event eclipses the Target Event, the Target Event will be deleted. This option should only be used for linear events.
  • RETIRE_BY_EVENT_ID —Appends the Input Event records to the Target Event and retires any records in the Target Event with the same Event ID and temporality overlaps as the appended events. If the appended event eclipses a Target Event with the same Event ID, the Target Event will be deleted.
  • REPLACE_BY_EVENT_ID —Appends the Input Event records to the Target Event and deletes any records in the Target Event with the same Event ID as the appended events.
String
generate_event_ids
(Optional)

Specifies whether event IDs will be generated for in_dataset records being appended. Generation of event IDs will only be applied to in_dataset records with a Null value for the Event ID field.

  • GENERATE_EVENT_IDS —Generates event IDs for the in_dataset records being appended.
  • NO_GENERATE_EVENT_IDS —Does not generate event IDs for the in_dataset records being appended. This is the default.
Boolean
generate_shapes
(Optional)

Specifies whether the shapes of the records being appended will be regenerated. This parameter is only enabled when the in_dataset is a feature layer or feature class.

  • GENERATE_SHAPES —The shapes of the input event features will be regenerated. This is the default.
  • NO_SHAPES —The shapes of the input event features will not be regenerated.
Boolean

Derived Output

NameExplanationData Type
out_target_event

The event layer or feature class to which the source event records have been appended.

Feature Layer
out_details_file

A text file that details changes made by the tool.

Text File

Code sample

AppendEvents example 1 (Python window)

Demonstrates how to use the AppendEvents function in the Python window.

# Name: AppendEvents_Inline_Example.py
# Description: Append event records into an existing Roads and Highways event feature class.

# set current workspace
arcpy.env.workspace = r"C:\NY_Data.gdb"

# tool variables
in_dataset = "AADT_Add"
in_event_featureclass = "AADT"
field_mapping = 'YEAR_ "YEAR_" true true false 2 Short 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,YEAR_,-1,-1;DISTRICT "DISTRICT" true true false 1 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,DISTRICT,-1,-1;COSITE "COSITE" true true false 6 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,COSITE,-1,-1;ROADWAY "ROADWAY" true true false 8 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,ROADWAY,-1,-1;DESC_FRM "DESC_FRM" true true false 30 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,DESC_FRM,-1,-1;DESC_TO "DESC_TO" true true false 30 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,DESC_TO,-1,-1;AADT "AADT" true true false 4 Long 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,AADT,-1,-1;AADTFLG "AADTFLG" true true false 1 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,AADTFLG,-1,-1;KFLG "KFLG" true true false 1 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,KFLG,-1,-1;K100FLG "K100FLG" true true false 1 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,K100FLG,-1,-1;DFLG "DFLG" true true false 1 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,DFLG,-1,-1;TFLG "TFLG" true true false 1 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,TFLG,-1,-1;BEGIN_POST "BEGIN_POST" true true false 8 Double 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,BEGIN_POST,-1,-1;END_POST "END_POST" true true false 8 Double 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,END_POST,-1,-1;KFCTR "KFCTR" true true false 8 Double 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,KFCTR,-1,-1;K100FCTR "K100FCTR" true true false 8 Double 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,K100FCTR,-1,-1;DFCTR "DFCTR" true true false 8 Double 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,DFCTR,-1,-1;TFCTR "TFCTR" true true false 8 Double 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,TFCTR,-1,-1;FromDate "FromDate" true true false 8 Date 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,FromDate,-1,-1;ToDate "ToDate" true true false 8 Date 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,ToDate,-1,-1;EventID "EventID" true true false 50 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,EventID,-1,-1'
load_type = "RETIRE_OVERLAPS"
event_ids = "GENERATE_EVENT_IDS"
generate_shapes = "NO_SHAPES"

# execute the tool
arcpy.AppendEvents_locref(in_dataset, in_event_featureclass, field_mapping, load_type, event_ids, generate_shapes)
AppendEvents example 2 (stand-alone script)

Demonstrates how to use the AppendEvents function as a stand-alone Python script.

# Name: AppendEvents.py
# Description: Append records into an existing Roads and Highways event feature class.

# Import arcpy module
import arcpy

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

# Local variables:
in_dataset  = "C:/NY_Data.gdb/AADT_Add"
in_target_event = "C:/NY_Data.gdb/LRSE_AADT"
field_mapping ='YEAR_ "YEAR_" true true false 2 Short 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,YEAR_,-1,-1;DISTRICT "DISTRICT" true true false 1 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,DISTRICT,-1,-1;COSITE "COSITE" true true false 6 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,COSITE,-1,-1;ROADWAY "ROADWAY" true true false 8 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,ROADWAY,-1,-1;DESC_FRM "DESC_FRM" true true false 30 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,DESC_FRM,-1,-1;DESC_TO "DESC_TO" true true false 30 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,DESC_TO,-1,-1;AADT "AADT" true true false 4 Long 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,AADT,-1,-1;AADTFLG "AADTFLG" true true false 1 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,AADTFLG,-1,-1;KFLG "KFLG" true true false 1 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,KFLG,-1,-1;K100FLG "K100FLG" true true false 1 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,K100FLG,-1,-1;DFLG "DFLG" true true false 1 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,DFLG,-1,-1;TFLG "TFLG" true true false 1 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,TFLG,-1,-1;BEGIN_POST "BEGIN_POST" true true false 8 Double 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,BEGIN_POST,-1,-1;END_POST "END_POST" true true false 8 Double 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,END_POST,-1,-1;KFCTR "KFCTR" true true false 8 Double 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,KFCTR,-1,-1;K100FCTR "K100FCTR" true true false 8 Double 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,K100FCTR,-1,-1;DFCTR "DFCTR" true true false 8 Double 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,DFCTR,-1,-1;TFCTR "TFCTR" true true false 8 Double 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,TFCTR,-1,-1;FromDate "FromDate" true true false 8 Date 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,FromDate,-1,-1;ToDate "ToDate" true true false 8 Date 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,ToDate,-1,-1;EventID "EventID" true true false 50 Text 0 0 ,First,#,C:\NY_Data.gdb\AADT_Add,EventID,-1,-1'

# Process: Append Events
arcpy.AppendEvents_locref(in_dataset, in_target_event, field_mapping, "ADD", "NO_GENERATE_EVENT_IDS", "GENERATE_SHAPES")

Environments

  • Current Workspace

Licensing information

  • Basic: Requires Roads and Highways
  • Standard: Requires Roads and Highways
  • Advanced: Requires Roads and Highways

Related topics

  • An overview of the Location Referencing toolbox

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal