ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

Append Events

适用于 Location Referencing 许可。

  • 描述
  • 使用方法
  • 语法
  • 代码示例
  • 环境
  • 许可信息

描述

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

使用方法

  • 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.

语法

arcpy.locref.AppendEvents(in_dataset, in_target_event, field_mapping, {load_type}, {generate_event_ids}, {generate_shapes})
参数说明数据类型
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
(可选)

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
(可选)

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
(可选)

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

派生输出

名称说明数据类型
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

代码示例

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")

环境

  • 当前工作空间

许可信息

  • Basic: 需要 Roads and Highways
  • Standard: 需要 Roads and Highways
  • Advanced: 需要 Roads and Highways

相关主题

  • An overview of the Location Referencing toolbox

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS

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

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2021 Esri. | 隐私政策 | 法律声明