Summary
Calculates the central meridian and optional standard parallels based on the center point of a feature's extent; stores this coordinate system as a spatial reference string in a specified text field; and repeats this for a set, or subset, of features. This field can be used with a spatial map series to update the data frame coordinate system for each page.
Usage
Input features can be points, lines, or polygons
Running this tool directly on a feature class that does not have a projection results in an error. The feature class must be projected.
If you use the tool while ArcGIS Pro is open, the resulting spatial reference string will be based on the projection of the active data frame. The data frame must be in a projected coordinate system for the tool to work; otherwise, you will receive an error message.
The Coordinate System Field parameter must be a text field and should have a length of 600 characters or more. Coordinate system strings vary in length but are usually quite long, and you need to ensure that the field has enough space. The tool will issue a warning if the coordinate system string has been truncated because the field length is not long enough. If you receive this warning, some of the coordinate system strings generated may have been truncated making them useless. If you receive this warning, delete your results, create a field of sufficient length (more than 600 characters), and rerun the tool.
Use geodatabase feature classes as your input rather than shapefiles. In most cases, field size limitation makes it likely that coordinate system strings will be truncated if you run this tool on a shapefile.
The Standard Parallel Offset parameter is a percentage of the latitudinal height extent of the input feature. The offset from the latitude of the center of the input feature is calculated using this percentage. A Standard Parallel Offset value of 0 results in parallel values equal to the latitude of the input feature's latitudinal center. A value of 0.5 (50 percent) results in parallels approximate to the latitudinal height, with parallels at the top and the bottom, of the feature. Values greater than 0.5 will place the parallels outside the latitudinal bounds of the input feature. The default value is 0.25. This places the parallels approximately halfway from the latitudinal center of the feature and its latitudinal edges. Negative values and values greater than 1 are acceptable inputs.
Syntax
arcpy.cartography.CalculateCentralMeridianAndParallels(in_features, in_field, {standard_offset})
Parameter | Explanation | Data Type |
in_features | The input feature layer. | Feature Layer |
in_field | The text field where the coordinate system string will be stored. | Field |
standard_offset (Optional) | The percentage of the height of the input feature used to offset the standard parallels from the center latitude of the input feature. The default is 25 percent or 0.25. Negative values and values greater than 1 are acceptable inputs. | Double |
Derived Output
Name | Explanation | Data Type |
out_features | The updated feature class with the calculated central meridian and standard parallels. | Feature Layer |
Code sample
The following example calculates the central meridian and optional standard parallels for a set of features.
import arcpy
arcpy.env.workspace = "C:\Data\ProjectData.gdb"
arcpy.CalculateCentralMeridianAndParallels_cartography("US_states", "CentralMeridian", 0.25)
The following example calculates the central meridian and optional standard parallels for a set of features.
# Name: calculatecentralmeridianandparallels_example.py
# Description: Calculates the central meridian and optional standard parallels
# for a set of features
# Author: ESRI
# Import system modules
import arcpy
from arcpy import env
# Set environment settings
arcpy.env.workspace = "C:\Data\ProjectData.gdb"
# Set local variables
inFeatures = "US_states"
coordsysField = "CentralMeridian"
standardOffset = 0.25
# Execute CalculateAdjacentFields
arcpy.CalculateCentralMeridianAndParallels_cartography(inFeatures,
coordsysField,
standardOffset)
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes