获得 Production Mapping 许可后可用。
描述
Computes the magnetic field at point locations for given date and altitude.
使用方法
The Input Features parameter value must be points. You can filter input points by applying a layer definition query or selection set.
The Altitude parameter specifies the elevation as a linear unit of the input points. The Altitude value must be a numeric value above sea level. Do not use decimal degrees or unknown units.
The Altitude parameter applies the same elevation value to all points in the Input Features parameter. To use a different altitude value for each input point, use the Iterate Feature Selection or Iterate Field Value tool in 模型构建器. The iterator can pass a value to the Altitude parameter. In this configuration, the tool runs once per input point.
Magnetic field values are written to existing fields. This tool does not create fields. To add a field, use the Add Field tool.
The Magnetic Component parameter field controls the type of magnetic field calculation. You must specify a magnetic component and an existing field to write to. You can calculate up to nine magnetic component types.
To use the Grid variation magnetic component, you must set the ArcGIS Pro data frame coordinate system to Lambert Conformal Conic. If you specify Grid variation with another coordinate system, the tool will fail.
This tool uses the World Magnetic Model 5-year epoch specific to the data provided. For example, if the data specified is from 2020, the model epoch released at the end of 2019 is used.
警告:
此工具会修改输入数据。有关详细信息以及避免数据被意外更改的策略,请参阅修改或更新输入数据的工具。
语法
arcpy.topographic.CalculateMagneticComponents(in_features, altitude, date, magnetic_component)
参数 | 说明 | 数据类型 |
in_features | The point features for which magnetic field values will be calculated. | Feature Layer |
altitude | The elevation of the in_features value including the linear unit. Do not use decimal degrees or unknown units. The default is 0 meters. | Linear Unit |
date | The date for which magnetic field values will be calculated. The date must be valid for the specified World Magnetic Model. The format must use two digits for the month, two digits for the day, and four digits for the year. The default is the system current date. | Date |
magnetic_component [[component, field],...] | The magnetic component to calculate and the field to which the values will be written.
| Value Table |
派生输出
名称 | 说明 | 数据类型 |
updated_features | The in_features layer with the chosen fields updated. | Feature Layer |
代码示例
The following code sample demonstrates how to use the CalculateMagneticComponents tool in Python.
# Name: CalculateMagneticComponents_sample.py
# Description: Calculates four types of magnetic component fields for a feature class.
# Import System Modules
import arcpy
# Check Out Extensions
arcpy.CheckOutExtension('Foundation')
# Setting Data Variables
ElevP2 = r'C:\Data\Edit_Sample.gdb\Features\ElevP'
ElevP_Layer = 'ElevP_Layer'
# Make Feature Layer from the ElevP feature class
arcpy.MakeFeatureLayer_management(ElevP2, ElevP_Layer)
# Add four magnetic component fields
arcpy.AddField_management('ElevP_Layer', 'Declination', 'LONG')
arcpy.AddField_management('ElevP_Layer', 'Annual_Drift', 'LONG')
arcpy.AddField_management('ElevP_Layer', 'Inclination', 'LONG')
arcpy.AddField_management('ElevP_Layer', 'Horizontal', 'LONG')
# Setting Local Variables
altitude = '1 Feet'
date = '1/1/2010'
magnetic_component = 'DECLINATION Declination;ANNUAL_DRIFT Annual_Drift;INCLINATION Inclination;HORIZONTAL Horizontal'
# Execute Calculate Magnetic Components
arcpy.CalculateMagneticComponents_topographic('ElevP_Layer', altitude, date, magnetic_component)
# Check In Extensions
arcpy.CheckInExtension('Foundation')
环境
许可信息
- Basic: 否
- Standard: 需要 Production Mapping
- Advanced: 需要 Production Mapping