Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

wkt_grob

Generate grid geometries from well-known geometries


Description

Using wkt_meta() and wkt_coords(), these functions create graphical objects using the grid package. Vectors that contain geometries of a single dimension are efficiently packed into a grid::pointsGrob(), grid::polylineGrob(), or grid::pathGrob(). Vectors with mixed types and nested collections are encoded less efficiently using a grid::gTree().

Usage

wkt_grob(
  wkt,
  ...,
  rule = "evenodd",
  default.units = "native",
  name = NULL,
  vp = NULL
)

wkb_grob(
  wkt,
  ...,
  rule = "evenodd",
  default.units = "native",
  name = NULL,
  vp = NULL
)

Arguments

wkt

A character vector containing well-known text.

...

Graphical parameters passed to grid::gpar(). These are recycled along the input. Dynamic dots (e.g., !!!) are supported.

rule

Use "winding" if polygon rings are correctly encoded with a winding direction.

default.units

Coordinate units, which may be defined by the viewport (see grid::unit()). Defaults to native.

name, vp

Passed to grid::pointsGrob(), grid::polylineGrob(), grid::pathGrob(), or grid::gTree() depending on the types of geometries in the input.

Value

Examples

grid::grid.newpage()
grid::grid.draw(wkt_grob("POINT (0.5 0.5)", pch = 16, default.units = "npc"))

wkutils

Utilities for Well-Known Geometry Vectors

v0.1.1
MIT + file LICENSE
Authors
Dewey Dunnington [aut, cre] (<https://orcid.org/0000-0002-9415-4582>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.