sfg_multipolygon | R Documentation |
constructs sfg MULTIPOLYGON object
sfg_multipolygon(
obj,
x = NULL,
y = NULL,
z = NULL,
m = NULL,
polygon_id = NULL,
linestring_id = NULL,
close = TRUE
)
obj |
matrix or data.frame |
x |
x geometry column |
y |
y geometry column |
z |
z geometry column |
m |
m geometry column |
polygon_id |
column of ids for polygons (within the multipolygon) |
linestring_id |
column of ids for lines (within polygons) |
close |
logical indicating whether polygons should be closed. If |
sfg
object of MULTIPOLYGON geometry
df <- data.frame(
polygon_id = c(rep(1, 5), rep(2, 10))
, line_id = c(rep(1, 10), rep(2, 5))
, x = c(0,0,1,1,0,2,2,5,5,2,3,3,4,4,3)
, y = c(0,1,1,0,0,2,5,5,2,2,3,4,4,3,3)
, z = c(1)
, m = c(1)
)
m <- as.matrix( df )
sfg_multipolygon( df[, c("x","y") ] )
sfg_multipolygon(
df, x = "x", y = "y", polygon_id = "polygon_id", linestring_id = "line_id"
)
sfg_multipolygon(
df, x = "x", y = "y", z = "z", polygon_id = "polygon_id", linestring_id = "line_id"
)
sfg_multipolygon(
df, x = "x", y = "y", z = "z", m = "m", polygon_id = "polygon_id", linestring_id = "line_id"
)
sfg_multipolygon( m[, c("x","y") ] )
sfg_multipolygon(
m, x = "x", y = "y", polygon_id = "polygon_id", linestring_id = "line_id"
)
sfg_multipolygon(
m, x = "x", y = "y", z = "z", polygon_id = "polygon_id", linestring_id = "line_id"
)
sfg_multipolygon(
m, x = "x", y = "y", z = "z", m = "m", polygon_id = "polygon_id", linestring_id = "line_id"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.