R: Mark lists as well-known "S" expressions

wksxp {wk} | R Documentation

## Mark lists as well-known "S" expressions

### Description

Mark lists as well-known "S" expressions

### Usage

    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)

### Arguments

`x` | A `list()` features (see details)
`...` | Unused
`include_z` | 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_m` | 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_srid` | 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.

### Details

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.

### Value

A `new_wk_wksxp()`

### Examples

    wksxp(wkt_translate_wksxp("POINT (20 10)"))

[Package wk version 0.3.4 Index]