Convert Coordinate Notation (Data Management)
Summary
Converts a table containing point coordinate fields to a point feature class. The input table's coordinate fields can be in a variety of notations, such as GARS, UTM, and MGRS. The output point feature class also contains point coordinate fields in a coordinate notation of your choosing.
Usage
The input coordinate fields can be in any of the following notations. The point output feature class will also have coordinate fields in any of these notations.
- decimal degrees (DD)
- decimal minutes (DDM)
- degrees-minutes-seconds (DMS)
- Global Area Reference System (GARS)
- World Geographic Reference System (GEOREF)
- Universal Transverse Mercator (UTM)
- United States National Grid (USNG)
- Military Grid Reference System (MGRS)
-
Decimal degree (DD) coordinates are two strings and must be in the format DDD.dddd.
Decimal minute (DDM) coordinates are two strings and must be in the format DDD MM.mmmm.
Degree-minute-second (DMS) coordinates are single string and must be in the format DD MM SS.ssss DDD MM SS.ssss. Latitude is first followed by longitude separated by spaces.
GARS, GEOREF, UTM, USNG, and MGRS are single-string coordinate formats, meaning only one field contains the coordinate. When converting from one of these formats only the X Field will be used.
Field names in the output point feature class match the output coordinate notation name. For example, MGRS coordinates will be stored in a field named MGRS. If the field name exists, a new sequential field will be added (e.g., MGRS1, MGRS2, MGRS3, and so on).
Fields from the input table are not copied to the output feature class. You can use the Join Field tool to copy fields from the input table to the output feature class.
The Make XY Event Layer tool can be used to create a feature class from a table containing x,y coordinate fields.
The Add XY Coordinates tool can be used to add POINT_X and POINT_Y fields to a point's attribute table. These fields will contain the coordinates of the point,. These fields can then be used for the X Field and Y Field parameters of this tool.
Syntax
Parameter | Explanation | Data Type |
in_table |
Table containing the coordinate field(s) to convert. | Table View |
out_featureclass |
Output feature class of points. The attribute table will contain a field of the converted coordinates. | Feature Class |
x_field |
X coordinate field name in the Input Table. For DD and DDM this is the longitude field. For DMS, GARS, GEOREF, UTM, USNG, and MGRS, this is the only field as these are single-string coordinate types. | Field |
y_field |
Y coordinate field name in the input table. For DD and DDM this is the latitude field. This parameter is disabled for DMS, GARS, GEOREF, UTM, USNG, and MGRS. | Field |
input_coordinate_format |
Coordinate format of the input fields. The default is DD.
| String |
output_coordinate_format |
Format of the output coordinates in the output point feature class. The default is DD.
| String |
id_field (Optional) |
ID field from the input table. This may be used to join the output features back to the input table. | Field |
spatial_reference (Optional) |
Spatial reference of the input coordinates. The default is GCS_WGS_1984. | Spatial Reference |
Code Sample
Basic ConvertCoordinateNotation usage with one input field.
#Imports import arcpy #Locals in_tab = r"c:\workspace\inmed.gdb\loc_mgrs" out_pts = r"c:\workspace\inmed.gdb\loc_final" #Convert Coordinate Notation with MGRS as input field. arcpy.ConvertCoordinateNotation_management(in_tab,out_pts,"m10d","#","MGRS","DD")
Basic ConvertCoordinateNotation usage with two input fields.
#Imports import arcpy #Locals in_tab = r"c:\workspace\mtf.gdb\rit_up_DD" out_pts = r"c:\workspace\mtf.gdb\ritLOC" #Convert Coordinate Notation with DD as input fields. arcpy.ConvertCoordinateNotation_management(in_tab,out_pts,"LON","LAT","DD","GARS")