GlobalFishingWatch / gfwr

R package for accessing data from Global Fishing Watch APIs
https://globalfishingwatch.github.io/gfwr/
Apache License 2.0
58 stars 7 forks source link

group_by in get_raster() #78

Closed shinnakayama closed 2 years ago

shinnakayama commented 2 years ago

Hello GFW,

In the example,

# use EEZ function to get EEZ code of Cote d'Ivoire
code_eez <- get_region_id(region_name = 'CIV', region_source = 'eez', key = key)

get_raster(spatial_resolution = 'low',
           temporal_resolution = 'yearly',
           group_by = 'flag',
           date_range = '2021-01-01,2021-10-01',
           region = code_eez$id,
           region_source = 'eez',
           key = key)

Removing group_by gives an error (I want all fishing hours). Also, group_by = 'geartype' gives an error.

natemiller commented 2 years ago

@shinnakayama Unfortunately as described in the API documentation the group_by field is currently required.

There is a typo in the gfwr documentation which we will fix. To group by geartype you must use the parameter gearType (note the camelcase).

natemiller commented 2 years ago

I have changed the documentation in the develop branch for get_raster to make it clear that gear type grouping must be specified as gearType. We expect this may be merged into a new release next week along with a number of other updates.