View source: R/region_geojson.R
mr_geojson | R Documentation |
Get a Marineregions geojson file
mr_geojson(key = NULL, name = NULL, maxFeatures = 50, ...)
key |
(character) Region key, of the form |
name |
(character) Region name, if you supply this, we search
against titles via |
maxFeatures |
(integer) Number of features to return. Default: |
... |
Curl options passed on to |
an S3 class of type mr_geojson
, just a thin wrapper around
a list. The list has names:
type (character) - the geojson type (e.g., FeatureCollection)
totalFeatures (integer) - the
features (list) - the features, with slots for each feature: type, id, geometry, geometry_name, and properties
crs (list) - the coordinate reference system
bbox (list) - the bounding box that encapsulates the object
## Not run:
# by key
res1 <- mr_geojson(key = "Morocco:dam")
# by name -- not working right now
if (requireNamespace("geojsonio")) {
library("geojsonio")
as.json(unclass(res1)) %>% map_leaf
# MEOW - marine ecoregions
as.json(unclass(mr_geojson("Ecoregions:ecoregions"))) %>% map_leaf()
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.