我的github
posts - 3243,  comments - 42,  views - 158万

编辑器追踪属性

描述

Describe 函数将返回启用了编辑器追踪的数据集的以下属性。

可为要素类镶嵌数据集栅格目录启用编辑器追踪。只有地理数据库数据类型支持编辑器追踪属性。返回的 dataType 是要素类、表、镶嵌数据集或栅格目录的 dataType。

属性

属性 说明 数据类型
editorTrackingEnabled
(只读)

如果对数据集启用编辑器追踪,则为 True。

Boolean
creatorFieldName
(只读)

包含创建要素、行或栅格的用户名的字段名称。

String
createdAtFieldName
(只读)

包含创建要素、行或栅格的日期和时间的字段名称。

String
editorFieldName
(只读)

包含最近编辑要素、行或栅格的用户名的字段名称。

String
editedAtFieldName
(只读)

包含最近编辑要素、行或栅格的日期和时间的字段名称。

String
isTimeInUTC
(只读)

如果 CreatedAt 字段和 EditedAt 字段以 UTC(协调世界时间)存储时间,则为 True。如果以数据库时间存储时间,则为 False。

Boolean

代码示例

编辑器追踪数据集属性示例(独立脚本)

以下独立脚本显示了各位用户最近编辑的要素类中的要素数量。

import arcpy

# Create a Describe object from the feature class
#
gdb_fc = "C:/data/ParcelBase.gdb/parcels_enabled"
desc = arcpy.Describe(gdb_fc)

# If the feature class has editor tracking enabled, then
#   list how many features were last edited by each user.
#
if desc.editorTrackingEnabled:
    #
    # Get the editorFieldName from the describe object
    whoField = desc.editorFieldName
    #
    # Use a cursor to search through all the features
    userDictionary = {}
    cur = arcpy.da.SearchCursor(gdb_fc, [whoField])
    for row in cur:
        featureEditedBy = row[0]
        if featureEditedBy in userDictionary:
            userDictionary[featureEditedBy] += 1
        else:
            userDictionary[featureEditedBy] = 1
    #
    # Print the results
    for user in list(userDictionary.keys()):
        if user == None:
            print('Last edited before editor tracking was enabled: '+ \
                   str(userDictionary[user]))
        else:
            print("Last edited by " + user + ": " + str(userDictionary[user]))
else:
    print('Editor tracking not enabled for '+gdb_fc)

>>https://desktop.arcgis.com/zh-cn/arcmap/10.3/manage-data/editing-fundamentals/enabling-editor-tracking.htm
posted on   XiaoNiuFeiTian  阅读(408)  评论(0编辑  收藏  举报
编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2019-10-21 人工智能之基于Opencv与深度学习的计算机视觉实战课程
2019-10-21 大广角摄像头 畸变矫正 桶形变形
2019-10-21 线检测
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示