wk_handle: Read geometry vectors

View source: R/handler.R

wk_handle.wk_crcR Documentation

Read geometry vectors

Description

The handler is the basic building block of the wk package. In particular, the wk_handle() generic allows operations written as handlers to "just work" with many different input types. The wk package provides the wk_void() handler, the wk_format() handler, the wk_debug() handler, the wk_problems() handler, and wk_writer()s for wkb(), wkt(), xy(), and sf::st_sfc()) vectors.

Usage

## S3 method for class 'wk_crc'
wk_handle(
  handleable,
  handler,
  ...,
  n_segments = getOption("wk.crc_n_segments", NULL),
  resolution = getOption("wk.crc_resolution", NULL)
)

## S3 method for class 'wk_rct'
wk_handle(handleable, handler, ...)

## S3 method for class 'sfc'
wk_handle(handleable, handler, ...)

## S3 method for class 'wk_wkb'
wk_handle(handleable, handler, ...)

## S3 method for class 'wk_wkt'
wk_handle(handleable, handler, ...)

## S3 method for class 'wk_xy'
wk_handle(handleable, handler, ...)

wk_handle(handleable, handler, ...)

is_handleable(handleable)

new_wk_handler(handler_ptr, subclass = character())

is_wk_handler(handler)

as_wk_handler(handler, ...)

## S3 method for class 'sfg'
wk_handle(handleable, handler, ...)

## S3 method for class 'sf'
wk_handle(handleable, handler, ...)

## S3 method for class 'bbox'
wk_handle(handleable, handler, ...)

Arguments

handleable

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

handler

A wk_handler object.

...

Passed to the wk_handle() method.

n_segments, resolution

The number of segments to use when approximating a circle. The default uses getOption("wk.crc_n_segments") so that this value can be set for implicit conversions (e.g., as_wkb()). Alternatively, set the minimum distance between points on the circle (used to estimate n_segments). The default is obtained using getOption("wk.crc_resolution").

handler_ptr

An external pointer to a newly created WK handler

subclass

The handler subclass

Value

A WK handler.


wk documentation built on Oct. 22, 2023, 9:07 a.m.