Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Mapping XY Data in ArcGIS Pro

Opening an Existing Project

  1. On the Desktopdouble-click the XY folder.
  2. Double-click the XY.aprx project file to open the project in ArcGIS Pro.

Exploring the Data

First, you will explore the XY data for this exercise that is contained in an Excel file.

  1. On the Desktop, double-click the XYTutorialData folder XY folder.
  2. Double-click Coordinates_ClimateProtectionAgreementMayors to open the file with Excel.

This Excel worksheet provides a list of cities whose mayors signed the U.S. Conference of Mayors Climate Protection Agreement as of September 12, 2011. This list was obtained from the Climate Protection Center website at http://www.usmayors.org/climateprotection/list.asp. Notice that the worksheet also contains the latitude and longitude of the cities in decimal degrees.

  1. Close Excel.
  2. Close the XYTutorialData folder.

Setting up a Map

You are now ready to map the XY data in ArcMap. You will begin by opening ArcMap and creating a new map document.

  1. On the Desktop, double-click the ArcMap 10.5 icon.
  2. In the ‘ArcMap – Getting Started’ window, ensure that My Templates and the Blank Map template are selected.

At the bottom of the window, notice the default geodatabase for this map is currently set to C:\Users\gistrain\Documents\ArcGIS\Default.gdb. The default geodatabase should be set to the geodatabase that will contain most of the data for the particular map document you are working on. In this case, you will want to use the geodatabase in your XYTutorialData folder.

  1. Next to the ‘Default geodatabase for this map:’ box, click the Browse button.

 

  1. In the ‘Default Geodatabase’ window, click the Connect To Folder button.

 

  1. In the ‘Connect To Folder’ window, select the XYTutorialData folder located on the Desktop.

Ensure that the XYTutorialData folder is highlighted in blue and not the XYData.gdb geodatabase that appears inside it. You never want to connect directly to a geodatabase, as doing so will prevent you from being able to access any of the data contained inside of it.

  1. For ‘Folder:’, verify that either the XYTutorialData folder or the C:\Users\gistrain\Desktop\XYTutorialData filepath is listed and click OK.
  2. In the ‘Default Geodatabase’ window, select the XYData.gdb geodatabase and click Add.
  3. Ensure the ‘Default geodatabase for this map:’ box says “C:\Users\gistrain\Desktop\XYTutorialData \XYData.gdb” and click OK.

At this point, it is a good idea to save your map document and to continue saving regularly.

  1. On the Standard toolbar, click the Save button.

 

  1. In the ‘Save As’ window, use the ‘Save in:’ drop-down box to select the XYTutorialData folder.

You will save the map document here, directly inside the XYTutorialData folder, but NOT within the XYData geodatabase.

  1. For ‘File name:’, type “ClimateProtectionAgreementCities” and click Save.

Remember that, in order for your GIS project to open properly on other computers, you must tell the map document to store relative pathnames to its data sources and take your entire project folder containing all of your data and your map document with you.

  1. Click the File menu and select Map Document Properties….
  2. Towards the bottom of the ‘Map Document Properties’ window, click the checkbox to ‘Store relative pathnames to data sources’ and click OK.
  3. On the Standard toolbar, click Save again to store this setting in your map document.

Adding a basemap - Change Basemap?

Before you add in your XY data, you will need a basemap so that you will be able to tell if the points are being mapped in the correct locations. It is possible to create your own custom basemap using a variety of data sources, but here you will use a basemap from ArcGIS Online.

  1. On the Standard toolbar, click the drop-down arrow to the right of the Add Data button and select Add Basemap….

 

  1. In the ‘Add Basemap’ window, select the Streets basemap and click Add.

The basemap may take some time to load.

  1. If you are asked to enable Hardware Acceleration, click Yes.

Displaying XY Data

Now that you have a basemap, you are ready to map your XY data of cities.

  1. On the right side of the ArcMap window, click the Catalog tab.
  2. On the Catalog toolbar, click the Go To Default Geodatabase button, which will take you to the default geodatabase you specified earlier.

 

  1. Double-click the Coordinates_ClimateProtectionAgreementMayors Excel file to expand it and view the individual worksheets.
  2. Drag Sheet1$ into the Map Display where the basemap is currently showing.

Notice at the top of the Table of Contents, the highlighted icon has switched from the first ‘List By Drawing Order’ button to the second ‘List by Source’ button. That switch is because the tabular data you just added does not have a graphic component, so it cannot yet be drawn and will not appear in the drawing order view.

Displaying XY Data

Now that you have observed the Excel data, it is time to display the XY data of cities.

  1. Within the XY folder, double-click the XY.aprx project file to open the project in ArcGIS Pro.
  2. In the Catalog pane, double-click the Folders folder and double-click the XYTutorialData folder.
  3. Double-click the Coordinates_ClimateProtectionAgreementMayors Excel file to expand it and view the individual worksheets.
  4. Right-click Sheet1$ into the Map Display.
  5. In the Contents paneIn the Table of Contents, right-click the Sheet1$ table and select Display XY Data….Data.

Notice the Geoprocessing pane has appeared to the right of the Map Window.

  1. In the Geoprocessing pane, in the ‘X Field’ drop-down menu, make sure the Longitude field is selectedFor ‘X Field:’, select the Longitude field.
  2. For ‘Y Field:’, select Field’, make sure the Latitude field is selected.

Notice in the ‘Coordinate System of Input Coordinates’ box‘Spatial Reference’ drop-down menu, it defaults to the particular projection being displayed in our active data frame, which is currently WGS 84 Web Mercator Auxiliary Sphere. This is the particular projection of the basemap data that we added in, which , automatically generated by ArcGIS, is the same projection used by most web mapping sites, including Google and Bing.

Look in the bottom right corner center of the Map Display. You will see coordinates, such as                “-28179189.702  13883831.49 Meters”as “130.2718150°W 51.8563516°N”. In order to use this default projection, the XY coordinates in your spreadsheet would have to be similar large numbers in meters, but since they are provided in geographic coordinates of latitudes between -90 and 90 and longitudes between   -180 and 180, you will need to specify a geographic coordinate system, rather than a projected coordinate system.

  1. In the ‘Coordinate System of Input Coordinates’ box, click Edit…Next to the ‘Spatial Reference’ drop-down menu, click the Atlas button.
  2. In the ‘Spatial Reference Properties’ ‘Coordinate System’ window, scroll to the top of the list of projections.

Because the coordinates are in the form of latitude and longitude in decimal degrees, you know you will need to select a geographic coordinate system, rather than a projected coordinate system.  While the data could theoretically be in any geographic coordinate system, you will select the World Geodetic System of 1984, commonly abbreviated WGS 84, because this is the reference coordinate system used by the Global Positioning System (GPS). Under most circumstances, this will be the best coordinate system to select when mapping latitude and longitude coordinates.

  1. Double-click Observe that the XY Coordinate Systems Available is open to Geographic Coordinate Systems > World.
  2. Select Observe that the selected coordinate system is WGS 1984 and click OK.
  3. Ensure that your window matches that below and click OK.

 

A warning message appears to let you know that the functionality of your data will be limited until you export the data to a new layer.

  1. Click OKClick Run.

The points should now appear on top of the United States.

  1. In the Table of Contents pane, right-click the Sheet1$ Events _Layer layer and select Zoom to Layer.

Exporting XY

...

data

Since the points appear to be in reasonable locations (rather than in another country or the middle of the ocean), you will want to export them to a new feature class in your XYData geodatabase.  Exporting to a feature class will allow you to reuse this points layer in other future map documents without having to go through the display XY data process each time.

  1. Right-click the Sheet1$Events layer and select Data > Export Data…Features.

Notice that the output feature class defaults to your default geodatabase (C:\Users\gistrain\Desktop\XYTutorialData\XYData.gdb).

  1. For ‘Output feature class:’, scroll to the end Feature Class’, click the Browse button, make sure the layer is within XYData.gdb, and rename the feature class from “Export_Output” to “ClimateProtectionAgreementCities” and click OK.

 

...

  1. “ClimateProtectionAgreementCities”. Click Save.
  2. Make sure your Geoprocessing pane looks like this below and click Run.

 

Since you are now using a permanent feature class, you may remove your temporary Events Sheet1$ layer and the corresponding Excel table.

  1. Right-click the Sheet1$ Events _Layer layer and select Remove.
  2. Right-click the Sheet1$ table and select Remove.

If you’d like to get a better view of your points, use the navigation tools on the Tools toolbar Map tab to zoom in to the continental United States.

You have successfully mapped point locations using XY coordinates!.

Bonus Exercise: Spatial Join

The following section is optional and does not contain additional information on mapping locations using XY coordinates.

At this point, all of the cities appear on the map, but there are many urban areas that are so densely covered with overlapping points that it becomes difficult to tell exactly how many points there are and to see the underlying data, such as city and state names. In addition, while you can see the spatial distribution of the points, you are not provided with any sort of useful summary of the data. Performing a spatial join will allow you to discover how many participating cities are located in each state, or even county.

  1. On the right side of the ArcMap windowMap Window, click the Catalog tabpane.
  2. Double-click the Databases folder and double-click the XYData geodatabase to expand its contents.

...

  1. Drag the US_States feature class into the Map Display.
  2. When you receive a warning about differences in the Geographic Coordinate Systems, click Close.

You will now examine the US_States layer’s attribute table.

  1. In the Table of Contents pane, right-click the US_States layer and select Open Attribute Table.
  2. Scroll to the right and browse through all of the attributes.

...

  1. Close the attribute table.
  2. In the Table of Contents pane, right-click the US_States layer and select Joins and Relates > Join….
  3. For ‘What do you want to join to this layer?’, select Join data from another layer based on a spatial location.
  4. For 1., ensure that the ClimateProtectionAgreementCities layer is selected.
  5. States layer and select Joins and Relates > Spatial Join.
  6. For the ‘Join Features’ drop-down menu, select the ClimateProtectionAgreementCities layer.

Notice For 2., notice that by default, each polygon will be given a count field showing how many points fall inside it, so you do not need to pick an additional statistic.  If, for example, your cities layer contained an attribute listing the population of each participating city, then, when performing the spatial join, you could check the ‘Sum’ statistic to calculate the total population residing in participating cities in each state and then calculate what percentage of the state’s total population reside in these participating cities. In this case, you do not have such population data available, so you will stick with the default ‘Count’ Join Count attribute.

  1. For 3., scroll to the end and rename the feature class from “Join_Output” to the ‘Output Feature Class’ drop-down menu, select the Browse button next to it, ensure it is within the XYData.gdb, and name it “US_States_WithCityCounts”. Click Save and click OK Run.

The new layer should appear at the top of your Table of Contents pane

  1. At the top of the Table of Contents , click the List by Drawing Order button.

 

  1. Rightpane, right-click the US_States_WithCityCounts layer and select Open Attribute Table.
  2. Scroll to the right and notice the newly added Count_ Notice the newly-added Join_Count field.  This field tells you how many participating cities are contained within each state.
  3. Close the attribute table.

Since the new layer contains all of the same information as the old US_States layer, plus the new Count field, you no longer need the US_States layer.

  1. In the Table of Contents pane, right-click the US_States layer and select Remove.
  2. DoubleRight-click the US_States_WithCityCounts layer to open the ‘Layer Properties’ window and edit the symbology.Click the Symbology tab and select Symbology.
  3. In the ‘Show:’ box on the left, click Quantities and leave the default selection of Graduated colorsSymbology pane, in the Symbology drop-down menu, select Graduated Colors.
  4. In the ‘Fields’ box, use the ‘Value:’ drop-down menu to , select the Join_Count _ field.
  5. Click OK.

You can now easily tell which states have the largest number of participating cities, though this display does not take into consideration things such as city density and population density or the percentage of the total state population participating.

  1. On the Standard toolbar at the top of the Map Window, click Save.
  2. Close ArcMap ArcGIS Pro.

...

Optional Exercise: Converting Addresses to XY Coordinates

If all of your data already comes with a list of the latitudes and longitudes of the points you’d like to map, then you are ready to go straight into ArcMap, but what if you have a list of cities or addresses that you’d like to map, but you don’t know their corresponding coordinates? This section will show you one automated method of generating such coordinates based on address locations.

...

  1. Double-click the XYTutorialData folder.
  2. Rename your file “LatLongMayors” and click Save.
  3. Return to Excel.

...

 

  1. At the bottom of the worksheet click the Insert Worksheet button.

...

You could now delete any unnecessary columns and save this Excel worksheet to map the XY coordinates just like you did in the first exercise.

 

 

Optional Exercise: Converting DMS to Decimal Degrees

Occasionally, you will come across latitude and longitude coordinates listed in Degrees, Minutes, Seconds (DMS) format (27°52'35.1" N, 93°48'54.1" W). However, ArcGIS requires coordinates to be in decimal degrees (DD) format (27.3574, -93.75346). This section will show you how to convert coordinates from DMS to DD using Excel.

...

Before you can covert DMS coordinates to DD coordinates, it is necessary to separate out the degrees, minutes, and seconds components into their own columns. In Excel, you can divide single cells into multiple columns using either delimiters or fixed width break lines. You will try both methods.

Converting text to columns using delimiters

  1. Click cell D2 to select it.
  2. In the formula bar, highlight the degree symbol (°) and press Ctrl+C to copy it.

...

  1. Click column D to highlight the entire column.
  2. At the top of the Excel window, click the Data tab.

...

 

  1. Under the Data Tools section, click the Text to Columns button.

...

You could repeat this same process twice more, using the apostrophe symbol (‘) and the quotation marks symbol (“) as the respective delimiters. If your coordinates data had differing numbers of decimal places in each row, repeating this method would be necessary, but, in this case, each set of coordinates has exactly the same number of characters, so using fixed width break lines is possible.

Converting text to columns using fixed width break lines

  1. Click column E to highlight the entire column.
  2. On the Data tab, under the Data Tools section, click the Text to Columns button.
  3. In the ‘Convert Text to Columns Wizard’, select Fixed width and click Next >.
  4. In the ‘Data preview’ box at the bottom, click on both sides of the apostrophe symbol (‘) to add break lines.
  5. Click on both sides of the quotation mark symbol (“) to add break lines.

...

  1. Repeat steps 7 and 8 with the fourth column containing the quotation marks and the fifth column containing the letter W.
  2. Click Finish.

Your spreadsheet should now appear like that shown below. If you have any additional columns, showing because they were not marked to be skipped, delete them now.

 

Using the DMS to DD conversion formula

Now that your degrees, minutes, and seconds components are each in their own column, you can use the following formula to convert them into decimal degrees: DD = D+(M/60)+(S/3600).

...