gridlinesWrap function

Adds long-lat grid for projected data

Adds long-lat grid for projected data

long-lat grid lines are added to a map in the coordinate system specified, allowing for map projections wrapped differently from the 180 meridian.

gridlinesWrap(crs, easts=seq(-180,180,by=60), norths=seq(-90,90,by=30), ndiscr=40, plotLines=TRUE, plotLabels = TRUE, ...)

Arguments

  • crs: A character string representing a CRS
  • easts: vector of longitudes
  • norths: vector of latitudes
  • ndiscr: number of intermediate points per line
  • plotLines: add lines to existing plot
  • plotLabels: add labels to existing plot
  • ...: Additional arguments passed to lines or text, for example lty=2

Returns

A list with elements lines, containg the graticule lines, and points containing the locations and labels for longitude and latitude values.

Author(s)

Patrick Brown

See Also

graticule

Examples

data('worldMap') worldMap = terra::unwrap(worldMap) crsMoll = moll(-100) worldMapT = wrapPoly(worldMap, crsMoll, buffer.width=200*1000) plot(attributes(crsMoll)$ellipse) plot(worldMapT, add=TRUE) gridlinesWrap(crsMoll, lty=3, col='red', cex=0.6)
  • Maintainer: Patrick Brown
  • License: GPL
  • Last published: 2024-04-16

Useful links