1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/grob.R
\name{wkt_grob}
\alias{wkt_grob}
\alias{wkb_grob}
\title{Generate grid geometries from well-known geometries}
\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{
\item{wkt}{A character vector containing well-known text.}
\item{...}{Graphical parameters passed to \code{\link[grid:gpar]{grid::gpar()}}. These are recycled along
the input. Dynamic dots (e.g., \verb{!!!}) are supported.}
\item{rule}{Use "winding" if polygon rings are correctly encoded with a winding
direction.}
\item{default.units}{Coordinate units, which may be defined by the viewport (see
\code{\link[grid:unit]{grid::unit()}}). Defaults to native.}
\item{name, vp}{Passed to \code{\link[grid:grid.points]{grid::pointsGrob()}}, \code{\link[grid:grid.lines]{grid::polylineGrob()}},
\code{\link[grid:grid.path]{grid::pathGrob()}}, or \code{\link[grid:grid.grob]{grid::gTree()}} depending on the types of geometries
in the input.}
}
\value{
A \link[grid:grid.grob]{graphical object}
}
\description{
Using \code{\link[=wkt_meta]{wkt_meta()}} and \code{\link[=wkt_coords]{wkt_coords()}}, these functions create graphical objects
using the grid package. Vectors that contain geometries of a single dimension
are efficiently packed into a \code{\link[grid:grid.points]{grid::pointsGrob()}}, \code{\link[grid:grid.lines]{grid::polylineGrob()}},
or \code{\link[grid:grid.path]{grid::pathGrob()}}. Vectors with mixed types and nested collections are encoded
less efficiently using a \code{\link[grid:grid.grob]{grid::gTree()}}.
}
\examples{
grid::grid.newpage()
grid::grid.draw(wkt_grob("POINT (0.5 0.5)", pch = 16, default.units = "npc"))
}
|