geometrycollection: Make WKT geometrycollection objects

Description Usage Arguments Details See Also Examples

View source: R/geometrycollection.R

Description

Make WKT geometrycollection objects

Usage

1

Arguments

...

Character string WKT objects representing a Point, LineString, Polygon, etc.

Details

This is different from the other functions that create WKT from R objects, in that we can't do the same thing for GeometryCollection's since many different WkT object could be created from the same input. So, this function accepts WKT strings already formed and attempts to creat a GeommetryCollection from them.

See Also

Other R-objects: circularstring(), 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
## empty geometrycollection
geometrycollection("empty")
# geometrycollection("stuff")

# Character string, returns itself
geometrycollection("GEOMETRYCOLLECTION(POINT(4 6), LINESTRING(4 6, 7 10))")

# From a point
geometrycollection(point(-116.4, 45.2))

# From two points
geometrycollection(point(-116.4, 45.2), point(-118.4, 49.2))

# From various object types
geometrycollection(point(-116.4, 45.2),
 linestring("LINESTRING (-116.4 45.2, -118.0 47.0)"),
 circularstring(list(c(1, 5), c(6, 2), c(7, 3)), fmt = 2)
)

Example output

Attaching package: 'wellknown'

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

    polygon

[1] "GEOMETRYCOLLECTION EMPTY"
[1] "GEOMETRYCOLLECTION(POINT(4 6), LINESTRING(4 6, 7 10))"
[1] "GEOMETRYCOLLECTION (POINT (-116.4000000000000057 45.2000000000000028))"
[1] "GEOMETRYCOLLECTION (POINT (-116.4000000000000057 45.2000000000000028), POINT (-118.4000000000000057 49.2000000000000028))"
[1] "GEOMETRYCOLLECTION (POINT (-116.4000000000000057 45.2000000000000028), LINESTRING (-116.4 45.2, -118.0 47.0), CIRCULARSTRING (1.00 5.00, 6.00 2.00, 7.00 3.00))"

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