Skip to contents

Get coordinates

Usage

geo_get_coords(x)

Arguments

x

geojson string

Value

a character vector with coordinates as JSON

Details

You can use jsonlite to convert the output to R objects

Examples

if (FALSE) { # \dontrun{
x <- '{"type": "Feature", "geometry": {"type": "Point","coordinates": [1, 2]},"properties": {}}'
geo_get_coords(x)
x <- '{"type": "Point", "coordinates": [1, 2]}'
geo_get_coords(x)
x <- '[0, 5]'
geo_get_coords(x)
} # }