Mark lists as well-known "S" expressions
wksxp(x = list())parse_wksxp(x)
as_wksxp(x, ...)
# S3 method for default
as_wksxp(x, ...)
# S3 method for character
as_wksxp(x, ...)
# S3 method for wk_wksxp
as_wksxp(x, ..., include_z = NULL, include_m = NULL, include_srid = NULL)
# S3 method for wk_wkt
as_wksxp(x, ..., include_z = NULL, include_m = NULL, include_srid = NULL)
# S3 method for wk_wkb
as_wksxp(x, ..., include_z = NULL, include_m = NULL, include_srid = NULL)
A list()
features (see details)
Unused
Include the
values of the Z and M coordinates and/or SRID
in the output? Use FALSE
to omit, TRUE
to include, or NA
to include
only if present. Note that using TRUE
may result in an error if there
is no value present in the original.
Include the
values of the Z and M coordinates and/or SRID
in the output? Use FALSE
to omit, TRUE
to include, or NA
to include
only if present. Note that using TRUE
may result in an error if there
is no value present in the original.
Include the
values of the Z and M coordinates and/or SRID
in the output? Use FALSE
to omit, TRUE
to include, or NA
to include
only if present. Note that using TRUE
may result in an error if there
is no value present in the original.
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.
# NOT RUN {
wksxp(wkt_translate_wksxp("POINT (20 10)"))
# }
Run the code above in your browser using DataLab