Test with WCS from FAO ASIS not working
understorey opened this issue · 2 comments
I have tried to replicate the test proposed in the package, but I am getting the following errors:
[ows4R][ERROR] WCSGetCoverage - Error while executing request 'GetCoverage'
Error: [rast] cannot open file: C:/.../test_asis.tif
In addition: Warning message:
`C:/.../test_asis.tif' not recognized as a supported file format. (GDAL error 4)
Codes used on
R version 4.1.2 (2021-11-01)
and
RStudio 2021.09.0+351 "Ghost Orchid" Release (077589bcad3467ae79f318afe8641a1899a51606, 2021-09-20) for Windows Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) QtWebEngine/5.12.8 Chrome/69.0.3497.128 Safari/537.36
were:
rm(list=ls())
setwd(dirname(rstudioapi::getActiveDocumentContext()$ path))
gc() # garbage clean
library(ows4R)
wcs <- WCSClient$new(url = "https://io.apps.fao.org/geoserver/wcs/ASIS/HDF/v2", serviceVersion = "2.0.1", logger = "DEBUG")
covnames <- sapply(wcs$capabilities$getCoverageSummaries(), function(x){x$getId()})
cov <- wcs$capabilities$findCoverageSummaryById("ASIS__hdf", exact = TRUE)
cov_data <- cov$getCoverage(bbox = OWSUtils$toBBOX(-90.3159,12.8091,-87.4539,14.6022), filename = "test_asis.tif")
May I kindly ask you to test the query for a specific year (2010, for example) of annual summary product (ASI_A) which is the data which I need to retrieve?
Thank you very much!
I've tried the request, and I get a Bad gateway error from server, so ows4R doesn't complete the request. WCS is still in dev, and I need to handle properly these kind of server errors.
Regarding your request, you can ask directly at fao-data@fao.org
What i can see is that the coverage you try to request is not a temporal coverage, but just a 2D grid.
I've tested it again, and it worked, but I've noticed that this server fails randomly for the same request.