Coordinate Reference Systems

The projection problem, and how to check your CRS.

Kris Sankaran (UW Madison)
2023-01-10

Reading, Recording, Rmarkdown

  1. An important subtlety of geographic data visualization is that all our maps are in 2D, but earth is 3D. The process of associated points on the earth with 2D coordinates is called « projection. » All projections introduce some level of distortion, and there is no universal, ideal projection.

  2. Here are a few examples of famous global projections. There are also many projections designed to give optimal representations locally within a particular geographic area.

  3. This means that there is no universal standard for how to represent coordinates on the earth, and it’s common to find different projections in practice. For example, the block below shows how North America gets projected according to two different CRSs.

    # some test projections, don't worry about this syntax
     miller <- "+proj=mill +lat_0=0 +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"
     lambert <- "+proj=lcc +lat_1=20 +lat_2=60 +lat_0=40 +lon_0=-96 +x_0=0 +y_0=0 +ellps=GRS80 +datum=NAD83 +units=m +no_defs"
     
     north_america <- world %>%
       filter(continent == "North America")
     
     tm_shape(st_transform(north_america, miller)) +
       tm_polygons()
    tm_shape(st_transform(north_america, lambert)) +
       tm_polygons()

  4. Both vector and raster spatial data will be associated with CRS’s. In either sf or raster objects, they can be accessed using the crs function.

  5. A common source of bugs is to use two different projections for the same analysis. In this class, we will always use the EPSG:4326 projection, which is what is used in most online maps. But in your own projects, you should always check that the projections are consistent across data sources. If you find an inconsistency, it will be important to « reproject » the data into the same CRS.

Citation

For attribution, please cite this work as

Sankaran (2023, Jan. 10). STAT 436 (Spring 2023): Coordinate Reference Systems. Retrieved from https://krisrs1128.github.io/stat436_s23/website/stat436_s23/posts/2022-12-27-week07-04/

BibTeX citation

@misc{sankaran2023coordinate,
  author = {Sankaran, Kris},
  title = {STAT 436 (Spring 2023): Coordinate Reference Systems},
  url = {https://krisrs1128.github.io/stat436_s23/website/stat436_s23/posts/2022-12-27-week07-04/},
  year = {2023}
}