mr_features_get: Get features

Description Usage Arguments Details Value Examples

View source: R/mr_features_get.R

Description

Get features

Usage

1
2
mr_features_get(type, featureID, maxFeatures = 100, format = "json",
  path = NULL, version = "2.0.0", ...)

Arguments

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 format="SHAPE-ZIP", otherwise, ignored

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 GET

Details

Allowed options for the format parameter:

Value

depends on the format option used, usually a text string

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
## 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)

mregions documentation built on May 2, 2019, 6:53 a.m.