Description Usage Arguments Value Examples
Unwrap a coordinate from a Feature with a Point geometry, or a single coordinate.
1 | lawn_getcoord(x, lint = FALSE)
|
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: |
matrix of coordinates, where each row in the matrix is a coordinate pair
1 2 3 4 5 6 7 8 9 10 11 12 | x <- "{ type: 'Point', coordinates: [10, 50] }"
lawn_getcoord(x)
library(jsonlite)
x <- fromJSON(lawn_data$points_count, FALSE)$features
lawn_getcoord(x[[1]])
lawn_getcoord(x[[2]])
lawn_getcoord(x[[1]]$geometry)
lawn_getcoord(x[[1]]$geometry$coordinates)
# fails
# lawn_getcoord(x[[1]]$geometry$coordinates[[1]])
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.