circularstring: Make WKT circularstring objects

Description Usage Arguments See Also Examples

View source: R/circularstring.R

Description

Make WKT circularstring objects

Usage

1
circularstring(..., fmt = 16)

Arguments

...

A GeoJSON-like object representing a Point, LineString, Polygon, MultiPolygon, etc.

fmt

Format string which indicates the number of digits to display after the decimal point when formatting coordinates. Max: 20

See Also

Other R-objects: geometrycollection(), linestring(), multilinestring(), multipoint(), multipolygon(), point(), polygon()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
## empty circularstring
circularstring("empty")
# circularstring("stuff")

# Character string
circularstring("CIRCULARSTRING(1 5, 6 2, 7 3)")

# data.frame
df <- data.frame(lon = c(-116.4, -118), lat = c(45.2, 47))
circularstring(df, fmt=1)
df <- data.frame(lon=c(-116.4, -118, -120), lat=c(45.2, 47, 49))
circularstring(df, fmt=1)

# matrix
mat <- matrix(c(-116.4,-118, 45.2, 47), ncol = 2)
circularstring(mat, fmt=1)
mat2 <- matrix(c(-116.4, -118, -120, 45.2, 47, 49), ncol = 2)
circularstring(mat2, fmt=1)

# list
x <- list(c(1, 5), c(6, 2), c(7, 3))
circularstring(x, fmt=2)

Example output

Attaching package: 'wellknown'

The following object is masked from 'package:graphics':

    polygon

[1] "CIRCULARSTRING EMPTY"
[1] "CIRCULARSTRING(1 5, 6 2, 7 3)"
[1] "CIRCULARSTRING (-116.4 45.2, -118.0 47.0)"
[1] "CIRCULARSTRING (-116.4 45.2, -118.0 47.0, -120.0 49.0)"
[1] "CIRCULARSTRING (-116.4 45.2, -118.0 47.0)"
[1] "CIRCULARSTRING (-116.4 45.2, -118.0 47.0, -120.0 49.0)"
[1] "CIRCULARSTRING (1.00 5.00, 6.00 2.00, 7.00 3.00)"

wellknown documentation built on May 26, 2021, 1:06 a.m.