Sometimes you get spatial data from different sources. This usually means the data are in different coordinate systems. If you are not aware of this issue, you will load the data in ARCGIS to find out that the data (e.g. point locations, polygons, etc.) are not placed where they should be (there is a geographical displacement). In the most frustrating case, you´ll load your data in ARCGIS on top of a reference layer (e.g. aerial image) and your sample locations won´t overlap at all with your reference layer (they are floating somewhere in the Universe…).
In this blog post you will learn how to integrate spatial data in different coordinate systems using ArcGIS (but as I´ve said in other posts, this applies equally to other GIS software and even to data handling & processing in R). This is very important not just for visualization purposes (everything is located where it should be and there is perfect match/overlap between layers) but also for data processing (GIS calculations). To perform calculations all layers involved in the analysis have to specify the same coordinate system. If they don´t you need to reproject them to make sure that the calculations are accurate.
Ok ok! This sounds very complicated so let´s start from the basics.
First we have to familiarise ourselves with some elements of the ARCGIS interface.
When you load a layer in ARCGIS (Add Data tool), it will appear in the table of contents (delimited by a blue rectangle in the figure below). If you load more than one layer, shapefiles (vectorial layers) will appear at the top of the list in the table of contents and rasters at the bottom. You can move each layer up and down the list (by clicking on its name and dragging it upwards or downwards) and this will change the order in which layers display in the data frame. The data frame is the area where your spatial data are displayed (delimited by an orange rectangle in the figure below).
By default, the data frame acquires the coordinate system of the first layer added to your table of contents. However the data frame is able to project “on the fly”: to align layers correctly – for visualization purposes only – even though these may differ in DATUM or Coordinate Systems.
So, the first condition to guarantee that all layers are shown correctly is that they need to have a coordinate system assigned. If this is not the case you might need to set the coordinate system of the layer.
Check whether your layer has a coordinate system. Once you load your layer in the table of contents, you can check its coordinate system by clicking on its name (right click) > Layer Properties > Source. If this tab is empty, it means you need to assign a coordinate system to your layer.
Set the coordinate system of your layer if it is missing. To set the coordinate system of your layer, you need to use one of the (thousand) tools available in the ArcToolbox. Go to ArcToolBox > Data Management Tools > Projections and transformations > Define projection. You can indicate the coordinate system of the layer by choosing from a list of geographic or projected coordinate systems (check this post if you want to learn more about the difference between these two!). How do you know in what coordinate system is your data? Here are some tips.
Ok! so now all your layers have a coordinate system set. What about your data frame? You can check what the coordinate system of the data frame is by right clicking on any white space of your data frame > Data frame properties > Coordinate System.
Set the coordinate system of the data frame.You can choose a coordinate system from the list of loaded layers, import it from a (non-loaded) layer, or simply choose one coordinate system from the list available in the program (“modify” option: geographic coordinate systems or projected coordinate systems).
Ideally, when you are working on a GIS project, all your layers and your data frame should be set in the same coordinate system. However, in most cases you will be working with data layers in different coordinate systems. Every time you load a layer that is in a different coordinate system than your data frame, the program will warn you and ask you whether you want to transform the layer to match the coordinate system of the data frame. If you don´t apply a transformation (see more details below in this post), you will find that in most cases the layers won´t overlap.
Now that we are more familiar with some of the basic concepts and terminology of the ARCGIS interface (what is the table of contents and what is the data frame), we can practice how to integrate data from different sources and coordinate systems.
In this example we have data locations of fish samples from two different coordinate systems because the extent of the study area is large (now you know what the extent means!) and the sampling sites for this study spread across two different UTM zones (Zones 53 and 54). You can download the example data here: fish data.
These are the steps you need to follow:
- Create a point layer with the points of Zone 53 only (import data of Zone 53, 29 points). Name it “FishZone53.shp”
- Create a point layer with the point of Zone 54 only (import data of Zone 54, 11 points). Name it “FishZone54.shp”
- Reproject “FishZone54.shp” into the coordinate system UTM_ Zone 53: Name this new layer “FishZone54_rep.shp”
- Merge the layers “Fish_zone53.shp” and “FishZone54_reprojected53.shp” into a unique layer “Fish_final.shp”
These are the details about how to proceed:
How can I convert coordinate pairs into a point layer? Let´s start practicing with the data of the Fish.xls data base, tab Zone 53. Go to the main ARCMAP menu, File > Add Data > Add XY data
In the Add XY data dialog, choose the tab zone53, from the Fish.xls data base. You need to indicate the Coordinate System of the input coordinates. In this case, the coordinate system is GDA1994_MGA_Zone53 (Projected Coordinate Systems > National grids > Australia > GDA1994_MGA_Zone53). Accept and close all windows. What if you don´t know the coordinate system of your data? Here I explain some tips about how to find this information.
A temporal layer of points is created (zone53$Events). Temporal layers should be converted into permanent layers in order to query or analyse them.“Right click on the layer name “> Data > ExportData. Name this layer “FishZone53.shp”
Add the new layer to the table of contents and explore the data. Is there something missing? Does it keep the same information of the original spreadsheet? (check the field ‘sites’).
Now you can repeat the process with the data in spreadsheet Fish.xls, tab zone 54. The Coordinate System in this case is GDA1994_MGA_Zone54. Name this layer “FishZone54.shp”.
The image below shows what your point layers should look like ( “FishZone53.shp” in blue and “FishZone54.shp” in orange triangles) and also shows what happens if the coordinate systems get messed up .
To work with a single layer ‘fish_final.shp’, we have to MERGE both layers BUT FIRST they have to be in the same coordinate system. We are going to project everything into the Zone 53 GDA1994_MGA_Zone53.
When do I have to apply a geographic transformation? You need to apply a geographic transformation when you are reprojecting between coordinate systems based on different datums. In the case of the fish data, you don´t need to apply any transformation because both Coordinate Systems share the same datum (GDA1994).
Ok! But…. what if I do have to apply a geographic transformation, how do I know which one I should use? You can find the transformation method that best matches to your study area here.
In the first column of this document you´ll find the Name of the different transformations between datums (e.g. AGD_1966_To_GDA_1994, old and new datums used in the Australian cartography). The transformation applies in both directions, this is to reproject layers from AGD1996 to GDA 1994 and to reproject layers from GDA1994 to AGD1996. In many cases more than one Geographic Transformation applies (there are 12 different options to reproject layers between AGD_1996_To_GDA_1994!). If this is the case you should choose from the list of transformations available the option that will produce the most accurate conversion for your study area. For example, if your study area is in Tasmania, there is a particular transformation that applies for that region AGD_1966_To_GDA_1994_3. If your study area is the whole country, you will use the generic transformation that applies to all Australian states: AGD_1966_To_GDA_1994.
Now, let’s go back to the Fish data example! Check that “FishZone53.shp”, “FishZone54_rep.shp” and the data frame all share the same coordinate system GDA1994_MGA_Zone53.
Now you can MERGE them in a single layer (“Fish_final.shp”) ArctoolBox> DataManagementTools> General> Merge. You can also find this tool in the Geoprocessing tool bar.
Well done! Now you have a single layer with all the fish locations in the same coordinate system! PHEW!…