{"id":623,"date":"2015-04-16T10:38:43","date_gmt":"2015-04-15T22:38:43","guid":{"rendered":"https:\/\/blogs.otago.ac.nz\/si-geology\/?p=623"},"modified":"2015-04-24T15:19:33","modified_gmt":"2015-04-24T03:19:33","slug":"adding-xy-data-to-arcgis","status":"publish","type":"post","link":"https:\/\/blogs.otago.ac.nz\/si-geology\/adding-xy-data-to-arcgis\/","title":{"rendered":"Adding XY data to ArcGIS"},"content":{"rendered":"<p>This tutorial covers adding XY data to ArcGIS, so that you can view and work with the data in ArcGIS. By XY data I mean point data such as foliation that has a spatial (XY) component associated with it.<\/p>\n<p><!--more--><\/p>\n<h2>Where to get the files for this tutorial<\/h2>\n<ul>\n<li><a href=\"http:\/\/download.otagogeology.org.nz\/training\/AddXYdatafiles.zip\">AddXYdatafiles.zip<\/a><\/li>\n<\/ul>\n<h2>Adding XY data to ArcGIS screencast<\/h2>\n<p>The video below covers most of the steps for adding XY data apart from the problem solving tips that are only covered on this page.<\/p>\n<p>httpv:\/\/youtu.be\/vmEPsc8NnT0<\/p>\n<h2>Adding XY data to ArcGIS text instructions<\/h2>\n<p>There are ways to open a spreadsheet directly in ArcGIS, but in my experience there are often problems. It is also possible to convert directly from an excel spreadsheet, but this is unreliable. My preferred technique is to convert from .csv format to shapefile or feature class (in geodatabase).<\/p>\n<h2><a name=\"_Toc410666704\"><\/a>1.1\u00a0\u00a0\u00a0 Checking the XY data<\/h2>\n<p>It\u2019s important to check your data first!<\/p>\n<ol>\n<li>Get the folder <strong>\u201cAdd XY data files\u201d<\/strong> and extract it.<\/li>\n<li>There is a map on the top level and a folder with data in it. This is how I like to manage maps and data in ArcGIS.<\/li>\n<li>Open the data folder and open up the <strong>\u201cfoliation-wt.xlsx\u201d <\/strong><\/li>\n<li>The data has been prepared so that it is ready to be added into ArcGIS.<\/li>\n<\/ol>\n<p>Here are some of the features that make this XY data suitable<\/p>\n<ul>\n<li>It has a single header row with clearly marked fields<\/li>\n<li>It has Eastings and Northings and the Map projection is indicated (NZTM).<\/li>\n<li>All columns with numbers in them only have numbers (they can therefore be recognised as number fields).<\/li>\n<\/ul>\n<h2>1.2\u00a0\u00a0\u00a0 Saving data as CSV<\/h2>\n<p>But this data is in excel format. So we need to save it as CSV.<\/p>\n<ol>\n<li>In excel choose <strong>File&gt;Save As <\/strong>and choose the location where the excel file <strong>\u201cfoliation-wt.xlsx\u201d<\/strong> is stored.<\/li>\n<li>In save as type choose CSV (Comma delimited) (*.csv)<br \/>\n<a href=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-624\" src=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image1.png\" alt=\"image1\" width=\"306\" height=\"335\" srcset=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image1.png 306w, https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image1-274x300.png 274w\" sizes=\"auto, (max-width: 306px) 100vw, 306px\" \/><\/a><\/li>\n<li>Excel will warn you that some features will be lost. Select \u2018Yes\u2019 we want to save as CSV. CSV is for storing data, it can\u2019t store formulas, graphs, multiple sheets and other things like .xlsx can.<br \/>\n<a href=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-625\" src=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image2.png\" alt=\"image2\" width=\"538\" height=\"128\" srcset=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image2.png 538w, https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image2-300x71.png 300w, https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image2-500x118.png 500w\" sizes=\"auto, (max-width: 538px) 100vw, 538px\" \/><\/a><\/li>\n<li>Close the file. Excel will keep the file open with all excel editable features intact, but will change the file name extension to .csv. This will mean that excel will ask whether you want to save changes when you try to close the file, you can just select \u201cDon\u2019t Save\u201d OR if you haven\u2019t saved some changes you want to preserve in excel format you can do that now.<\/li>\n<li>\n<ol>\n<li>Open <strong>\u201cfoliation-wt.csv\u201d<\/strong> in a text editor and see that it is the same data with a comma: \u2018,\u2019 between each value (<strong>C<\/strong>omma <strong>S<\/strong>eparated <strong>V<\/strong>alue).<\/li>\n<\/ol>\n<\/li>\n<\/ol>\n<h2>1.3 \u00a0\u00a0 Workflow for adding XY data<\/h2>\n<ol>\n<li>Close excel. <strong>IMPORTANT <\/strong>you cannot work on the same file in two programs at once. If you try to work on this file in ArcGIS with it still open in excel it will not work.<\/li>\n<li>Open the map \u201c<strong>mxd<\/strong>\u201d. Then open the ArcCatalog sidebar (<strong>Windows&gt;Catalog<\/strong>) and navigate to the location where the \u201c<strong>foliation-wt.csv<\/strong>\u201d file is stored. i.e <strong>Home&gt;<\/strong><\/li>\n<li>Right click on \u201c<strong>foliation-wt.csv<\/strong>\u201d and choose \u201c<strong>Create Feature class&gt;From XY table<\/strong>\u201d<br \/>\n<a href=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-626\" src=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image3.png\" alt=\"image3\" width=\"320\" height=\"236\" srcset=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image3.png 320w, https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image3-300x221.png 300w\" sizes=\"auto, (max-width: 320px) 100vw, 320px\" \/><\/a><\/li>\n<li>Choose the correct Input fields from the sheet headers for easting and Northing.<\/li>\n<li>We need to set the coordinate system of these now. Click on \u201cCoordinate system..\u201d Choose the correct coordinate system (for NZ Go to <strong>Projected coordinate systems&gt;National grids&gt;New Zealand and choose NZGD2000 New Zealand Transverse Mercator Projection.<\/strong> )<\/li>\n<li>It\u2019s a good idea at this point to add the coordinate system to your favourites by clicking on the little star icon. Click <strong>OK<\/strong>.<br \/>\n<a href=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image4.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-627\" src=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image4.png\" alt=\"image4\" width=\"299\" height=\"442\" srcset=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image4.png 299w, https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image4-202x300.png 202w\" sizes=\"auto, (max-width: 299px) 100vw, 299px\" \/><\/a><a href=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image5.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-628\" src=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image5.png\" alt=\"image5\" width=\"449\" height=\"254\" srcset=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image5.png 449w, https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image5-300x169.png 300w\" sizes=\"auto, (max-width: 449px) 100vw, 449px\" \/><\/a><\/li>\n<li>Set the output to \u201c<strong>XYfoliation-wt.shp<\/strong>\u201d in the <strong>\u201cdata\u201d <\/strong><\/li>\n<\/ol>\n<h2>1.4 \u00a0\u00a0 Checking the shapefile you just made<\/h2>\n<ol>\n<li>Now if you look in folder you used in the ArcCatalog Sidebar you will see a shapefile with the name you gave it. Add this to your map by dragging and dropping.<\/li>\n<li>You can query what each point is using identify . You can also open the attribute table to see attributes for each point (e.g. name). <strong>right click on layer&gt;Open attribute table.<\/strong><\/li>\n<li>You have just created spatial data (data that can be read by a GIS). You could now throw the .shp file you created into any new map and it will come up in the right place (provided the coordinate system is the same or transformation is set.).<\/li>\n<\/ol>\n<h2>1.5 \u00a0\u00a0 Things to check for your own datasets<\/h2>\n<h3>1.5.1\u00a0\u00a0\u00a0 Check that all of you points have plotted where you think they should have<\/h3>\n<ol>\n<li>Use the select tool to select all your data in the area you are working in <a href=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image6.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-629\" src=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image6.png\" alt=\"image6\" width=\"23\" height=\"19\" \/><br \/>\n<\/a><a href=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image8.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-631\" src=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image8.png\" alt=\"image8\" width=\"633\" height=\"482\" srcset=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image8.png 633w, https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image8-300x228.png 300w, https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image8-393x300.png 393w\" sizes=\"auto, (max-width: 633px) 100vw, 633px\" \/><\/a><\/li>\n<li>Open up the attribute table and check that all the entries have been selected.<\/li>\n<li>If some points are not highlighted it might be because they have incorrect eastings and northings. Look at XY data integrity issues in problem solving<\/li>\n<\/ol>\n<h3>1.1.1\u00a0\u00a0\u00a0 Check your attribute table to see that all data have come through as they should have<\/h3>\n<p>It\u2019s possible that sometimes ArcGIS will not recognise a field correctly. Look at some of the problem solving techniques below.<\/p>\n<h2>1.6 \u00a0\u00a0 Problem solving<\/h2>\n<p>There are often a few issues with adding XY data. This section will cover a few of the common issues and some steps to remedy them.<\/p>\n<h3>1.6.1\u00a0\u00a0\u00a0 You didn\u2019t correctly choose the Easting and Northing fields<\/h3>\n<ol>\n<li>If your data don\u2019t plot in the right place then right click on the data file in ArcGIS and choose zoom to layer.<\/li>\n<li>If all of your points have plotted but in the wrong place it likely is an issue with the fields you choose for import<\/li>\n<li>ArcGIS often defaults to using Easting for both the Easting and Northing fields. So if you don\u2019t change this your data will plot along a 45 degree line somewhere on the map.<br \/>\n<a href=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-632\" src=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image9.png\" alt=\"image9\" width=\"823\" height=\"479\" srcset=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image9.png 823w, https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image9-300x174.png 300w, https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image9-500x291.png 500w\" sizes=\"auto, (max-width: 823px) 100vw, 823px\" \/><\/a><\/li>\n<li>Go back and start again choosing the correct fields for X and Y<\/li>\n<\/ol>\n<h3>1.6.2 \u00a0\u00a0 You are trying to use the wrong coordinate system<\/h3>\n<p>Make sure you pick the correct coordinate system that your data are in.<\/p>\n<ul>\n<li>One common mistake is to choose a projected coordinate system (Easting\/Northing) when your data are in a geographic coordinate system (Lat\/Long). Your data will plot down the lower left near the origin.<\/li>\n<li>Another common mistake is to choose a geographic coordinate system (Lat\/Long) when your data is in a projected coordinate system (Easting\/Northing). Your data will not plot at all because it is getting values in millions of metres and expects values from -180 to +180 (degrees).<\/li>\n<li>Another mistake is choosing the wrong projected coordinate system when there are more than one used in an area. For example choosing NZMG instead of NZTM. This will usually result in the points plotting very far away.<\/li>\n<li>Another mistake is choosing the wrong geographic coordinate system. E.g. GD49 instead of CG200 in NZ. This will sometimes cause points to plot pretty close to where they should be but with a constant offset of potentially 200m. In some cases the geographic coordinate systems are so similar you won\u2019t be able to tell (e.g. GD2000 and WGS84)<\/li>\n<li>A less common mistake is to choose the wrong datum\/projection combination. This will have the same offset effect as choosing the wrong datum.<\/li>\n<\/ul>\n<h3>1.6.3 \u00a0\u00a0 ArcGIS can\u2019t work out what data type to use for a column<\/h3>\n<ul>\n<li>This could be because your data have different types in one column. For example you might have a text where there should only be numbers. ArcGIS will not let you use the rest of the numbers in this column as numbers (e.g. in calculations, object rotations)<br \/>\n<a href=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image10.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-633\" src=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image10.png\" alt=\"image10\" width=\"514\" height=\"108\" srcset=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image10.png 514w, https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image10-300x63.png 300w, https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image10-500x105.png 500w\" sizes=\"auto, (max-width: 514px) 100vw, 514px\" \/><\/a><\/li>\n<li>Sometimes ArcGIS takes issue if there are too many blank fields at the start of a column (but this might be an issue with older versions as I can\u2019t seem to replicate it)<\/li>\n<\/ul>\n<h3>1.6.4 \u00a0\u00a0 XY data integrity issues<\/h3>\n<p>If some of your data isn\u2019t plotting where it should be and you entered the data manually at any stage, then it is likely because you transposed or dropped some numbers. See the example below where a number has been dropped.<br \/>\n<a href=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image11.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-634\" src=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image11.png\" alt=\"image11\" width=\"328\" height=\"194\" srcset=\"https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image11.png 328w, https:\/\/blogs.otago.ac.nz\/si-geology\/files\/2015\/04\/image11-300x177.png 300w\" sizes=\"auto, (max-width: 328px) 100vw, 328px\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This tutorial covers adding XY data to ArcGIS, so that you can view and work with the data in ArcGIS. By XY data I mean point data such as foliation that has a spatial (XY) component associated with it.<\/p>\n","protected":false},"author":10389,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8741],"tags":[8805,8804,25995,15344,26009,8763,25956,62,25967,25996,8824,25974,8743,26006,25994,25993],"class_list":["post-623","post","type-post","status-publish","format-standard","hentry","category-gis","tag-arcgis","tag-coordinate-systems","tag-geographics-coordinate-systems","tag-geology","tag-gis","tag-instructions","tag-mapping","tag-new-zealand","tag-projected-coordinate-systems","tag-shapefile","tag-spatial","tag-spatial-data","tag-tips-and-tricks","tag-training","tag-xy","tag-xy-data"],"_links":{"self":[{"href":"https:\/\/blogs.otago.ac.nz\/si-geology\/wp-json\/wp\/v2\/posts\/623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.otago.ac.nz\/si-geology\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.otago.ac.nz\/si-geology\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.otago.ac.nz\/si-geology\/wp-json\/wp\/v2\/users\/10389"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.otago.ac.nz\/si-geology\/wp-json\/wp\/v2\/comments?post=623"}],"version-history":[{"count":0,"href":"https:\/\/blogs.otago.ac.nz\/si-geology\/wp-json\/wp\/v2\/posts\/623\/revisions"}],"wp:attachment":[{"href":"https:\/\/blogs.otago.ac.nz\/si-geology\/wp-json\/wp\/v2\/media?parent=623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.otago.ac.nz\/si-geology\/wp-json\/wp\/v2\/categories?post=623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.otago.ac.nz\/si-geology\/wp-json\/wp\/v2\/tags?post=623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}