Regional mapping of Australia with minimized area distortion.
Setting up the basic code, libraries and getting world map data
Code
library(tidyverse) # Data wranglinglibrary(sf) # Simple Features in Rlibrary(rnaturalearth) # Map dataworld <-ne_countries(scale ="medium",returnclass ="sf") |>select(name, name_long, iso_a2, iso_a3, geometry, continent)
Details on different projections, their usage, examples and code
1. WGS 84 (Geographic)
The WGS 84 projection, identified by EPSG:4326, is the default geographic coordinate system used for latitude and longitude. It is the most common system for raw geographic data and is widely used in GPS devices and mapping applications. This projection is excellent for datasets that involve global coverage but does not preserve area, shape, or distance due to its geographic nature.
Code
g <-ggplot() +geom_sf(data = world) +coord_sf(crs ="EPSG:4326" ) +theme_minimal() +labs(title ="WGS 84 (Geographic) Projection",subtitle ="EPSG:4326. Default geographic coordinate system using latitude and longitude." )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_1.png"),height =1200,width =1800,units ="px")
2. Web Mercator
The Web Mercator projection, represented by EPSG:3857, is widely used by web mapping platforms like Google Maps and OpenStreetMap. It is a conformal projection, meaning it preserves angles but distorts area, especially near the poles. It is best suited for interactive maps or raster tiles for visualizing data at various zoom levels.
Note
Antarctica cannot be plotted with Web Mercator projection, as it become hugely elongated. Must remove Antarctica before plotting in Web Mercator.
Code
g <-ggplot() +geom_sf(data = world |>filter(name !="Antarctica") ) +coord_sf(crs ="EPSG:3857" ) +theme_minimal() +labs(title ="Web Mercator Projection",subtitle ="EPSG:3857. Best for interactive Maps; preserves angles." )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_2.png"),height =1200,width =1800,units ="px")
3. UTM Zone 33N
The Universal Transverse Mercator (UTM) Zone 33N, identified by EPSG:32633, is a projection system designed for mapping specific regions with minimal distortion. UTM divides the world into 6° longitudinal zones, and Zone 33N is suited for areas within its coverage, typically in Europe. It is ideal for regional-scale analysis and detailed mapping.
Note
In order to be able to use xlim = c(-20, 45), and ylim = c(33, 70) within the coord_sf(), to focus on Europe, we must use default_crs = sf::st_crs(4326). The deafult_crs argument tells the ggplot2 that the limits’ numbers are mentioned in which CRS system. And, the 4326 CRS is the default longitude-latitude CRS system.
Code
g <-ggplot() +geom_sf(data = world |>filter(continent =="Europe") ) +coord_sf(crs ="EPSG:32633" ) +theme_minimal() +labs(title ="UTM Zone 33N Projection: For Europe",subtitle ="Minimal distortion for European Region." )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_3_1.png"),height =1200,width =1800,units ="px")g <- world |>filter(continent =="Europe") |>filter(!(name %in%c("Russia", "Iceland"))) |>ggplot() +geom_sf() +geom_sf_text(mapping =aes(label = name),check_overlap =TRUE,size =1.5 ) +coord_sf(crs ="EPSG:32633",xlim =c(-20, 45),ylim =c(33, 70),default_crs = sf::st_crs(4326) ) +theme_minimal() +labs(x =NULL, y =NULL,title ="UTM Zone 33N Projection: For Europe",subtitle ="After removing Russia and setting xlim & ylim" )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_3.png"),height =1200,width =1800,units ="px")
4. UTM Zone 33S
The UTM Zone 33S, associated with EPSG:32733, is similar to Zone 33N but designed for the southern hemisphere. It minimizes distortion within its zone and is widely used for detailed mapping in areas south of the equator within its longitudinal range. It is particularly useful for engineering and cadastral surveys. Area of use: Between 12°E and 18°E, southern hemisphere between 80°S and equator, onshore and offshore. Angola. Congo. Democratic Republic of the Congo (Zaire).
The North American Datum 1983 (NAD83), identified by EPSG:4269, is a standard reference system used across North America. It serves as the foundation for many regional and national mapping projects in the US and Canada. This projection ensures compatibility with datasets collected in the region.
Code
g <- world |>filter(continent =="North America") |>ggplot() +geom_sf() +geom_sf_text(mapping =aes(label = name,size =as.numeric(st_area(geometry)) ),check_overlap =TRUE ) +scale_size(range =c(0.75, 3)) +coord_sf(crs ="EPSG:4269",clip ="on",xlim =c(-160, -40),default_crs =st_crs(4326) ) +theme_minimal() +labs(x =NULL, y =NULL,title ="North American Datum 1983 (NAD83) Projection",subtitle ="For Canada and USA" ) +theme(legend.position ="none" )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_5.png"),height =1200,width =1800,units ="px")
6. ETRS89 / LAEA Europe
The ETRS89 Lambert Azimuthal Equal Area projection, represented by EPSG:3035, is optimized for mapping datasets across Europe. It preserves area relationships, making it suitable for thematic maps like population density or land use. This projection is commonly used in European Union projects and cross-country analyses.
Code
g <- world |>filter(continent =="Europe") |>ggplot() +geom_sf() +geom_sf_text(mapping =aes(label = name),check_overlap =TRUE,size =1.5 ) +coord_sf(crs ="EPSG:3035",xlim =c(-15, 45),ylim =c(33, 70),default_crs = sf::st_crs(4326) ) +theme_minimal() +labs(x =NULL, y =NULL,title ="ETRS89 / LAEA Europe Projection",subtitle ="European Union projects" )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_6.png"),height =1200,width =1800,units ="px")
7. WGS 84 / Pseudo-Mercator
The WGS 84 / Pseudo-Mercator projection, also known as EPSG:3857, is closely related to the Web Mercator projection. It is designed for global-scale applications and is widely used for compatibility with web mapping platforms. This projection simplifies visualization but does not preserve distances or areas accurately.
Note
Antarctica cannot be plotted with Web Mercator projection, as it become hugely elongated. Must remove Antarctica before plotting in Web Mercator.
Code
g <-ggplot() +geom_sf(data = world |>filter(name !="Antarctica")) +coord_sf(crs ="EPSG:3857" ) +theme_minimal() +labs(title ="WGS 84 / Pseudo-Mercator Projection (EPSG:3857)",subtitle ="Simplifies visualization but does not preserve distances or areas accurately." )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_7.png"),height =1200,width =1800,units ="px")
8. Albers Equal Area
The Albers Equal Area projection, identified by EPSG:5070, is particularly useful for mapping datasets across the United States. This projection preserves area relationships, making it suitable for applications like land-use planning or resource management. It is often used in environmental studies and thematic mapping.
Code
g <- world |># filter(name == "United States of America") |> ggplot() +geom_sf(fill =NA ) +geom_sf_text(mapping =aes(label = name),check_overlap =TRUE,size =1.5 ) +coord_sf(crs ="EPSG:5070",# xlim = c(-15, 45),# ylim = c(33, 70),# default_crs = sf::st_crs(4326) ) +theme_minimal() +labs(x =NULL, y =NULL,title ="Albers Equal Area Projection",subtitle ="For mainland USA" )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_8.png"),height =1200,width =1800,units ="px")g <- world |>filter(name =="United States of America") |>ggplot() +geom_sf() +geom_sf_text(mapping =aes(label = name),check_overlap =TRUE,size =4 ) +coord_sf(crs ="EPSG:5070",xlim =c(-125, -67),ylim =c(25, 53),default_crs = sf::st_crs(4326) ) +theme_minimal() +labs(x =NULL, y =NULL,title ="Albers Equal Area Projection",subtitle ="Focussing on mainland USA" )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_8_2.png"),height =1200,width =1800,units ="px")
9. Lambert Conformal Conic (ESRI)
The Lambert Conformal Conic projection, represented by ESRI:102004, is a conformal projection widely used for mapping in North America. It minimizes distortion for regions with east-west orientation. This projection is often employed for regional-scale thematic mapping and analysis.
The Mollweide projection, identified by ESRI:54009, is an equal-area pseudo-cylindrical projection. It is ideal for global-scale thematic maps, such as climate or population density maps, where preserving area relationships is important. Its elliptical shape makes it visually distinct and effective for representing the entire world.
Code
g <-ggplot() +geom_sf(data = world ) +coord_sf(crs ="ESRI:54009" ) +theme_minimal() +labs(title ="Mollweide Projection (ESRI:54009)",subtitle ="For world maps, preserving area-relationships" )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_10.png"),height =1200,width =1800,units ="px")
11. Robinson (ESRI)
The Robinson projection, represented by ESRI:54030, is a compromise projection designed to create visually appealing world maps. It strikes a balance between distortion of shape, area, and distance, making it suitable for general-purpose global mapping. It is widely used in atlases and educational materials.
Code
g <-ggplot() +geom_sf(data = world ) +coord_sf(crs ="ESRI:54030" ) +theme_minimal() +labs(title ="Robinson Projection (ESRI:54030)",subtitle ="General purpose, visually appealing global maps." )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_11.png"),height =1200,width =1800,units ="px")
12. Sinusoidal (ESRI)
The Sinusoidal projection, identified by ESRI:54008, is an equal-area projection that is widely used for global-scale analysis. It is particularly effective for thematic maps showing area distribution, such as land cover or climate zones. Its straightforward representation of meridians makes it easy to interpret.
Code
g <-ggplot() +geom_sf(data = world ) +coord_sf(crs ="ESRI:54008" ) +theme_minimal() +labs(title ="Sinusoidal Projection (ESRI:54008)",subtitle ="An equal area projection, meridians are easier to interpret." )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_12.png"),height =1200,width =1800,units ="px")
13. Bonne (ESRI)
The Bonne projection, represented by ESRI:54024, is an equal-area projection often used for mapping continents. It minimizes area distortion while maintaining a pleasing, compact layout. It is suitable for thematic maps where regional relationships are critical.
Code
g <-ggplot() +geom_sf(data = world ) +coord_sf(crs ="ESRI:54024" ) +theme_minimal() +labs(title ="Bonne Projection (ESRI:54024)",subtitle ="An equal area projection, with focus on regional relationships." )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_13.png"),height =1200,width =1800,units ="px")
14. World Van der Grinten I (ESRI)
The World Van der Grinten I projection, identified by ESRI:54029, displays the entire world in a circular format. It offers an aesthetically pleasing view of global datasets, though it sacrifices accuracy in terms of area and shape. It is often used for decorative or general-purpose maps.
Note
The World Van der Grinten I projection, being circular, significantly expands Antarctica. SO it is best not to plot Antarctica with a world map in this projection.
Code
g <-ggplot() +geom_sf(data = world |>filter(name !="Antarctica") ) +coord_sf(crs ="ESRI:54029" ) +theme_minimal() +labs(title ="World Van der Grinten Projection (ESRI:54029)",subtitle ="An aesthetically pleasing, circular decorative World Map." )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_14.png"),height =1200,width =1800,units ="px")
15. Plate Carrée
The Plate Carrée projection, represented by EPSG:32662, is one of the simplest projections with equally spaced latitudes and longitudes. It is easy to work with but distorts area and shape significantly away from the equator. It is suitable for visualizing raw geographic data.
Code
g <-ggplot() +geom_sf(data = world ) +coord_sf(crs ="EPSG:32662" ) +theme_minimal() +labs(title ="Plate Carrée Projection (EPSG:32662)",subtitle ="For working with Raw data. Has equally spaced latitudes and longitudes." )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_15.png"),height =1200,width =1800,units ="px")
16. Transverse Mercator
The Transverse Mercator projection, associated with EPSG:4326, is a cylindrical projection ideal for narrow regions. It minimizes distortion along the central meridian, making it widely used for mapping zones like UTM. It is often employed in engineering and cadastral surveys.
The North Pole Stereographic projection, identified by EPSG:3413, is designed for mapping the Arctic region. It minimizes distortion near the pole, making it suitable for polar datasets, including sea ice and Arctic biodiversity.
The South Pole Stereographic projection, represented by EPSG:3031, is specifically designed for mapping the Antarctic region. It preserves the geometric properties near the pole and is commonly used for research on Antarctic ice sheets and ecosystems.
The Interrupted Goode Homolosine projection, identified by EPSG:54052, is a composite projection designed to minimize distortion of landmasses. It is particularly effective for global mapping that emphasizes land area accuracy and is often used in environmental studies.
Note
This interrupted composite projection severely distorts and pulls apart Greenland and Antarctica, so avoid plotting them with this projection.
The Krovak projection, associated with EPSG:5514, is widely used in the Czech Republic and Slovakia. It is tailored to their geographic extents, ensuring minimal distortion for regional applications. It is ideal for cadastral and engineering projects in these areas.
Code
g <- world |>filter(name %in%c("Czechia", "Slovakia")) |>ggplot() +geom_sf() +geom_sf_text(aes(label = name) ) +coord_sf(crs ="EPSG:5514" ) +theme_minimal() +labs(title ="Krovak Projection (EPSG:5514)",subtitle ="Used for Czechia and Slovakia, for minimal distortion in those regions" )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_20.png"),height =1200,width =1800,units ="px")
21. Asia North Lambert Conformal (ESRI)
The Asia North Lambert Conformal Conic projection, identified by ESRI:102026, is designed for northern Asia. It is suitable for mapping datasets across this vast region with minimal distortion. It is commonly used in regional studies and thematic mapping.
Code
g <- world |>filter(continent =="Asia"| name =="Russia") |>ggplot() +geom_sf() +coord_sf(crs ="ESRI:102026" ) +theme_minimal() +labs(title ="Asia North Lambert Conformal Projection",subtitle ="Used for plotting Northern Asia within minimal distortion" ) +theme(plot.title.position ="plot" )ggsave(plot = g,filename = here::here("geocomputation", "images","crs_projections_21.png"),height =1200,width =1800,units ="px")
22. Australia Albers
The Australia Albers projection, represented by EPSG:3577, is an equal-area projection optimized for Australia. It minimizes area distortion and is commonly used for environmental studies and resource management across the continent.