Closed tom-lvn closed 3 weeks ago
Hi @tom-lvn thanks for flagging this. Could you send the shapefile you're using here or to research [at] globalfishingwatch.org? I'll take a look or ping our API team. Thanks!
Hey, I just sent an email with the shapefile, as I could not upload it here. Thanks already for your help!
Hi @tom-lvn , thanks for the patience while I came back to you.
We do have a limitation with the shapefiles, but more than size it's their complexity when we do a request. There are two main workarounds if you encounter this:
If you don't care too much about the fine scale shapes of the shapefile, you can dissolve and simplify your shapefile, and redo the request.
If the original shapefile is very important, you can send a bounding box of the shapefile. The API will return the dataset seamlessly, even if it's a larger area. Then you can crop the result locally to your desired shapefile. To get the bounding box:
bbox <- st_bbox(shapefile) |>
sf::st_as_sfc() |>
sf::st_as_sf()
And send bbox
in the USER_SHAPEFILE
parameter.
A third option does not work in this case, you could loop over the polygons and do several requests, if the features were not complex themselves which is not the case here. In this case, the shapefile has 10 polygons and not all of them can fetch the information.
A third option would be to loop over the polygons. I received previously a 524 error for polygon 2 of the shapefile but redid the request and it worked. I will ask our API team about this, sometimes redoing the request just works.
Hey
gfwr
team,I am trying to use the
get_raster()
function with a customsf
shapefile but I receive the following error:When running
get_last_report()
this is the output:I am using a shapefile of the Mediterranean IHO Sea Area from here https://www.marineregions.org/gazetteer.php?p=details&id=1905. Reading it in with
sf::read_sf()
. Now, when I use the GFCM RFMO, this does not produce any errors and I can use that area despite its size. Is this just a limitation in using a custom sf object or is there a way around this?