Tufts GIS Center Trouble-Shooting Coordinate System Problems Written by Barbara M. Parmenter, revised 11/3/11 OVERVIEW OF THE EXERCISE.................................................................................................................... 1 COPYING THE MAP PROJECTION EXERCISE FOLDER TO YOUR H: DRIVE OR DESKTOP .............................. 2 WHAT’S THE COORDINATE SYSTEM OF THIS DATA SET? .......................................................................... 3 WHAT’S THE COORDINATE SYSTEM OF MY DATA FRAME? ...................................................................... 4 YOUR TURN – FIND THE COORDINATE SYSTEM ........................................................................................ 5 SETTING AN APPROPRIATE COORDINATE SYSTEM FOR MAPPING ........................................................... 6 YOUR TURN – SET AN APPROPRIATE COORDINATE SYSTEM .................................................................... 7 HEY, WHERE’S MY DATA LAYER? – FIXING MISSING/INCORRECT SPATIAL REFERENCES ........................... 8 SETTING UP FOR SPATIAL ANALYSIS ....................................................................................................... 14 Overview of the exercise This exercise is designed to be done in the Tufts GIS Lab. Its goal is to familiarize students who have already been introduced to coordinate systems to some of the issue they will likely face in professional GIS work. A solid understanding of coordinate systems is critical for GIS users. Selecting an appropriate coordinate system is necessary for good visualization. The accuracy of spatial queries and calculations (e.g., area and perimeter) can be affected by coordinate system choices. The issues may manifest themselves as errors that preclude completion of a certain query or calculation, or errors in the results of a query. For example, you cannot calculate the area of polygons for a data set that is not projected (e.g., that is in the Geographic Coordinate System). In addition, spatial queries with a GCS coordinate system may not perform properly. If you are using an inappropriate projected coordinate system, your selections based on spatial relationships (“show me all the buildings within 2 miles of a geologic fault line”) and your area/perimeter/length calculations can be completed but they could have significant errors. The bottom line is: You need to be aware of what the coordinate system is for each of your data sets You should generally work within an appropriate projected coordinate system for your area of interest (NOT a Geographic Coordinate System!) 1 Tufts GIS Center When performing spatial analysis (where spatial relationships matter – e.g., spatial queries, proximity functions, and area/length/perimeter calculations), all the data sets involved should be in the SAME projected coordinate system. Many, if not most, of the most common problems encountered by beginning GIS users turn out to be related to coordinate system issues. This tip sheet takes you through several common issues you’ll encounter in GIS that have to do with coordinate systems. You must do this tip sheet in the Tufts GIS Lab. After completing this exercise, you should: Know where to look in ArcGIS to get information about a data set’s coordinate system Know how to change the coordinate system of a data frame in ArcMap Understand how to select an appropriate coordinate system for a given area Understand some of the problems that might occur in GIS due to map projection and coordinate system issues More information about coordinate systems is available through ArcGIS Online Help in their Guidebook for Map Projections Copying the Map Projection Exercise Folder to your H: drive or Desktop Before you begin, you need to have your own, write-able copy of the exercise data 1. Copy the Map Projection Exercise folder from S:\classes\UEP_ENV to your H: drive (or the Desktop if you’re doing this in class). Copy and paste the entire folder. 2. Once you have it on your H: drive, navigate to it and right-click on the Map Projection Exercise folder and choose Properties – General tab 3. Uncheck the Read-Only box 2 Tufts GIS Center What’s the coordinate system of this data set? It’s critical that you know the coordinate system of each of the data sets you are using. 1. Navigate to your copy of the Map Projection Exercise folder and double-click the following map file: map_projection_exercise_01.mxd – that will start ArcMap 2. Also start ArcCatalog Each data set is in a particular coordinate system. It has to be – it can’t be created without being in a coordinate system. However, ArcGIS software does not require a person to explicitly define what coordinate system the data is in when they create it. Most professionally produced GIS data sets will have a defined coordinate system. You can find out what a data set’s coordinate system in one of the following two ways: 1. In ArcCatalog, navigate to M:\State\MA\MassGIS\Political_Boundaries\Town_Poly.shp and click on the data set, then click on the Description Tab – you see a description of the data set 2. Scroll down if necessary and click on the link for ArcGIS Metadata 3. Click on the ESRI Spatial Information section 4. You’ll see a lot of information here, including that it is projected, the name of the projection, and the geographic coordinate reference system: Note, you can also access a GIS data set’s spatial reference in ArcMap by right-clicking on the layer in the Table of Contents and choosing Properties, then the Source tab – try this for 3 Tufts GIS Center Towns_Poly in ArcMap. You should see this: What’s the coordinate system of my data frame? It’s also critical for you to know the coordinate system of the data frame you are working with in ArcMap. The data frame always takes on the coordinate system of the first data set you add. You can then change it to a more appropriate one if you need to. You can view the coordinate system of your data frame in one of two ways in ArcMap: 1. Click on View – Data Frame Properties and then click on the Coordinate System tab 2. Or, right-click on Layers in the Table of Contents column (or whatever your Data Frame is called), then click on Properties, and then the Coordinate System tab If the first data set you add is missing a spatial reference, then your Data Frame’s coordinate system will also be undefined. This is bad! 4 Tufts GIS Center Your turn – find the coordinate system 1. In ArcMap, find the coordinate system of the data frame. 2. For each of the data layers within the red box below, write down the coordinate system, including if given, the TYPE of PROJECTION and the UNIT (linear or angular): So for Cities, you would have copy down the highlighted information below: For Towns_Poly, you would write down the information highlighted in yellow below: 5 Tufts GIS Center 3. Are the World Countries, US States, and US Counties data sets projected? 4. Why do you think the information for the Northeast Land Cover data set appears in a different format? 5. Why do you think the Maine Counties data set isn’t using a State Plane coordinate system? Setting an appropriate coordinate system for mapping We’ve discussed in class the different types of coordinate systems, and when one is more appropriate than another. You can also review the ArcGIS 10 web help section for Supported Map Projections for advice. Note that on the ArcGIS map file, we have three coordinate system grids – one for latitude and longitude (in 10 degree blocks), one for the UTM zones of the world (zone labels are at the top), and one for the State Plane Zones (NAD 83) of the US (zone names will appear if you zoom in below 1:20,000,000 scale). Take a look at the UTM and State Plane Zones (zoom in to a state or group of states to see the State Plane zones more clearly) The various State Plane Coordinate Systems were developed primarily to facilitate local mapping (at the city or metropolitan scale). The UTM Coordinate System was developed to facilitate accurate mapping for both local and regional mapping. They are especially useful for regions that extend north/south. The Geographic Coordinate System is not a projected coordinate system – it is a useful way for distributing data for large areas (e.g., the US or the World) but you should always choose a projected coordinate system when using this data in a map or for spatial analysis. 6 Tufts GIS Center You change the Data Frame’s coordinate system by going to the Data Frame’s Properties – Coordinate System tab (remember how to get there?). You can then navigate to a predefined, projected coordinate system of your choice. We have talked about the State Plane and UTM coordinate systems in class. Note there are other coordinate systems and map projections that ArcGIS makes available – for example to make a map of the continent of Africa you might want to choose a map projection specifically designed for that – recall that Conformal means the map projection retains the shape of features as much as possible, and that Equal Area means that the projection retains the correct area of features as much as possible: Your Turn – Set an Appropriate Coordinate System Based on what you have learned in class, and using the UTM Zones and State Plane Zones data sets to guide you where appropriate, choose four of the following areas and set an appropriate coordinate system for the data frame for each in turn. When you have set the data frame’s coordinate system, choose File-Export Map to create a .gif of your results – you should have four different maps at the end. Be prepared to tell the class what you chose and why, and any problems you had deciding. 1. Massachusetts 2. Somerville 3. Nantucket 4. Maine 5. The New England coast from Cape Cod to the northernmost part of Maine 6. The northeast Maine coast 7. The Florida Panhandle 8. The US Gulf Coast between Tallahassee, FL, and New Orleans 7 Tufts GIS Center 9. Chicago 10. Washington, DC 11. The Aleutian Island chain (off Alaska) 12. San Francisco metropolitan region 13. All of California 14. The Northeast US (DC to Maine) 15. Port au Prince, Haiti 16. All of Chile 17. The area around Conception, Chile, where the earthquake and tsunami occurred in 2010 18. All of Brazil 19. A continent of your choice, for purposes of showing the most accurate shape of features 20. A continent of your choice, for purposes of showing the most accurate area of features Hey, where’s my data layer? – Fixing missing/incorrect spatial references In this section you will learn how to handle data sets that are missing a spatial reference or that have the wrong spatial reference. In ArcMap, choose File – Open and open map_projection_exercise_02.mxd from your copy of the Map Projection Exercise folder (you don’t need to save the old one) We are zoomed into Boston, with the MassGIS Towns poly layer and the Boston Redevelopment Authority’s Planning District layer. Write down the coordinate system and linear units of each of these layers Write down the coordinate system and linear units of the data frame It’s fairly common that cities use the “feet” version of their area’s State Plane coordinate system. The “default” version of the NAD83 State Plane always has meters as the linear unit, so it doesn’t always list “meters” in the name like it does with the “feet” version, but you see it when you look at the linear units. The major point here is that both data sets appear together in the correct location even though they are in different coordinate systems (one based on feet and the other on meters), because ArcGIS knows what those coordinate systems are. 8 Tufts GIS Center Occasionally, a data set’s coordinate system has NOT been defined explicitly by its creator. In ArcCatalog’s Description information, you would see something like this in the ESRI Metatdata – Spatial Information section: Note in the above case, there is no information about whether the data set is projected or what projection it is using. The software sees coordinates (because every GIS data set is in some coordinate system), but the software has no way of knowing what system these coordinates represent, so no way of knowing where in the world they may be. When you try to add a data layer that has no defined coordinate system to your ArcMap session, you’ll get an error message like this: The data layer might draw, but it may or may not draw in the right place. And you never want to use data that has a missing spatial reference. BAD! Adding data from the City of Newton 1. Add the floodplain layer from the City of Newton from your H: drive (H:\ Map Projection Exercise\Newton_Data\floodplains.shp) – what happens? 2. Now add the building footprint layer from the City of Newton (H: \Map Projection Exercise\Newton_Data\bldgfoot.shp) – what happens? 3. Write down the coordinate system and linear unit of each of these data layers. 4. Why do you think the building footprints are not displaying correctly? 5. Why do you think the floodplains are not displaying correctly? 9 Tufts GIS Center Finding the lost data 1. Right-click on building footprints and choose Zoom to Layer – what happens? 2. Click on the Go Back to Previous Extent button Newton is somewhere but not where it is supposed to be…. 3. Click on the full extent button 4. Can you find the Newton data layers? 5. Put the cursor over the Newton data and write down the coordinates listed in the bottom right corner of ArcMap – these are the Easting and Northing (meters north and east of the State Plane’s coordinate system’s origin point 6. Go back to your previous extent so that you are looking at the Boston metro area again 7. Put the cursor somewhere over Newton and write down the coordinates in the bottom right of the screen 8. Can you think of any reason why the city of Newton data layers are so far off? (hint: the Newton data sets have coordinates a little over 3 times as large as the coordinates of the MassGIS Town Poly data for the Newton town polygon) Correcting the problem I happen to know that the coordinate system for the Newton GIS data is the Massachusetts State Plane Mainland, NAD 83, with linear units of FEET (despite what the coordinate system tab said for the floodplains). The reason it is showing up many miles to the northeast is that ArcGIS is reading the coordinates of the City of Newton data (which are really in feet) as if they were meters! Remember, the MassGIS town poly in the Mass State Plane NAD83 meters system (which is also what the Data Frame’s coordinate system is in). On that layer, the area of Newton is something like 223,500 meters east and nearly 900,000 meters north of the State Plane zone’s origin point. But you recorded the Newton data set coordinates as something like 737,000 meters east, and nearly 3,000,000 meters north of the State Plane’s origin point. That’s a lot farther east and north – way up north of Maine somewhere. Because ArcGIS didn’t know the coordinates were in feet, it treated them like they were in meters and placed them accordingly. If the software knew the coordinates were in feet it would have put them in the right place. So we have two problems here: The building footprint data set’s coordinate system is missing a spatial reference and needs to be defined 10 Tufts GIS Center The floodplains have a defined coordinate system already, but it is not the right one The correct coordinate system (known through my investigation) is Massachusetts State Plane Mainland, NAD 83, with linear units of FEET Let’s first define the projection for the data set missing a spatial reference. This process will create a small projection file (.prj) that will then reside with the data set. 1. In ArcMap, click on the red Arc Toolbox icon 2. Navigate as shown here and double click on the Define Projection tool 3. Click on Show Help 11 Tufts GIS Center 4. For the Input Dataset click on the black arrow to select BLDGFOOT 5. Follow the graphic below to select a new coordinate system: 12 Tufts GIS Center 6. Choose State Plane - NAD 1983 (US Feet) and the Massachusetts choice as you see below (don’t choose Massachusetts ISL – that’s for the Islands!): 7. Click Add, then OK and OK again to complete the task. The process will take a minute or so then you will get a pop-up message that it has completed. Do the Newton building footprints eventually show up in the right place? Click on the redraw icon at the bottom of the map if necessary. Now let’s correct the coordinate system definition for floodplains 8. Follow the same steps 4-7 above, but substitute Floodplains for Bldgfoot. Note: you get a yellow warning icon that the data set already has a defined coordinate system. But we know this coordinate system definition is WRONG! So continue…but usually if you see this warning when you are working, you generally want to stop there, and investigate further to see if it’s wrong or you’re wrong! Are both data layers for Newton now in the correct location? You have now learned to define coordinate systems. The most important points here are: You should never work with data sets that are missing a spatial reference You need to know what the spatial reference is for the data set before you can use the DEFINE PROJECTION tool You need to investigate the accompanying documentation or make phone calls to find out what the data set’s coordinate system really is – it has one, you just don’t know what it is. 13 Tufts GIS Center Never, ever, ever, ever, ever use the DEFINE PROJECTION tool to define the coordinate system you would like the data set to be in if you DO NOT KNOW what it really is! What you want does not matter! You need to know what coordinate system the data set IS in. If you start guessing you can make matters much, much worse! This is exactly what happened with the Newton floodplains data – someone at Tufts defined the wrong coordinate system for it! BAD and CONFUSING!!!! Setting up for Spatial Analysis The last important thing you need to know is that for performing spatial analysis, it is good practice to put all the data sets that are part of the analysis into the SAME projected coordinate system. By spatial analysis, we mean doing queries and analysis that involve spatial relationships, like buffers, select by location, and various overlay tools. If you are only mapping things, then the data sets can remain in their own coordinate systems, as long as these are all defined. But if you start doing spatial analysis, (e.g., calculating the total acres of each kind of land use that are in a floodplain), then it is best to make copies of these data sets that are in the same projected coordinate system. Let’s say that we want the Newton floodplains data layer to be part of a spatial analysis involving 3 data sets from MassGIS. The Newton floodplains is in the Mass State Plane Mainland NAD 83 (feet) coordinate system, and the MassGIS data is all in Mass State Plane Mainland NAD 83 (meters). We are going to create a new copy of the Newton floodplains in the same coordinate system and linear units as the MassGIS data sets. This will only work if your data set’s coordinate system is currently correctly defined. This process does not convert the original coordinate system to a new one the way that DEFINE PROJECTION does – rather it makes a COPY of the original data set in a NEW projection. To convert the Newton Floodplains to Mass Mainland State Plane NAD 83 Meters: 14 Tufts GIS Center 1. In ArcToolbox, go to Data Management Tools – Projections and Transformations – Feature and double-click on the Project tool as shown below: 2. Fill out the Project dialog box as you see below – note this will create a new output data set that is a copy of the Floodplains, but in the new coordinate system you define here: 3. Complete the process by clicking through all the Add’s and OK’s – the process will take a minute, then the new data set should be added to your map 4. You can now remove the older floodplains data set. 15 Tufts GIS Center You can do this with other data layers as well, as long as they have a correctly defined coordinate system. Warning: if you incorrectly define a data layer’s coordinate system using the DEFINE PROJECTION tool, and then convert it into a different coordinate system using PROJECT, you are going to be really, really sorry, not to mention EXTREMELY confused and frustrated. DEFINE PROJECTION is for defining the coordinate system of an existing data set when that data set’s coordinate system is missing or known by you to be wrong. Usually it’s the former case. The DEFINE PROJECTION tool does NOT make a copy of the data set – it changes the original data set! PROJECT is to give a new projection to a data set in a correctly defined coordinate system. The PROJECT tool creates a new copy of the data set in the desired projection. So be careful and always… Practice safe mapping – define your projection! 16