Division of Archaeology computer support

Computing

How to plot a database of points using ArcGIS on the PWF

Introduction

This document describes how to FIXME. You can always obtain the latest version of this document from: http://www.arch.cam.ac.uk/comp/FIXME/

This document describes how to plot a database of points, for example a list of archaeological sites with names and locations, using ArcGIS on the PWF.

For a relatively simple data set, the easiest way to proceed is to construct a list of sites or points in so-called CSV (Comma Separated Values) format. Consider the following sites:

Place Longitude Latitude
Xaghra 14.2667 E 36.0500 N
Troina 14.6167 E 37.7833 N
Nepi 12.3500 E 42.2333 N
Gubbio 12.5833 E 43.3500 N

Because E (East) and N (North) are positive (West and South would be negative), we can discard that information and create an Excel spreadsheet that looks like this:

_images/ac055-01.png

You must be circumspect when choosing the column titles. Some words are so-called reserved words and ArcGIS will be unhappy should you try to use them. (No, I haven’t managed to find a list of these reserved words, although I’m sure I once saw one). Do not use punctuation, spaces, non-ASCII characters in the column headings. ArcGIS will choke on these but won’t bother to explicitly tell you that it doesn’t like them. In other words, `x’ is a good column heading for the x co-ordinates. `grid x’ is not. `Place’ is a good heading for the column of site names. `Site name’ is not. Anyway, enough of this carefree banter. Go to the File menu in Excel and choose Save As. You will see the Save As dialogue box:

_images/ac055-02.png

Set Save as type: to CSV:

_images/ac055-03.png

Choose somewhere sensible, and select a sensible filename. ArcGIS will choke on various characters in the file name so use only the letters A-Z and numbers 0-9—no spaces, punctuation, or other rubbish:

_images/ac055-04.png

When you click the Save button Excel will ask you a series of stupid questions. Say OK, pausing only to note that if your spreadsheet contains multiple workbooks you will need to export each one individually:

_images/ac055-05.png

Another stupid question. Say Yes:

_images/ac055-06.png

When you try to close Excel, even if you haven’t made any changes since doing the Save As bizzo described above, you may see the message below. Assuming you haven’t made any changes, say No:

_images/ac055-07.png

Find the CSV file that you have just created:

_images/ac055-08.png

Right-click on it and choose Open With:

_images/ac055-09.png

Choose Notepad:

_images/ac055-10.png

This is what a CSV file looks like. You can see that each piece of information is separated from the next by a comma. It should be obvious to you that:

  1. These files are extremely easy to create by simply typing directly into Notepad if you don’t want to muck around with Excel
  2. Including commas in your data set (other than as delimiters) is going to make everybody very unhappy.

On occasion, ArcGIS chokes when trying to import a CSV file that contains a trailing blank line, so it is a good idea, if you create your CSV file using Excel, to subsequently open the CSV file in Notepad, scroll right to the end of it and delete any blank lines.

_images/ac055-11.png

OK. You should now be the proud possessor of a a CSV file, either by creating one using the information above, or because you have created one containing data that is of interest to you. Start ArcMap by clicking on the Start button in the bottom left hand corner of the screen:

_images/ac055-12.png

Choose PWF Programs:

_images/ac055-13.png

Choose Database Packages:

_images/ac055-14.png

Choose ArcGIS:

_images/ac055-15.png

Choose ArcMap:

_images/ac055-16.png

ArcMap starts up:

_images/ac055-17.png

Go to the Tools menu and choose Add XY Data:

_images/ac055-18.png

Browse and find your CSV file, then click the Add button:

_images/ac055-19.png

If you have named two columns Lat and Long, or X and Y, ArcMap will automagically identify them as containing co-ordinates:

_images/ac055-20.png

Click the Edit button to set the projection. The Spatial Reference Properties dialogue appears:

_images/ac055-21.png

Click the Select button:

_images/ac055-22.png

Choose an appropriate Coordinate System. Only you can know which one is correct for your data set. For the example data above, I’m just using simple Decimal Degree data with the WGS 84 datum.

_images/ac055-23.png _images/ac055-24.png _images/ac055-25.png

Once you’ve set a projection, click the OK button:

_images/ac055-26.png

Click the OK button:

_images/ac055-27.png

Your points appear in ArcMap. To avoid repetition of this process, and for other good reasons which temporarily escape me, it is a good idea to convert the imported CSV data set into a shapefile.

_images/ac055-28.png

Right-click on the data set and choose Data then Export Data:

_images/ac055-29.png

Change the output file name from Export_Output.shp to something meaningful, retaining the .shp extension and click OK:

_images/ac055-30.png

There will be some clicking and whirring and then you will be asked:

_images/ac055-31.png

You may as well say yes. The picture below shows both data sets:

_images/ac055-32.png

If you look in the directory containing the shapefile you have just created, you will see the five files that actaully constitute a so-called shapefile. Interesting, eh? But worth bearing in mind. The .prj file is optional: It contains projection information. If it is present you need to copy it along with the other files constituting the Shapefile.

_images/ac055-33.png

Here endeth the lesson. You can find more ArcGIS-related entertainment here.