g_coords | R Documentation |
g_coords()
extracts coordinate values (vertices) from the input geometries
and returns a data frame with coordinates as columns.
g_coords(geom)
geom |
Either a raw vector of WKB or list of raw vectors, or a character vector containing one or more WKT strings. |
A data frame as returned by wk::wk_coords()
: columns feature_id
(the index of the feature from the input), part_id
(an arbitrary integer
identifying the point, line, or polygon from whence it came), ring_id
(an
arbitrary integer identifying individual rings within polygons), and one
column per coordinate (x
, y
, and/or z
and/or m
).
dsn <- system.file("extdata/ynp_fires_1984_2022.gpkg", package="gdalraster")
lyr <- new(GDALVector, dsn)
d <- lyr$fetch(10)
vertices <- g_coords(d$geom)
head(vertices)
lyr$close()
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.