s2intersect | R Documentation |
Intersection or union of two objects of class "s2region"
.
s2intersect(x, y, options = s2::s2_options())
x, y |
Region on the sphere of class |
options |
List of class |
Region on the sphere of class "s2region"
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.