6.7 Exercises

  • Create a new object called nz_wgs by transforming nz object into the WGS84 CRS.
    • Create an object of class crs for both and use this to query their CRSs.
    • With reference to the bounding box of each object, what units does each CRS use?
    • Remove the CRS from nz_wgs and plot the result: what is wrong with this map of New Zealand and why?
  • Transform the world dataset to the transverse Mercator projection ("+proj=tmerc") and plot the result.What has changed and why?Try to transform it back into WGS 84 and plot the new object.Why does the new object differ from the original one?

  • Transform the continuous raster (cat_raster) into WGS 84 using the nearest neighbor interpolation method.What has changed?How does it influence the results?

  • Transform the categorical raster (cat_raster) into WGS 84 using the bilinear interpolation method.What has changed?How does it influence the results?

  • Create your own proj4string.It should have the Lambert Azimuthal Equal Area (laea) projection, the WGS84 ellipsoid, the longitude of projection center of 95 degrees west, the latitude of projection center of 60 degrees north, and its units should be in meters.Next, subset Canada from the world object and transform it into the new projection.Plot and compare a map before and after the transformation.

References

Maling, D. H. 1992. Coordinate Systems and Map Projections. Second. Oxford ; New York: Pergamon Press.

Bivand, Roger, Edzer J Pebesma, and Virgilio Gómez-Rubio. 2013. Applied Spatial Data Analysis with R. Vol. 747248717. Springer.

Jenny, Bernhard, Bojan Šavrič, Nicholas D Arnold, Brooke E Marston, and Charles A Preppernau. 2017. “A Guide to Selecting Map Projections for World and Hemisphere Maps.” In Choosing a Map Projection, edited by Miljenko Lapaine and Lynn Usery, 213–28. Springer.


  • The CRS can also be added when creating sf objects with the crs argument (e.g., st_sf(geometry = st_sfc(st_point(c(-0.1, 51.5))), crs = 4326)).The same argument can also be used to set the CRS when creating raster datasets (e.g., raster(crs = "+proj=longlat")).

  • For a short description of the most relevant projection parameters and related concepts, see the fourth lecture by Jochen Albrecht hosted athttp://www.geography.hunter.cuny.edu/~jochen/GTECH361/lectures/ and information at https://proj4.org/parameters.html.Other great resources on projections are spatialreference.org and progonos.com/furuti/MapProj.

  • The difference in location between the two points is not due to imperfections in the transforming operation (which is in fact very accurate) but the low precision of the manually-created coordinates that created london and london_proj.Also surprising may be that the result is provided in a matrix with units of meters.This is because st_distance() can provide distances between many features and because the CRS has units of meters.Use as.numeric() to coerce the result into a regular number.

  • Many thanks to an anonymous reviewer whose comments formed the basis of this advice.

  • The Wikipedia page ‘List of map projections’ has 70+ projections and illustrations.

  • This projection is used, among others, by the National Geographic Society.

  • Another minor change, that is not represented in Table 6.2, is that the class of the values in the new projected raster dataset is numeric.This is because the bilinear method works with continuous data and the results are rarely coerced into whole integer values.This can have implications for file sizes when raster datasets are saved.