1 Concepts
1.1 Introduction
The earth is a “geoid”, a generally spherical shape with some bumps or other distortions from a true shere, but we can think of it as being spherical. Maps, however, are usually flat, and if they are not flat, they are not the same shape as the earth. To make a flat map from measurements made on a round object, we need to transforms the measurements. After we transform the data, it exists in a coordinate reference system.
1.2 Parts of the Coordinate Reference System (CRS)
CRS = Datum + Projection + Additional Parameters
A common analogy employed to teach projections is the orange peel analogy. If you imagine that the earth is an orange, how you peel it and then flatten the peel is similar to how projections get made. We will also use it here.
1.2.1 Datum
A Datum is a model of the shape of the earth.
It has angular units (i.e. degrees) and defines the starting point (i.e. where is (0,0)?) so the angles reference a meaningful spot on the earth.
A commonly used global datum is WGS84. Datums can also be local, fit to a particular area of the globe, but ill-fitting outside the area of intended use. NAD83 is an example of a local datum that is fit specifically to North America.
When datums are used by themselves it’s called a Geographic Coordinate System.
Orange Peel Analogy: a datum is your choice of fruit to use in the orange peel analogy. Is the earth an orange, a lemon, a lime, a grapefruit?
Comments from the pros: Datums matter! California Albers with NAD27 is NOT the same as California Albers with NAD83. See all of the advice here
1.2.2 Projection
A Projection is a mathematical transformation of the angular measurements on a round earth to a flat surface (i.e. paper or a computer screen).
The units associated with a given projection are usually linear (feet, meters, etc.).
Many people use the term “projection” when they actually mean “coordinate reference system”. (With good reason, right? Coordinate References System is long and might make you sound pretentious.) One example is the title of this workshop… but you wouldn’t know what it was about if I said it was a workshop on “Coordinate Reference Systems in R”, would you?
Orange Peel Analogy: a projection is how you peel your orange and then flatten the peel.
Image source: http://blogs.lincoln.ac.nz/gis/2017/03/29/where-on-earth-are-we/
1.2.3 Additional Parameters
Additional parameters are often necessary to create the full coordinate reference system. For example, one common additional parameter is a definition of the center of the map. The number of required additional parameters depends on what is needed by each specific projection.
Orange Peel Analogy: an additional parameter could include a definition of the location of the stem of the fruit.
1.2.4 Which CRS/projection should I use?
To decide if a projection is right for your data, answer these questions:
- What is the area of minimal distortion?
- What aspect of the data does it preserve?
Coordinate reference systems can preserve aspects of the map such as shape, area, distance, and direction. Any coordinate reference system cannot preserve more than two of these and often they will only preserve one.
University of Colorado’s Map Projections and the Department of Geo-Information Processing has a good discussion of these aspects of projections. Online tools like Projection Wizard can also help you discover projections that might be a good fit for your data.
Comments from the pros: Take the time to figure identify a projection that is suited for your project. You don’t have to stick to the ones that are popular.
1.3 Notation for Coordinate Reference Systems
You have two options for identifying a CRS in most R commands. The documentation for a command that requires projection information will tell you which is required. Often you can choose between the two options.
1.3.1 EPSG Code
A note on linguistics: EPSG stands for “European Petroleum Survey Group”… but everyone just says EPSG.
An EPSG Code is an ID that has been assigned to most common projections to make reference to a particular projection easy. An EPSG Code is also called an SRID (Spatial Reference Identifier). Technically, EPSG is the authority that assigns SRIDs, but you will hear these terms used interchangeably.
The main advantages to using this method of specifying a projection are that it is standardized and ensures you have the same parameters every time. The disadvantage is that if you need to know the parameters used by the projection or it’s name, you have to look them up, but that’s fairly easy to to at spatialreference.org. Also, you can’t customize the parameters if you use an EPSG code. For example: EPSG:27561
1.3.2 PROJ String
PROJ is an open source library for defining and converting between coordinate reference systems. It defines a standard way to write projection parameters. For example: +proj=lcc +lat_1=49.5 +lat_0=49.5 +lon_0=0 +k_0=0.999877341 +x_0=6 +y_0=2 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m +no_defs
Two important advantages to using this option are (1) the parameters are human-readable and immediately transparent and (2) the strings are easily customized. The main disadvantage to this option is that it’s easy to make a mistake when you reproduce the string, accidentally changing parameters.
A note on linguistics: PROJ is commonly pronounced “prodge” (“PROJ” rhymes with “dodge”); PROJ is short for “projection”. Sometimes, you’ll hear or see PROJ4. The numeral refers to the version of the library. Version 4 was in use for a long time so even though there’s newer versions, you may still see the concept referred to in this way.
1.4 Defining a Projection vs. Reprojecting (Transforming)
The #1 biggest mistake I see in any GIS (ArcMap, QGIS, R, GRASS, Python, etc.) is defining a projection for a dataset when the person should have re-projected the data. It is very common that you’ll need to tell your GIS what the projection/CRS of your data should be. In these cases, the GIS needs to know what the projection/CRS currently is, not what you would like it to be. If you need to change a projection, you need to go through a different process, often called Re-project or Transform.
Define a Projection/CRS to indicate what projection or coordinate reference sytem your data has.
Reproject or Transform a Projection/CRS when you need to change the coordinate reference system.