ggMap_getBasemapLayers: Create basemap layers for maps based on the 'ggplot2' package

View source: R/ggMap_getBasemapLayers.R

ggMap_getBasemapLayersR Documentation

Create basemap layers for maps based on the ggplot2 package

Description

This function creates a basemap layer for maps based on the ggplot2 package.

Usage

ggMap_getBasemapLayers(
  layer.land = wtsGIS::getPackagedLayer("Alaska"),
  layer.bathym = wtsGIS::getPackagedLayer("ShelfBathymetry"),
  final.crs = wtsGIS::get_crs("WGS84"),
  bbox = wtsROMS::getStandardBBox("CGOA shelf"),
  colors.bg = "white",
  colors.land = "grey85",
  colors.bathym = "darkblue",
  alpha.bathym = 1
)

Arguments

layer.land

- a sf::sf object representing land

layer.bathym

- a sf::sf object representing bathymetry

final.crs

- representation of final (display) coordinate reference system (see details)

bbox

- a bounding box (see details; default is "CGOA shelf")

colors.bg

- background color

colors.land

- color for land

colors.bathym

- color for the bathymetry

alpha.bathym

- transparency for the bathymetry

Details

The basemap contains a land layer (polygons) and a bathymetry layer (lines). Uses getPackagedLayer or readShapefile to create the land and bathymetric layers. If bbox is NULL, then the bounding box for the land layer is used as the bounding box for the basemap.

This convenience function delegates all work to gg_CreateBasemapLayers. The final coordinate reference system (final.crs) can be any object that can be converted to a sf::crs object using get_crs.

The bounding box (bbox) can be any object that can be converted to a link[sf]{bbox} using getBBox.

Value

- a list of basemap layers based on the ggplot2 package, with elements #'

  • bathym - geom_sf layer for bathymetry-based grid polygons

  • land - geom_sf layer for land-based grid polygons

  • map_scale - ggplot2 coord_sf object

  • theme - partial ggplot2 theme with axis titles removed

See Also

See also gg_CreateBasemapLayers, getBBox, get_crs, getPackagedLayer, getPackagedLayer, getStandardBBox.


wStockhausen/rDisMELS documentation built on March 27, 2022, 1 a.m.