Available with Advanced license.
Summary
Adds the items X-COORD and Y-COORD for labels or points to the input coverage PAT, or for nodes to the input coverage NAT, and calculates their values.
The tool determines the feature classes of the input coverage and lists those available to which x,y coordinates can be added. The tool is most commonly used to gain access to a coverage's geometry to perform queries and analysis or to extract points or nodes based on their x,y location.
Illustration
Usage
If the items X-COORD and Y-COORD already exist, they will be overwritten.
If the input coverage is single precision, the items will be defined with Item width 4, Display width 12, Item type F, and Decimal places 3. If the input coverage is double precision, the items will be defined with Item width 8, Display width 18, Item type F, and Decimal places 5. Once defined, this definition will not change even if the derived precision is changed.
If the point or node locations are moved after using Add XY Coordinates, the X-COORD and Y-COORD values will not represent the new locations. To update their values to the new location, rerun the tool. The values for X-COORD and Y-COORD are not modified by other tools, such as Project and Transform.
If your input coverage is in a geographic coordinate system, the X-COORD and Y-COORD represents the longitude and latitude, respectively.
Syntax
AddXY(in_cover, {feature_type})
Parameter | Explanation | Data Type |
in_cover | The coverage containing points or polygon labels whose x,y coordinates will become attributes in the PAT, or in the coverage containing nodes, to the NAT. | Coverage |
feature_type (Optional) | Type of coverage feature whose x,y coordinates will become feature attributes.
| String |
Code sample
AddXY example (stand-alone script)
The following stand-alone script demonstrates how to add X-COORD and Y-COORD items to a coverage's PAT. The items are populated with the coordinate values from the coverage's point features.
# Name: AddXY_Example.py
# Description: Adds X and Y coordinates to a coverage's point attribute table
# Requirements: ArcInfo Workstation
# Import system modules
import arcinfo
import arcpy
from arcpy import env
# Set environment settings
env.workspace = "C:/data"
# Set local variables
inCover = "wells"
featureType = "POINT"
#Execute AddXY
arcpy.AddXY_arc(inCover, featureType)
Environments
Licensing information
- Basic: No
- Standard: No
- Advanced: Requires ArcInfo Workstation installed