R/get_vessel_info.R
get_vessel_info.Rd
Base function to get vessel information from API and convert response to data frame
When search_type = "search"
, a length-1 vector with the identity
variable of interest, MMSI, IMO, call sign or ship name.
When search_type = "search"
, an SQL expression to find the vessel of interest
When search_type = "id"
, a vector with the vesselId of interest
Enhances the response with new information, defaults to include all.
"OWNERSHIP"
returns ownership information
"AUTHORIZATIONS"
lists public authorizations for that vessel
"MATCH_CRITERIA"
adds information about the reason why a vessel is returned
Optional. Allows to filter by matchFields
levels.
Possible values: "SEVERAL_FIELDS"
, "NO_MATCH"
, "ALL"
. Incompatible with where
when search_type == "id"
, gets all the registry
objects, only the delta or the latest.
"NONE"
The API will return the most recent object only
"DELTA"
The API will return only the objects when the vessel changed one or more identity properties
"ALL"
The registryInfo array will return the same number of objects that rows we have in the vessel database
Type of vessel search to perform. Can be "search"
or
"id"
. (Note:"advanced"
and "basic"
are no longer in use as of gfwr 2.0.0.)
Authorization token. Can be obtained with gfw_auth()
function
Boolean. Whether to print the request, for debugging purposes. When contacting the GFW team it will be useful to send this string
Other parameters, such as limit and offset
When search_type = "search"
the search takes basic identity features like
MMSI, IMO, callsign, shipname as inputs, using parameter "query"
. For more advanced
SQL searches, use parameter "where"
. You can combine logic operators like AND
,
OR
, =
, >=
, <, LIKE
(for fuzzy matching). The id
search allows the user
to search using a GFW vessel id.
if (FALSE) {
library(gfwr)
# Simple searches, using includes
get_vessel_info(query = 224224000, search_type = "search",
key = gfw_auth())
# Advanced search with where instead of query:
get_vessel_info(where = "ssvid = '441618000' OR imo = '9047271'",
search_type = "search", key = gfw_auth())
# Vessel id search
get_vessel_info(search_type = "id",
ids = c("8c7304226-6c71-edbe-0b63-c246734b3c01",
"6583c51e3-3626-5638-866a-f47c3bc7ef7c"), key = gfw_auth())
all <- get_vessel_info(search_type = "id",
ids = c("8c7304226-6c71-edbe-0b63-c246734b3c01"),
registries_info_data = c("ALL"), key = gfw_auth())
none <- get_vessel_info(search_type = "id",
ids = c("8c7304226-6c71-edbe-0b63-c246734b3c01"),
registries_info_data = c("NONE"), key = gfw_auth())
delta <- get_vessel_info(search_type = "id",
ids = c("8c7304226-6c71-edbe-0b63-c246734b3c01"),
registries_info_data = c("DELTA"), key = gfw_auth())
}