s2intersect: Intersection or union of two spherical regions

Description Usage Arguments Value Examples

View source: R/s2region.R

Description

Intersection or union of two objects of class "s2region".

Usage

1

Arguments

x, y

Region on the sphere of class "s2region".

Value

Region on the sphere of class "s2region".

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
loop1 <- cbind(lon = c(0,60,60,0), lat = c(-40,-40,40,40))
loop2 <- cbind(lon = c(30,90,90,30), lat = c(-40,-40,40,40))
poly1 <- s2polygon(loop1)
poly2 <- s2polygon(list(loop2))
poly3 <- s2intersect(poly1, poly2)
poly4 <- s2union(poly1, poly2)
plot(poly1, eye = c(lon=45, lat=0), col = "red", eps = pi/100)
plot(poly2, col = "green", add = TRUE, eps = pi/100)
plot(poly3, col = "blue", add = TRUE, eps = pi/100)
plot(poly4, col = "cyan", eps = pi/100)

spatstat/spatstat.sphere documentation built on July 5, 2017, 11:47 p.m.