View source: R/vertex-filter.R
wk_vertices | R Documentation |
These functions provide ways to extract individual coordinate values.
Whereas wk_vertices()
returns a vector of coordinates as in the same
format as the input, wk_coords()
returns a data frame with coordinates
as columns.
wk_vertices(handleable, ...)
wk_coords(handleable, ...)
wk_coords(handleable, use_z = NA, use_m = NA) <- value
wk_vertex_filter(handler, add_details = FALSE)
handleable |
A geometry vector (e.g., |
... |
Passed to the |
use_z , use_m |
Used to declare the output type. Use |
value |
An |
handler |
A wk_handler object. |
add_details |
Use |
wk_coords<-
is the replacement-function version of 'wk_coords'.
Using the engine of wk_trans_explicit()
the coordinates of an object
can be transformed in a generic way using R functions as needed.
wk_vertices()
extracts vertices and returns the in the same format as
the handler
wk_coords()
returns a data frame with columns columns feature_id
(the index of the feature from whence it came), 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
).
wk_vertices(wkt("LINESTRING (0 0, 1 1)"))
wk_coords(wkt("LINESTRING (0 0, 1 1)"))
# wk_coords() replacement function
x <- xy(1:5, 1:5)
y <- as_wkt(x)
wk_coords(y) <- cbind(5:1, 0:4)
wk_coords(x) <- y[5:1]
y
x
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.