Calculate UTM Zone (Cartography)
Summary
Calculates a UTM zone of each feature based on the center point and stores this spatial reference string in a specified field. This field can be used in conjunction with Data Driven Pages to update the spatial reference to the correct UTM zone for each map.
Usage
-
Input features can be points, lines, or polygons.
-
Geometries located at extreme latitudes, near either the North or the South poles, may not be appropriate for UTM zone calculation. You will receive a warning when a UTM zone cannot be calculated for a particular feature.
-
The datum for the calculated UTM coordinate system string is taken from the datum of the active data frame's coordinate system. If the datum of the feature's data source is different than the data frame's, you will get a warning. A UTM zone is calculated, however, the result may not be accurate. The tool does not perform any geotransformations. In order to get the best results, the datum of your input features should be the same as the datum used by the data frame.
-
The UTM Zone Field, which contains the UTM spatial reference string, should have a length of 600 characters or more. Spatial reference 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 spatial reference string has been truncated because the field length is not long enough. If you get this warning, it is likely that some of the spatial reference 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. In most cases, the field size limitation of shapefiles makes it likely that spatial reference strings will be truncated if you run this tool on a shapefile.
Syntax
Parameter | Explanation | Data Type |
in_features |
Input feature layer. | Feature Layer |
in_field |
String field that stores the spatial reference string for the coordinate system. Field should have sufficient length (more than 600 characters) to hold the spatial reference string. | Field |
Code Sample
Calculates a custom UTM zone for a set of features.
import arcpy from arcpy import env arcpy.env.workspace = "C:\Data\ProjectData.gdb" arcpy.CalculateUTMZone_cartography("US_Counties", "UTM_Zone")
Calculates a custom UTM zone for a set of features.
# Name: calculateutmzone_example.py # Description: Calculates a custom UTM zone 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" utmField = "UTM_zone" # Execute CalculateUTMZone arcpy.CalculateUTMZone_cartography(inFeatures, utmField)