概要
Defense Mapping configuration tool that calculates representation symbology to the input features. This tool calculates symbology for many layers and links feature attributes to representation rules and label expressions.
使用法
You can calculate multiple visual specifications to multiple input feature layers.
The Input Visual Specifications Workspace contains the visual specifications you can apply to input features.
This tool calculates fields for the input features. The number and names of the fields will vary but will include the following:
- A field that holds the representation rule number. This is known as the representation rule field.
- An Override field associated with the representation to store symbol exception information. The Override field contains exception information on an individual representation.
The Representation Rule field contains the number of the symbol being used for the feature class in association with feature class representations.
構文
arcpy.defense.CalculateRepresentationFields(in_features, in_visual_spec_workspace, in_specs)
パラメーター | 説明 | データ タイプ |
in_features [in_features,...] | The feature classes for which you want the visual specifications field calculated. | Feature Layer |
in_visual_spec_workspace | The location of the workspace that contains the visual specifications table (VST_Specification). This table can be stored in a personal, file, or enterprise geodatabase. | Workspace |
in_specs [in_specs,...] | The visual specifications you want to apply to the selected feature layers and feature classes. | String |
派生した出力
名前 | 説明 | データ タイプ |
out_features | Input Features with representation fields calculated. |
コードのサンプル
CalculateRepresentationFields example 1 (stand-alone script)
The following code example demonstrates how to execute the CalculateRepresentationFields tool.
# Set up input features, visual specification database, and specification
features = "C:/Example/example.gdb/MGCP/AerofacA;C:/Example/example.gdb/MGCP/AerofacP;C:/Example/example.gdb/MGCP/AgristrA;C:/Example/example.gdb/MGCP/AgristrP"
visualSpecification = "C:/Program Files (x86)/ArcGIS/EsriDefenseMapping/Desktop10.4/Mgcp/Cartography/Symbology/MGCP_TRD_4_3_MTM_Visual_Specification.mdb"
specification = "'MGCP_50K :: MGCP TRD 4.3 Visual Specification for MGCP Topographic Map (MTM)'"
# Running Calculate Representation Fields tool
arcpy.CalculateRepresentationFields_defense(features, visualSpecification, specification)
CalculateRepresentationFields example 2 (stand-alone script)
The following code example demonstrates how to execute the CalculateRepresentationFields tool.
# Running Calculate Representation Fields getting the features from a database
# Importing arcpy, os and string modules
import arcpy, os, string
# Checking out Defense extension
arcpy.CheckOutExtension('defense')
# Setting input database
input_database = r'C:\Data\MGCP_TRD_4_2.gdb'
# Getting feature classes from database
arcpy.env.workspace = input_database
feature_classes = []
feature_datasets = arcpy.ListDatasets('*', 'Feature')
for dataset in feature_datasets:
fclass = arcpy.ListFeatureClasses('*', '', dataset)
for fc in fclass:
feature_classes.append(os.path.join(input_database, dataset, fc))
# Converting feature classes into layers
layer_list = []
for feat_class in feature_classes:
class_name = string.split(os.path.split(feat_class)[1], '.')[-1]
arcpy.management.MakeFeatureLayer(feat_class, class_name)
layer_list.append(class_name)
# Creating string for input to Calculate Representation Fields tool
feature_string = ''
for layer in layer_list:
feature_string += '{};'.format(layer)
# Setting input variables
specification_database = r'C:\DefenseProductFiles\Mgcp\Cartography\Symbology\MGCP_TRD_4_2_MTM_Visual_Specification.gdb'
specification = 'MGCP_50K :: MGCP TRD 4.2 Visual Specification for MGCP Topographic Map (MTM)'
# Calling Calculate Representation Fields tool
arcpy.defense.CalculateRepresentationFields(feature_string, specification_database, specification)
# Checking in Defense extension
arcpy.CheckInExtension('defense')
環境
ライセンス情報
- Basic: いいえ
- Standard: 次のものが必要 Defense Mapping
- Advanced: 次のものが必要 Defense Mapping