makenbnurl: Build the URL to call NBN web-services

Description Usage Arguments Value Author(s) Examples

Description

The base URL for the RESTful services is: https://data.nbn.org.uk/api/ Parameters can be added, depending on the service called.

The following services are available at the time of writing:
taxonObservations?ptvk=<tvk>&datasetKey=<dataset>&startYear=<year> &endYear=<year>&featureID=<feature> - get observations for the given (list of) Taxon Version Keys (TVKs) for the given (list of) dataset keys optionally with dates between startYear and endYear and within the spatial feature, featureID (e.g. a vice-county). If no dataset keys are given then all publically available data for the taxa will be returned

features/<featureID> - get details about a particular location given its <featureID>

taxa/<tvk> - get details about a taxon given its <tvk>

Usage

1
2
3
4
makenbnurl(service = NULL, tvks = NULL, datasets = NULL, feature = NULL,
  startYear = NULL, endYear = NULL, list = NULL, VC = NULL,
  group = NULL, query = NULL, gridRef = NULL, polygon = NULL,
  attributes = FALSE)

Arguments

service

the service you want to call. One of "obs" for the taxonObservations service, "feature" for the features service, "taxon" for the taxa service, "list" for listing services, "ancestry" for taxonomy service, "species" for the species service and "query" for the search service.

tvks

a list of TVKs which are strings of 16 alphanumeric characters

datasets

a list of dataset keys which are strings of 8 alphanumeric characters

feature

a featureID an integer number

startYear

a 4 digit year

endYear

a 4 digit year

list

url segment as a string as required to append to the base url to give the list required as a part of the "list" service

VC

a string giving a vice-county name (see listVCs)

group

a string giving the name of a group (see listGroups)

query

a string used to search for taxa

gridRef

a string giving a gridreference in which to search for occurrences

polygon

A WKT (Well-Known Text) polygon string. Note that polygons containing many verticies (>100) are likely to create queries that exceed the NBN character limit

attributes

if TRUE then attribute data is returned

Value

the URL to call - a character string

Author(s)

Stuart Ball, JNCC stuart.ball@jncc.gov.uk

Examples

1
2
3
4
5
6
makenbnurl(service="obs", tvks="NBNSYS0000007073")
makenbnurl(service="obs", tvks="NBNSYS0000007073", datasets="SGB00001")
makenbnurl(service="obs", tvks="NBNSYS0000007073", datasets="SGB00001",
           startYear="1990", endYear="2010")
makenbnurl(service="feature", feature="284443")
makenbnurl(service="taxon", tvks="NBNSYS0000007073")


rnbn documentation built on April 6, 2017, 6:29 a.m.
Search within the rnbn package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.