Importing XY data from text files

Many people work with spatially related data even without recognizing it, for example when dealing with observation or address data from multiple locations. It is easy to make use of spatial information also from data stored in text files, calculation spreadsheets or any database. Often, point data representing  X, Y, and sometimes Z (altitude) coordinates in the real world are contained within text files and can be imported into ArcMap as an Excel spreadsheet (*.xls or *.xlsx), a text file (*.txt), or comma separated value (*.csv) file. To ensure that this is done without problems or annoyances, ensure the data are properly formatted. For example, the field names in the header line of the text file should not use spaces or special characters, nor should the filename.

To add points from a text file (Fig. 15):

  1. Go to File.
  2. Select Add Data.
  3. Select Add XY Data.
  4. Browse to the GISBEEBOOK folder.
  5. Double-click the colony_locations.xlsx file.
  6. Double-click Sheet1$.
  7. Choose the respective fields that hold the X and Y data (or longitude and latitude, depending on which coordinate system is used). If the file contains altitude information, add that field in the Z field. In this case:
    a. X Field: POINT_X
    b. Y Field: POINT_Y
  8. The coordinate system has already been defined for this layer.
  9. Click OK.
    It is important to note that this layer is loaded into ArcGIS and available for any display and map creation purpose and also some basic analysis, but not physically stored as geodata in the file system. A warning dialog box (Fig. 16) may appear which indicates that the created layer will have to be exported to a shapefile if all functionalities are needed.
  10. Click OK.
    Now the points can be seen in the map and the layer can be seen in the TOC.
  11. Right-click the “Sheet1$ Events” layer in the TOC.
  12.  Select Data.
  13. Select Export Data to export these temporary points and make a permanent shapefile.
  14. Choose to use the layer’s source data as the correct coordinate system should have already been set in the previous steps.
  15. Browse to the GISBEEBOOK/ArcGIS folder to name the files intuitively, for example, we will name this layer colony_locations.
  16.  Save as type: Shapefile.
  17.  Click OK.
  18.  Click Yes when asked to display the new layer on the map.
  19.  Remove the Sheet1$ Events layer by right-clicking on Sheet1$ Events layer.
  20.  Select Remove. We now have the permanent shapefile, so this temporary layer is no longer needed (Fig. 17).
  21. To change the symbology of the point layer to make the points more visible, either:
    a. Single-click on the symbol in the TOC and choose the new symbol and size.
    b. Go into the properties of the layer by right-clicking Layer.
    c. Select Properties.
    d. Click the Symbology tab.
    e. Change the symbol to a yellow circle for example.
    f. Click OK.
    Also to note, there are multiple symbol libraries that can be added by clicking the Style References button when in the Symbol Selector dialog box. The symbol libraries provide more options for symbol styles.

Fig. 15. The “Add XY Data” dialog box.


Fig. 16.
The warning dialog box produced which states that the table does not have an Object-ID field when adding a table to ArcMap.


Fig. 17.
A visualization of the colony location point data in ArcMap.