How to download raster data from WCS #104
-
Hi! This is a great package initiative, but I honestly don't get how to access and download raster data via a WCS server. I am trying so with the following https://wcs-mds.idee.es/mds?version=2.0.1&request=GetCapabilities&service=WCS in order to download mdsn_e025 data with a bbox for a small area. Could you give me any idea of how to proceed? It's not very clear to me. I understand to start in the following way:
Thank you! Best, |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
I've tried the following code (see additional notes in the comments...). At first, you should use the Regarding the data access, this server seems to be limited to very small data coverages. require(ows4R)
#get WCS client connection (be careful, it's WCS, not CSW)
#WCS = Web Coverage Service (for raster data access)
#CSW = Catalogue Service for the Web (for geographic metadata cataloguing)
WCS = WCSClient$new(
url = "https://wcs-mds.idee.es/mds",
serviceVersion = "2.0.1",
logger = "INFO"
)
#find the coverage
cov = WCS$capabilities$findCoverageSummaryById("mdsn_e025")
#get data dimensions (here's a spatial 2D coverage)
cov$getDimensions()
#get data
covdata = cov$getCoverage()
#this doesn't work
#If you look at output of request on the web, you will see this error:
#"Raster size out of range, width and height of resulting coverage must be no more than MAXSIZE=4096"
#(This seems to authorize very small data coverages...)
#trying with one bounding box
covdata = cov$getCoverage( bbox = OWSUtils$toBBOX(xmin = -100,xmax = 1000,ymin = 3500000,ymax = 3500200))
The request works, but so far I see the cov data is empty (all values equal to zero). This might be due to the extent i've chosen, not sure. If you know some bounding boxes you want to apply, can you try it? |
Beta Was this translation helpful? Give feedback.
-
Thank you very much, Emmanuel! It's working fine. The data are 2.5m x 2.5m of building heights in Spain, this is why you need a very small area. ` bbx <- esp_get_munic(munic = "Coruña, A") |> st_transform(25830) |> st_bbox() #trying with one bounding box |
Beta Was this translation helpful? Give feedback.
-
Hi!, have a similar problem here, I have tried the code above and works perfectly, but when trying to get VOM data from an UK WCS service I am getting the following error:
What I am doing wrong??, tested to load the WCS layer on QGIS and it loads just right |
Beta Was this translation helpful? Give feedback.
I've tried the following code (see additional notes in the comments...).
At first, you should use the
WCSClient
to interrogate Web Coverage Service, not theCSWClient
which is for geographic metadata cataloguing.Regarding the data access, this server seems to be limited to very small data coverages.