Calculate Layer Snapshot (Production Mapping)

ライセンス レベル:BasicStandardAdvanced

サマリ

Calculates a snapshot of a feature layer by creating a snapshot value of feature geometry, extent, and symbology. The tool stores the snapshot value in a long integer field in the Input Features feature class. The Compare Layer To Snapshot tool uses the snapshot value to identify changes to geometry, extent, and symbology in a layer across multiple map documents.

The tool can optionally populate metadata including date and time, user name, reference scale, and an historical string. Metadata is also written to the Input Features feature class.

使用法

構文

CalculateLayerSnapshot_production (in_features, snapshot_field_name, {hist_string}, {history_field_name}, {date_field_name}, {username_field_name}, {output_workspace}, {reference_scale}, {refscale_field_name}, {fc_suffix})
パラメータ説明データ タイプ
in_features
[in_features,...]

List of feature layers to populate with snapshot information.

Layer
snapshot_field_name

The name of the field that will store the snapshot value. The field type must be LONG.

Field
hist_string
(オプション)

A string to insert into the history_field_name field. Use to define a custom historical note.

String
history_field_name
(オプション)

The name of the field that will store the historical string. The field type must be TEXT.

Field
date_field_name
(オプション)

The name of the field that will store date and time values. The field type must be DATE.

Field
username_field_name
(オプション)

The name of the field that will store a user name. The field type must be TEXT.

Field
output_workspace
(オプション)

The workspace that will store the output of Feature Outline Masks. This parameter requires that you set reference_scale and refscale_field_name.

Workspace
reference_scale
(オプション)

The scale in which a symbol appears at its true size. The Feature Outline Masks tool uses reference scale to calculate masking geometry. This parameter requires that you set output_workspace first.

Double
refscale_field_name
(オプション)

The name of the field that will store the reference_scale value. The tool creates this field in the output feature class created by Feature Outline Masks . This parameter requires that you set output_workspace first.

String
fc_suffix
(オプション)

The suffix that will be appended to the feature layer name specified in input_features. The suffix defaults to _LayerSnapshot.

String

コードのサンプル

CalculateLayerSnapshot example (stand–alone script)

The following stand-alone script demonstrates how to use the CalculateLayerSnapshot tool.

# Name: CalculateLayerSnapshot_Standalone.py
# Description: Creates a layer snapshot on sample data.
# Requirements: Esri Production Mapping

import arcpy

# check out a foundation license
arcpy.CheckOutExtension("Foundation")

# use the RailRoadL feature class from sample data
railroads = "C:/data/Austin.gdb/TopographicMap/RailroadL"
railLayer = "railLayer"
snapfield="snapshot"

# calculateLayerSnapshot tool requires a feature layer
arcpy.MakeFeatureLayer_management(railroads,railLayer)

# check for the snapshot field
fieldNames = [f.name for f in arcpy.ListFields(railLayer,snapfield,"LONG")]
if fieldNames.count(snapfield) < 1:
    arcpy.AddField_management(railLayer,snapfield,"LONG")

# exec the tool
arcpy.CalculateLayerSnapshot_production(railLayer,snapfield)
print arcpy.GetMessages()
CalculateLayerSnapshot example 2 (Python window)

The following Python window script demonstrates how to use the CalculateLayerSnapshot tool.

import arcpy

# set gp environment
work="c:/data"
arcpy.env.workspace=work
arcpy.env.addOutputsToMap = True
arcpy.env.overwriteOutput = True

# in_features variables
buildingP="Austin.gdb/TopographicMap/BuildingP"
buildingLyr="buildingLyr"
snapfield="snapshot"
histfield="history"
datefield="date_time"
namefield="username"

# optional parameter data
history="Calculate layer snapshot for BuildingP"
extWork="outExtents.gdb"
refScale=12000
refField="refscale"
fcSuffix="buildP_snapshot"

# make a feature layer for in_features
arcpy.MakeFeatureLayer_management(buildingP,buildingLyr)

# add layer snapshot fields to in_features
arcpy.AddField_management(buildingP,snapfield,"LONG")
arcpy.AddField_management(buildingP,histfield,"TEXT")
arcpy.AddField_management(buildingP,datefield,"DATE")
arcpy.AddField_management(buildingP,namefield,"TEXT")
arcpy.AddField_management(buildingP,refField,"LONG")

# create a new fGdb to store the snapshot data
if arcpy.Exists("outExtents.gdb")==False:
    arcpy.CreateFileGDB_management(work,"outExtents.gdb")

# invoke the tool
arcpy.CalculateLayerSnapshot_production(buildingLyr,snapfield,history,histfield,datefield,namefield,extWork,refScale,refField,fcSuffix)

環境

関連トピック

ライセンス情報

ArcGIS for Desktop Basic: ×
ArcGIS for Desktop Standard: 次のものが必要 Production Mapping
ArcGIS for Desktop Advanced: 次のものが必要 Production Mapping
4/26/2014