Coordinate reference systems

From TOI-Pedia


Introduction

Coordinate reference systems allow each part of the Earth's surface to be defined by a set of three numbers, called coordinates. There are many different coordinate reference systems, which are each relevant to a specific area of the Earth (either local, regional or global). QGIS supports approximately 7000 coordinate reference systems. When working with geospatial data it is therefore important to have a good understanding of coordinate reference systems so that you can make sure that you are working with the correct one (the screenshots below show an extreme case of what can happen if you use the wrong one!).

In QGIS there are two main things that you should be familiar with related to the coordinate reference system (CRS): project CRS and layer CRS. This tutorial will provide a basic introduction to these two. For more information on coordinate reference systems, check out the useful links at the bottom of the page.

The Netherlands shown in two different coordinate reference systems. The national system EPSG:28992 - Amersfoort / RD New (left) and EPSG:6369 - Mexico ITRF2008 / UTM zone 14N (right)

Background

EPSG codes

To ensure that it is possible to identify each coordinate reference system, EPSG codes are used. An EPSG code consists of 4-5 digits, which is linked to a definition that uniquely describes a specific coordinate reference system.

Common EPSG codes

  • EPSG:4326
WGS 84: global system based on the Earth's centre of mass (used by GPS)
  • EPSG:3857
Web Mercator projection: global system used by many web-based mapping tools (e.g. Google & OpenStreetMap)
  • EPSG:7789
International Terrestrial Reference Frame 2014 (ITRF2014): global, Earth-fixed system, independent of continental drift

EPSG codes for the Netherlands

  • EPSG:28992
Amersfoort / RD New: projected CRS of the Netherlands (unit: meters) (2D)
  • EPSG:7415
Amersfoort / RD New: projected CRS of the Netherlands + NAP height in meters (3D)

Types of CRS

There are two types of coordinate reference system: geographic and cartesian. This section will briefly explain the difference between the two. See this page for a more detailed explanation.

Geographic coordinate reference systems

Geographic coordinate systems define where spatial data is located on the Earth's surface. Since the Earth is spherical, the coordinates are defined using degrees of latitude and longitude. Each geographic coordinate system uses an approximate model of the Earth's surface to construct lines of latitude and longitude. This model is chosen so that it fits best with the area for which the coordinate system is intended to be used. Keep in mind that, as a result, this means that a point on Earth can have very different coordinates depending on which geographic coordinate system is used.

Cartesian coordinate reference systems

Cartesian coordinate systems (also known as projected coordinate systems) define how to draw spatial data on a flat surface, such as a map or the interface of QGIS. Cartesian coordinate systems define coordinates in meters (or another linear unit). A cartesian coordinate system is always based on a geographic coordinate system that has been flattened using a map projection. The map projection defines how the Earth's surface should be distorted so that it can be transformed from 3D to 2D. There are many different types of map projection. Each one is best suited to a particular part of the Earth and causes the least deformation in that area.

Project CRS

Project CRS is shown in the bottom right corner

Each project you open in QGIS has a coordinate reference system associated with it. This is called the project CRS. The project CRS determines how the data you add to a project is displayed on the map canvas. You can view the project CRS in the bottom right corner of the screen.

Default settings

QGIS coordinate reference system settings

When you open a new project, the project CRS is set to WGS84 (EPSG:4326) by default. When you add your first layer to an empty project, the project CRS will be automatically changed to match the CRS of the data that you have imported. If this is not the case then you can change the default settings by navigating to Settings » Options... (Windows) / QGIS » Preferences... (Mac) and selecting the CRS tab in the window that opens. The choice to "use CRS from first layer added" is under the CRS for projects section.

Changing the project CRS

Steps required to change the project CRS
Click OK if you see this window pop up

You can change the project CRS by following these simple steps:

Step 1: Click on the EPSG code in the bottom right corner of the QGIS interface.

Step 2: Search for a CRS in the search box using either its name or EPSG code.

Step 3: Select the CRS from the list of results. Make sure that you select the one with the correct EPSG code, many coordinate systems have the same name!

Step 4: Click OK. The map canvas view will be changed to show the data in the coordinate system that you have selected.

Step 5: If you see a pop-up window asking you to select a transformation, click OK.

Layer CRS

Each layer you open in QGIS will include information about the coordinate reference system of the data it contains (it's also possible that it doesn't, in which case you have to define it yourself but this is unusual). This section will explain the basics of working with the layer CRS.

Determining layer CRS

Information on layer CRS under layer properties

You can find the coordinate reference system of a layer by right-clicking on the layer in the layers list and choosing "Properties..." (you can also just double-click on the layer to open the properties). The layer's CRS can be found under the "Information" tab.

You can also quickly view a layer's CRS by hovering your cursor over it in the layers list. The EPSG code is shown beside the layer's name in the box that appears.

Information on layer CRS when hovering over name

On-the-fly projection

As you can imagine, different layers added to a project can have different coordinate reference systems. For example, you could open OpenStreetMap (EPSG:3857) alongside cadastral data from the Dutch government (EPSG:28992).

QGIS deals with this by applying a so-called on-the-fly projection so that all layers are re-projected and displayed on the map canvas using the project CRS. This setting is applied by default.

Re-projecting layers

Information on layer CRS when hovering over name

If you want to change the coordinate system of a layer, you can re-project it using the following steps.

Step 1: Right-click on the layer in the layers panel.

Step 2: Select Export » Save Feature As... from the menu.

Step 3: Choose a file name and path by clicking on the ... on the right beside the file name field.

Step 4: Select a different CRS from the drop-down menu (only shows recently used coordinate systems). Click on the button beside this to select a projection from the complete list of available options.

Step 5: Leave all other fields the same and click OK. You have now created a new file containing the same data as the original, but with a different CRS.

Useful links

Personal tools
Actions
Navigation
Tools