Learn R Programming

graticule (version 0.1.0)

pathologicule: Create a mesh of evenly spaced lines in another projection.

Description

Create a mesh of evenly spaced lines in another projection.

Usage

pathologicule(x, proj)

Arguments

x
object to build line mesh for
proj
the other projection

Value

  • spatial object

Examples

Run this code
library(maptools)
data(wrld_simpl)
library(raster)
w <- subset(wrld_simpl, NAME == "Australia")
plot(w)
laea <- pathologicule(w, "+proj=laea +lon_0=147 +lat_0=-42 +ellps=WGS84")
stere <- pathologicule(w, "+proj=stere +lon_0=147 +lat_0=-42 +ellps=WGS84")
plot(laea, add = TRUE, col = "dodgerblue")
plot(stere, add = TRUE, col = "firebrick")

stere <- "+proj=stere +lat_0=-90 +ellps=WGS84"
p <- spTransform(subset(wrld_simpl, coordinates(wrld_simpl)[,2] < -20), stere)
plot(extent(p) + 1e6, asp = 1, type = "n"); plot(p, add = TRUE)
laea <- pathologicule(p, "+proj=laea +lon_0=147 +lat_0=-72 +ellps=WGS84")
stere <- pathologicule(p, "+proj=stere +lon_0=147 +lat_0=-42 +ellps=WGS84")
plot(laea, add = TRUE, col = "dodgerblue")
plot(stere, add = TRUE, col = "firebrick")

Run the code above in your browser using DataLab