brapi_post_search_locations: post /search/locations

View source: R/brapi_post_search_locations.R

brapi_post_search_locationsR Documentation

post /search/locations

Description

Submit a search request for Locations

Usage

brapi_post_search_locations(
  con = NULL,
  abbreviations = "",
  altitudeMax = as.integer(NA),
  altitudeMin = as.integer(NA),
  coordinates = list(),
  countryCodes = "",
  countryNames = "",
  externalReferenceIDs = "",
  externalReferenceSources = "",
  instituteAddresses = "",
  instituteNames = "",
  locationDbIds = "",
  locationNames = "",
  locationTypes = "",
  page = 0,
  pageSize = 1000
)

Arguments

con

list; required: TRUE; BrAPI connection object

abbreviations

vector of type character; required: FALSE; Location abbreviation(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

altitudeMax

integer; required: FALSE; The maximum altitude to search for.

altitudeMin

integer; required: FALSE; The minimum altitude to search for.

coordinates

list; required: FALSE; A GeoJSON Polygon geometry, as defined by GeoJSON (RFC 7946), which describes an area to search for other GeoJSON objects. All contained Points and intersecting Polygons are returned as search results. The coordinates are decimal values on the WGS84 geographic coordinate reference system. A coordinate position MUST be two or more elements. The first two elements are longitude and latitude, or easting and northing, precisely in that order and using decimal numbers. Altitude or elevation MAY be included as an optional third element and is specified in meters.

The coordinates list MUST contain the following two elements:

  • geometry as a list; required: TRUE; A geometry as defined by GeoJSON (RFC 7946). In this context, only Polygon geometry is allowed .

    The Polygon geometry is described by exactly two elements:

    • coordinates as a list; required : TRUE; List of linear rings, where each linear ring is a list of at least four positions with the first equal to the last. The first linear ring specifies the exterior ring, and each subsequent ring an interior ring.

    • type as a character; required: TRUE; Literally specified as "Polygon".

  • type as a character; required: TRUE; Literally specified as "Feature".

The easiest way in R to construct the coordinates list is to use the geojsonR package. The Examples section shows how to create a coordinates list object for a polygon geometry.

countryCodes

vector of type character; required: FALSE; Country code(s), specified in the ISO_3166-1_alpha-3 specification, to search for; default: "", when using multiple values supply as c("value1", "value2").

countryNames

vector of type character; required: FALSE; Full country name(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

externalReferenceIDs

vector of type character; required: FALSE; External reference identifier(s) to search for. Could be a simple strings or a URIs (use with externalReferenceSources parameter).; default: "", when using multiple values supply as c("value1", "value2").

externalReferenceSources

vector of type character; required: FALSE; Source system or database identifier(s) of an external reference(s) to search for (use with externalReferenceIDs parameter); default: "", when using multiple values supply as c("value1", "value2").

instituteAddresses

vector of type character; required: FALSE; The institute street address(es) to search for; default: "", when using multiple values supply as c("value1", "value2").

instituteNames

vector of type character; required: FALSE; The institute name(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

locationDbIds

vector of type character; required: FALSE; The unique location identifier(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

locationNames

vector of type character; required: FALSE; A human readable location name(s) to search for; default: "", when using multiple values supply as c("value1", "value2").

locationTypes

vector of type character; required: FALSE; The location type(s) (e.g. Breeding Location, Storage Location, etc.) to search for; default: "", when using multiple values supply as c("value1", "value2").

page

integer; required: FALSE; Which result page is requested. The page indexing starts at 0 (the first page is 'page'= 0). Default is 0.

pageSize

integer; required: FALSE; The size of the pages to be returned. Default is 1000.

Details

Advanced searching for the locations resource. Function will return either the search results (Status 200 for an immediate response) or a searchResultsDbId (Status 202 for both a saved and an asynchronous search).

Value

data.frame

Author(s)

Maikel Verouden

References

BrAPI SwaggerHub

See Also

Other brapi-core: brapi_get_commoncropnames(), brapi_get_lists_listDbId(), brapi_get_lists(), brapi_get_locations_locationDbId(), brapi_get_locations(), brapi_get_people_personDbId(), brapi_get_people(), brapi_get_programs_programDbId(), brapi_get_programs(), brapi_get_search_lists_searchResultsDbId(), brapi_get_search_locations_searchResultsDbId(), brapi_get_search_people_searchResultsDbId(), brapi_get_search_programs_searchResultsDbId(), brapi_get_search_studies_searchResultsDbId(), brapi_get_search_trials_searchResultsDbId(), brapi_get_seasons_seasonDbId(), brapi_get_seasons(), brapi_get_serverinfo(), brapi_get_studies_studyDbId(), brapi_get_studies(), brapi_get_studytypes(), brapi_get_trials_trialDbId(), brapi_get_trials(), brapi_post_lists_listDbId_items(), brapi_post_lists(), brapi_post_locations(), brapi_post_people(), brapi_post_programs(), brapi_post_search_lists(), brapi_post_search_people(), brapi_post_search_programs(), brapi_post_search_studies(), brapi_post_search_trials(), brapi_post_seasons(), brapi_post_studies(), brapi_post_trials(), brapi_put_lists_listDbId(), brapi_put_locations_locationDbId(), brapi_put_people_personDbId(), brapi_put_programs_programDbId(), brapi_put_seasons_seasonDbId(), brapi_put_studies_studyDbId(), brapi_put_trials_trialDbId()

Other Locations: brapi_get_locations_locationDbId(), brapi_get_locations(), brapi_get_search_locations_searchResultsDbId(), brapi_post_locations(), brapi_put_locations_locationDbId()

Examples

## Not run: 
con <- brapi_db()$testserver
con[["token"]] <- "YYYY"

# Immediate Response Example
brapi_post_search_locations(con = con,
                            abbreviations = "L1")

# Saved or Asynchronous Search Response Example
brapi_post_search_locations(con = con,
                            abbreviations = c("L1", "L2", "L3"),
                            countryCodes = "PER",
                            countryNames = "Peru",
                            locationNames = c("Location 1", "Location 2"),
                            locationTypes = "Breeding location")

## End(Not run)


mverouden/brapir-v2 documentation built on April 22, 2022, 9:24 a.m.