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

geometrycollection

Make WKT geometrycollection objects


Description

Make WKT geometrycollection objects

Usage

geometrycollection(...)

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

Examples

## 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)
)

wellknown

Convert Between 'WKT' and 'GeoJSON'

v0.7.2
MIT + file LICENSE
Authors
Scott Chamberlain [aut, cre] (<https://orcid.org/0000-0003-1444-9135>), Os Keyes [aut] (author of code in src/)
Initial release

We don't support your browser anymore

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