geo_coordinates: Extract coordinates as a tibble

Description Usage Arguments Value Examples

View source: R/geo-coordinates.R

Description

Extract coordinates as a tibble

Usage

1

Arguments

x

A geometry-like object, or one that can be coerced to a geometry-like object using as_geovctr().

...

Unused

Value

A tibble with one row per coordinate and columns feature and xy. Vectors that include mutli geometries will have a part column, and vectors that include polygons will have a ring column.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
geo_coordinates("POINT (20 17)")
geo_coordinates("POINT EMPTY")

geo_coordinates("LINESTRING EMPTY")
geo_coordinates("LINESTRING (30 10, 0 0)")

geo_coordinates("POLYGON EMPTY")
geo_coordinates("POLYGON ((30 10, 0 0, -30 10, 30 10))")

geo_coordinates(
  "MULTIPOLYGON (
    ((40 40, 20 45, 45 30, 40 40)),
    ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35),
      (30 20, 20 15, 20 25, 30 20))
  )"
)

paleolimbot/geovctrs documentation built on July 30, 2020, 3:41 p.m.