Calculate Central Meridian And Parallels (Cartography)
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.
Usage
-
Input features can be points, lines, or polygons
-
Running this tool directly against a feature class that does not have a projection results in an error. The feature class must be projected.
-
If you are using the tool while ArcMap is open, the resulting spatial reference string will be based on the current 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 Data Driven Pages tool can use this string field to update the data frame coordinate system for each page.
-
The Coordinate System Field 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 get this warning, it is likely that some of the coordinate system strings generated may have been truncated making them useless. When receiving the warning you should delete your results, create a new field of a sufficient length (> 600 characters) and rerun the tool.
-
Use geodatabase feature classes as your input rather than shapefiles. In most cases, the field size limitation of shapefiles makes it likely that PE strings will be truncated if you run this tool on a shapefile.
-
The Standard Parallel Offset 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 latitudinal center. A value of 0.5 (50%) 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
Parameter | Explanation | Data Type |
in_features |
Input feature layer. | Feature Layer |
in_field |
Text field to store the coordinate system string. | Field |
standard_offset (Optional) |
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% or 0.25. Negative values and values greater than 1 are acceptable inputs. | Double |
Code Sample
Calculates the central meridian and optional standard parallels for a set of features.
import arcpy from arcpy import env arcpy.env.workspace = "C:\Data\ProjectData.gdb" arcpy.CalculateCentralMeridianAndParallels_cartography("US_states", "CentralMeridian", 0.25)
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 # 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)