lawn_coordall: Get all coordinates from any GeoJSON object, returning an...

Description Usage Arguments Value Examples

View source: R/cordall.R

Description

Takes any data-GeoJSON and returns an array of coordinate arrays

Usage

1
lawn_coordall(x, lint = FALSE)

Arguments

x

any data-GeoJSON object

lint

(logical) Lint or not. Uses geojsonhint. Takes up increasing time as the object to get linted increases in size, so probably use by default for small objects, but not for large if you know they are good geojson objects. Default: FALSE

Value

matrix of coordinates, where each row in the matrix is a coordinate pair

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
lawn_point(c(-74.5, 40)) %>% lawn_coordall()

rings <- list(list(
   c(-2.275543, 53.464547),
   c(-2.275543, 53.489271),
   c(-2.215118, 53.489271),
   c(-2.215118, 53.464547),
   c(-2.275543, 53.464547)
))
lawn_polygon(rings) %>% lawn_coordall()

lawn documentation built on Jan. 6, 2021, 5:07 p.m.