Create lines, polygons, and collections

wk_linestring(handleable, feature_id = 1L, ...)

wk_polygon(handleable, feature_id = 1L, ring_id = 1L, ...)

wk_collection(
  handleable,
  geometry_type = wk_geometry_type("geometrycollection"),
  feature_id = 1L,
  ...
)

wk_linestring_filter(handler, feature_id = 1L)

wk_polygon_filter(handler, feature_id = 1L, ring_id = 1L)

wk_collection_filter(
  handler,
  geometry_type = wk_geometry_type("geometrycollection"),
  feature_id = 1L
)

Arguments

handleable

A geometry vector (e.g., wkb(), wkt(), xy(), rct(), or sf::st_sfc()) for which wk_handle() is defined.

feature_id

An identifier where changes in sequential values indicate a new feature. This is recycled silently as needed.

...

Passed to the wk_handle() method.

ring_id

An identifier where changes in sequential values indicate a new ring. Rings are automatically closed. This is recycled silently as needed.

geometry_type

The collection type to create.

handler

A wk_handler object.

Value

An object of the same class as handleable with whose coordinates have been assembled into the given type.

Examples

wk_linestring(xy(c(1, 1), c(2, 3)))
#> <wk_wkb[1]> #> [1] <LINESTRING (1 2, 1 3)>
wk_polygon(xy(c(0, 1, 0), c(0, 0, 1)))
#> <wk_wkb[1]> #> [1] <POLYGON ((0 0, 1 0, 0 1...>
wk_collection(xy(c(1, 1), c(2, 3)))
#> <wk_wkb[1]> #> [1] <GEOMETRYCOLLECTION (POINT (1 2), POINT (1 3))>