Skip To Content

Apply Building Offsets

Zusammenfassung

Aligns, moves, and hides building marker symbols based on product specification rules defined in an .xml file.

Verwendung

  • The Defense Mapping product files directory contains predefined .xml rule files that can be used for cartographic production. This directory is located at %ProgramData%\Esri\Defense Mapping\Product Files\<ARCGIS_VERSION>\<PRODUCT_SPECIFICATION>\Cartography\Styles.

  • The feature layers referenced in the rule file must have the symbology defined pursuant to the product specification, using Arcade expressions.

  • The layers must have attribute driven symbology enabled for marker symbols.

  • The tool will create a CBO_Rotation field in the Buildings table if one does not already exist and connect the rotation property of Building marker symbols to this attribute.

Syntax

ApplyBuildingOffsets(in_map, rule_file)
ParameterErklärungDatentyp
in_map

The input map that contains the layers with proper symbology. This can be a map in the application or an .mapx file on disk.

Map
rule_file

An .xml file containing the offset rules that define how features will be aligned and refined in case of any conflict.

File

Abgeleitete Ausgabe

NameErklärungDatentyp
updated_map

The updated map with modified building features and symbology.

Map

Codebeispiel

The following Python window script demonstrates how to use the ApplyBuildingOffsets function.

# Name: ApplyBuildingOffsets.py
# Description: This script tool aligns, moves, and hides building marker symbols based
# on product specification rules defined in a rule xml file

# Import System Modules
import arcpy

# Check Out Extensions
arcpy.CheckOutExtension('defense')

# Setting the environment
arcpy.env.overwriteOutput = 1

# Setting Local Variables
in_map = r'C:\Data\MGCP_TRD_4_4.mapx'
rule_file = r'C:\Data\MTM50_TRD_4_4_BuildingOffsets.xml'

# Calling the Apply Building Offsets tool to align, move, and hide building marker symbols based
# on product specification rules defined in a rule xml file
arcpy.topographic.ApplyBuildingOffsets(in_map, rule_file)

# Getting all messages, warnings, and errors from the tool run and printing the results back to the user
messages = arcpy.GetMessages(0)
warnings = arcpy.GetMessages(1)
errors = arcpy.GetMessages(2)
arcpy.AddMessage('Tool Messages: {}\nTool Warnings: {}\nTool Errors{}\n'.format(messages, warnings, errors))

# Check In Extensions
arcpy.CheckInExtension('defense')

Umgebungen

Dieses Werkzeug verwendet keine Geoverarbeitungsumgebungen.

Lizenzinformationen

  • Basic: Nein
  • Standard: Nein
  • Advanced: Erfordert Production Mapping

Verwandte Themen