| wksxp {wk} | R Documentation |
Mark lists as well-known "S" expressions
wksxp(x = list()) parse_wksxp(x) as_wksxp(x, ...) ## Default S3 method: as_wksxp(x, ...) ## S3 method for class 'character' as_wksxp(x, ...) ## S3 method for class 'wk_wksxp' as_wksxp(x, ..., include_z = NULL, include_m = NULL, include_srid = NULL) ## S3 method for class 'wk_wkt' as_wksxp(x, ..., include_z = NULL, include_m = NULL, include_srid = NULL) ## S3 method for class 'wk_wkb' as_wksxp(x, ..., include_z = NULL, include_m = NULL, include_srid = NULL)
x |
A |
... |
Unused |
include_z |
Include the
values of the Z and M coordinates and/or SRID
in the output? Use |
include_m |
Include the
values of the Z and M coordinates and/or SRID
in the output? Use |
include_srid |
Include the
values of the Z and M coordinates and/or SRID
in the output? Use |
The "wksxp" format is experimental, but was written as a way to
make it possible for packages to generate wkb() vectors without
needing to use C++. The format represents geometries as following:
points are matrices with zero or one row
linestrings are matrices (one row per point)
polygons are lists of matrices (one matrix per ring)
multi (point, linestring, polygon) types are lists of the simple types (without any meta information)
collections are lists of any type (must contain meta)
Any geometry that isn't in a multi type must have meta information encoded as attributes. The attribures that are used are:
class: "wk_(point|linestring|...)
has_z: use TRUE if there is a Z coordinate
(may be omitted if false)
has_m: use TRUE if there is an M coordinate
(may be omitted if false)
This is similar to the sf::st_sfc() format, but the formats aren't
interchangable.
wksxp(wkt_translate_wksxp("POINT (20 10)"))