GlobalFishingWatch / gfwr

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

Allow get_regions to use MPA ids #48

Closed natemiller closed 2 years ago

natemiller commented 2 years ago

This PR allows get_raster function to use MPA regions. From issue #47 and #37 It also generalizes what was previously call the get_eez_code function so that it works for MPAs as well. This function is now renamed get_region_id which seems better.

In a number of places shape has been replaced by region and we now specify a region_source in the get_raster and get_region_id functions, which makes it easier to point at the correct endpoint depending on if the region is being specified as a eez id, a mpa id, or a user defined geojson.

Finally, the README was updated for these changes to get_raster and to show how to access MPA ids in addition to EEZ ids.