Base function to get raster from API and convert response to data frame

get_raster(
  spatial_resolution = NULL,
  temporal_resolution = NULL,
  group_by = NULL,
  filter_by = NULL,
  date_range = NULL,
  region = NULL,
  region_source = NULL,
  key = gfw_auth()
)

Arguments

spatial_resolution

raster spatial resolution. Can be "low" = 0.1 degree or "high" = 0.01 degree

temporal_resolution

raster temporal resolution. Can be 'daily','monthly','yearly'.

group_by

parameter to group by. Can be 'vessel_id', 'flag', 'gearType', 'flagAndGearType'

filter_by

parameter to filter by.

date_range

Start and end of date range for raster (must be one year or less)

region

geojson shape to filter raster or GFW region code (such as an EEZ code). See details about geojson formatting.

region_source

source of the region ('eez','mpa', 'rfmo' or 'user_json')

key

Authorization token. Can be obtained with gfw_auth function

Details

The user-defined geojson has to be surrounded by a geojson tag, that can be created using a simple paste:

geojson_tagged <- paste0('{"geojson":', your_geojson,'}').

If you have an sf shapefile, you can also use function sf_to_geojson() to obtain the correctly-formatted geojson.