Workshop Tutorial Importing XY Data in GIS This tutorial is intended for use by students familiar with Arc GIS who wish to build skills in creating locations on ArcMap using found coordinate data. Workshop Description: Uses GoogleEarth to find XY coordinates of the Seven Wonders of the World. (See previous workshop.) This tutorial uses your current skills with creating formulas in Excel and importing data in ArcMap to create a map of the Seven Wonders. Additional files needed to complete workshop. Suggested Reading and Related Links: http://ce.eng.usf.edu/pharos/wonders/ (information including map on the seven wonders) http://www.biology.ualberta.ca/facilities/gis/uploads/instructions /AVXYData.pdf (a much more confusing tutorial) Workshop Title 1
Importing XY data and attributes into ArcGIS: the World Wonders Revealed! So, you ve gone through the Google Earth workshop and now you have your data points, in Latitude/Longitude (recorded from the Google Earth program), for each World Wonder. That might be something to write home about, but your parents (the poor souls) are not too adept at reading degrees/minutes/seconds. Humans are visual creatures, and therefore, to properly display your accomplishments, you re going to need a world map to accompany your letter home. But how to go from coordinates to ArcMap? This workshop will show you. Step 1: Entering the data First, you need to have the data in a handy format. If you don t need to re-calculate anything, any text editor will work fine. You could enter your coordinates in Notepad, as shown below, and save your work as a.csv file (comma delimited) or as a normal text (.txt) file. But for this exercise, we ll need to make some calculations first, so we re using Excel. Open a new workbook and enter the data using the following setup: Feature_Name Location Northing Easting -- -- Degrees Minutes Seconds Degrees Minutes Seconds Note that you are entering every element of the coordinates (degrees, minutes, and seconds) in a different cell. This will become very important in the next step. Step 2: Calculating decimal degrees Workshop Title 2
Unfortunately, the Lat/Long coordinates are given in a format that is not readily used in GIS (or any other digital analysis, for that matter). For this purpose, we need to convert the data into decimal degrees. Basically, you want all the coordinates in degree format. The general idea is that there are 60 minutes in a degree and 60 seconds in a minute. Therefore, you want to divide minutes by 60 and the seconds by 3600 (60 x 60), and then add it all together. The formula for this is given below: Decimal degrees = Degrees + (minutes/60) + (seconds/3600) For example, if your easting was 31 7 56.32, then your easting in decimal degrees should be something like 31.13231. This is a royal pain to compute by hand, but it is relatively easy in Excel, using relative cell references. How to do it? That s your challenge! Step 3: Exporting the data Once you re done with the calculations, save your results (as an.xls file) and open up a new workbook in Excel. Copy-and-paste the Feature Name and Location columns to the new workbook. Rename the Feature Name column to something that won t violate the rules of ArcGIS (Feature_Name, for example). Now, here s the important part. Any text in your table should be formatted as text, and any numbers should be formatted as numbers. To do this, go to Format : Cells and click on the Number tab. The amount of decimal places the number get is unimportant, as they all carry over anyway. Finally, it isn t strictly necessary, but I like to rename the Northing and Easting columns as Y and X, respectively. Now your data are ready for export. To do this go to File : Save As and save the data as a.csv (comma delimited) file. The DBF4 (.dbf) format should work as well. Excel will complain that certain features cannot be exported, but you can ignore it. Finally, close the file. Excel will ask if you want to save the file, even if you just saved it. But there s no need to go through that again. Just say no! Step 4: Importing to ArcMap Here s where it gets fun. Boot up ArcMap and go to Tools : Add XY Data. Browse to your.csv file. If all your hard work paid, you should now see something akin to the following: Workshop Title 3
If both the X Field and Y Field boxes are blank, however, it means that ArcGIS has rejected your file, and it s back to the drawing board. This happens quite a lot. Before you pull out all your hair, here are some trouble-shooting tips: Make sure your CSV file is closed. Check that your CSV file conforms to standard GIS naming conventions (i.e. no file names longer than 8 characters; no spaces; no weird characters). I just helped someone whose import operation didn t work because there was a # sign in the filename. Make sure that your column headings contain only simple text with no spaces or weird characters. Resave the CSV file as a DBF4 (.dbf) file. Try, try again. Once again, make absolutely sure that all your text (i.e. the column headings) is formatted as text and all your numbers (i.e. the data points) are formatted as numbers. Workshop Title 4
As a last resort, you can open the CSV file in Notepad and re-save it as a normal text (.txt) file. This should cleanse it of any weird formatting that Excel threw in there. Now, assuming that ArcMap hasn t chewed up your file and spit it back out, there would normally be one more thing to do: select a coordinate system. Explaining the ins and outs of coordinate systems would take another workshop altogether, so it s a good thing that you don t have to bother with them. In our case, since that data is in Lat/Long anyway, it doesn t need to be defined. Just click OK and that s that. Life is beautiful sometimes. Step 5: Spicing it up Now you have the World Wonders displayed on your screen as points, but it still doesn t look so hot. To give it more flair, add the world map that is in the same directory this file came in: Click the Add Data button and double-click World.mdb. Click on the countries layer and click the Add button. That helps a little, doesn t it? I ll leave the rest of the spicing-up to you, but if you re a GIS wizard like me, you just might come up with something similar to the following map: Pretty cool, huh? Give it a try for yourself! Workshop Title 5