Learn R Programming

geos (version 0.2.4)

geos_geometry_n: Access child geometries

Description

Access child geometries

Usage

geos_geometry_n(geom, n)

geos_ring_n(geom, n)

Value

A GEOS geometry vector along the recycled length of geom and i.

Arguments

geom

A GEOS geometry vector

n

The (one-based) index of the child geometry

Examples

Run this code
multipoint <- "MULTIPOINT (0 0, 1 1, 2 2)"
geos_geometry_n(multipoint, seq_len(geos_num_geometries(multipoint)))

poly <- "POLYGON ((0 0, 0 1, 1 0, 0 0), (0.1 0.1, 0.1 0.2, 0.2 0.1, 0.1 0.1))"
geos_ring_n(poly, seq_len(geos_num_rings(poly)))

Run the code above in your browser using DataLab