wkb_coords {wkutils}R Documentation

Extract coordinates from well-known geometries

Description

These functions are optimised for graphics output, which in R require flat coordinate structures. See graphics::points(), graphics::lines(), and graphics::polypath() for how to send these to a graphics device, or grid::pointsGrob(), grid::linesGrob(), and grid::pathGrob() for how to create graphical objects using this output.

Usage

wkb_coords(wkb, sep_na = FALSE)

wkt_coords(wkt, sep_na = FALSE)

Arguments

wkb

A list() of raw() vectors, such as that returned by sf::st_as_binary().

sep_na

Use TRUE to separate geometries and linear rings with a row of NAs. This is useful for generating output that can be fed directly to graphics::polypath() or graphics::lines() without modification.

wkt

A character vector containing well-known text.

Value

A data.frame with columns:

Examples

text <- c("LINESTRING (0 1, 19 27)", "LINESTRING (-1 -1, 4 10)")
wkt_coords(text)
wkt_coords(text, sep_na = TRUE)


[Package wkutils version 0.1.3 Index]