View source: R/mr_features_get.R
| mr_features_get | R Documentation | 
Get features
mr_features_get(
  type,
  featureID,
  maxFeatures = 100,
  format = "json",
  path = NULL,
  version = "2.0.0",
  ...
)
| type | (character) a region type, e.g., "MarineRegions:eez". required | 
| featureID | (character) a feature ID. required | 
| maxFeatures | (integer) Number of features. Default: 100 | 
| format | (character) output format, see Details for allowed options. Default: json | 
| path | (character) required when  | 
| version | (character) either 1.0.0 or 2.0.0 (default). In v1.0.0, the coordinates are in format y,x (long,lat), while in 2.0.0 the coordinates are in format x,y (lat,long) | 
| ... | Curl options passed on to  | 
Allowed options for the format parameter:
text/xml; subtype=gml/3.2
GML2
KML
SHAPE-ZIP
application/gml+xml; version=3.2
application/json
application/vnd.google-earth.kml xml
application/vnd.google-earth.kml+xml
csv
gml3
gml32
json
text/xml; subtype=gml/2.1.2
text/xml; subtype=gml/3.1.1
depends on the format option used, usually a text string
## Not run: 
# json by default
mr_features_get(type = "MarineRegions:eez", featureID = "eez.3")
# csv
mr_features_get(type = "MarineRegions:eez", featureID = "eez.3",
  format = "csv")
# KML
mr_features_get(type = "MarineRegions:eez", featureID = "eez.3",
  format = "KML")
# if you want SHAPE-ZIP, give a file path
# FIXME - shape files not working right now
# file <- tempfile(fileext = ".zip")
# mr_features_get(type = "MarineRegions:eez", featureID = "eez.3",
#   format = "SHAPE-ZIP", path = file)
# file.exists(file)
# unlink(file)
# glm32
mr_features_get(type = "MarineRegions:eez", featureID = "eez.3",
  format = "gml32")
# version parameter
## notice the reversed coordinates
mr_features_get(type = "MarineRegions:eez", featureID = "eez.3")
mr_features_get(type = "MarineRegions:eez", featureID = "eez.3",
  version = "1.0.0")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.