gridlinesWrap: Adds long-lat grid for projected data

View source: R/gridlinesWrap.R

gridlinesWrapR Documentation

Adds long-lat grid for projected data

Description

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

Usage

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

Value

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)



mapmisc documentation built on April 15, 2024, 3 p.m.