Learn R Programming

rsgeo (version 0.1.7)

expand_geoms: Expand Geometries

Description

Expands geometries into a list of vectors of their components.

Usage

expand_geoms(x)

Value

A list of rsgeo vectors containing each original geometry's components as a new vector.

Arguments

x

an object of class rsgeo

Details

  • rs_MULTIPOINT expands into a vector of points

  • rs_LINESTRING expands into a vector points

  • rs_MULTILINESTRING expands into a vector of linestrings

  • rs_POLYGON expands into a vector of linestrings

  • rs_MULTIPOLYGON expands into a vector of polygons

If you wish to have a single vector returned, pass the results into flatten_geoms().

Examples

Run this code
mpnts <- geom_multipoint(runif(10), runif(10), rep.int(1:5, 2))
expand_geoms(mpnts)

Run the code above in your browser using DataLab