Adding x,y coordinate data as a layer
In addition to data sources, such as a shapefile, you can add tabular data that contains geographic locations in the form of x,y coordinates to your map. If the table also contains z-coordinates, such as elevation values, you can add tabular data as 3D content into your globe or scene.
X,Y coordinates describe points on the earth's surface such as the location of fire hydrants in a city or the points where water samples were collected. You can easily collect x,y coordinate data using a GPS (also, frequently an elevation [z]-value).
To add a table of x,y coordinates to your map, globe, or scene, the table must contain two fields, one for the x-coordinate and one for the y-coordinate. The values in the fields may represent any coordinate system and units such as latitude and longitude or meters. A field for the z-coordinates that enables 3D geometry is optional.
The fields must be numeric. For example, if the coordinate value is stored in degrees, minutes, and seconds in a field (for example, -120 13 58), you'll need to convert the values to decimal degrees and store them in a numeric field.
Once you have added the data to your map, globe or scene, it becomes an x,y event layer and behaves like other point feature layers. For instance, you can decide whether you want to display it, symbolize it, set the visible scale, or display a subset of features that meet some criteria. In 3D, you can also change properties such as the layer's vertical exaggeration or its offset from an elevation surface.
Steps for adding x,y data as a layer
- Click File > Add Data > Add XY Data.
- Select the table that contains x,y coordinate data.
- Identify the columns that hold the x- and y-coordinates (and, optionally, the z-coordinate).
- Specify the coordinate system.
You can also add x,y data in tables as a new feature class using geoprocessing.
As an alternative, you can use the Catalog window to select the table that contains the x,y columns and create a feature class.
X,Y event layers and ObjectID fields
If the table on which an x,y event layer is based does not have an ObjectID field, you won't be able to perform certain tasks on the layer. Delimited text files or tables from OLE DB connections are some examples of tables without ObjectID fields.
Without an ObjectID field, you will not be able to do the following:
- Select features in the map layer.
- Perform operations that utilize the selection set such as navigating from the table to the map.
- Edit layer attributes. However, you can edit the table the layer is based on directly on disk such as in a text editor if the file is a .txt file—including changing the x-, y-, and z-coordinates of the point features. Your changes will be reflected the next time you refresh the view.
Note that you can start an edit session on an x,y event layer if the table it is based on has an ObjectID field and if the data source is editable. This will let you edit the layer's attributes in the table window—including editing the x-, y-, and z-coordinate fields manually to change the location of the points in the layer.
- Perform any interactive edits, such as select points in an edit session and move them around, delete them, and add new points, on any x,y event layer. This is true whether or not the table it is based on has an ObjectID field.
- Define a relate.
If you want to be able to perform these tasks, you can export the x,y layer to a feature class using the steps below or follow the steps above to use the Catalog window to create a feature class from an x,y table. Both of these procedures create a fully functional feature class with an ObjectID field.
Converting degrees/minutes/seconds to decimal degrees
To create a point layer from x,y coordinates, the coordinates need to be in decimal degrees. There are several ways to convert degrees/minutes/seconds (DMS) data into decimal degrees.
To convert it manually, use the following formula:
Decimal Degrees = Degrees + ((Minutes / 60) + (Seconds / 3600))
For example, 75 59 32.483 W would be -75.9923564 in decimal degrees. DMS is often followed by the hemisphere labels of N, S, E, or W. When converting to decimal degrees, convert longitude values that are in the western hemisphere or latitude values that are in the southern hemisphere to negative decimal degree values.
You can also use an advanced expression in the Field Calculator or use programming to perform the conversion automatically.
Saving an x,y layer as a feature class
You can save the contents of an x,y layer as a feature class using the following steps:
- Right-click the x,y layer name and click Data > Export Data. The Export Data dialog box opens.
- Set the output coordinate system and specify the location and name of the new feature class.
- Click OK to save the new feature class.