write_geojson_str | R Documentation |
Write SF to GeoJSON string
write_geojson_str(x, opts = list(), ..., json_opts = list())
write_geojson_file(x, filename, opts = list(), ..., json_opts = list())
x |
|
opts |
named list of options. Usually created with |
... |
any extra named options override those in |
json_opts |
Named list of vanilla JSON options as used by |
filename |
filename |
Character string containing GeoJSON, or NULL
if GeoJSON
written to file.
geojson_file <- system.file("geojson-example.json", package = 'yyjsonr')
sf <- read_geojson_file(geojson_file)
cat(write_geojson_str(sf, json_opts = opts_write_json(pretty = TRUE)))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.