inbo / tutorials

A collection of technical tutorials for INBO (and anyone who's interested)
https://inbo.github.io/tutorials/
Creative Commons Attribution 4.0 International
22 stars 9 forks source link

WMS: download or screenshot? #317

Closed aloboa closed 2 years ago

aloboa commented 2 years ago

Regarding https://inbo.github.io/tutorials/tutorials/spatial_wms_services/

is it actually possible to save the raster layer? At least an screenshot of the display of

leaflet() %>% 
  setView(lng = 4.287638, lat = 50.703039, zoom = 15) %>% 
  addWMSTiles(
    wms_ortho,
    layers = "Ortho",
    options = WMSTileOptions(format = "image/png", transparent = TRUE)
hansvancalster commented 2 years ago

A WMS service is a service to quickly view/render raster data, but doesn't actually return the raster layer data. It just provides png images (prerendered tiles at various viewing scales). To have access to the raster layer data, a web coverage service is needed. In this particular case, such a service exists: https://inspire.informatievlaanderen.be/overdrachtdiensten/oi-omz/wcs

but that will not always be the case. I'm not sure if you are interested in this particular layer, or if your question is more general.

aloboa commented 2 years ago

It is a general question. Something equivalent to ggsave() would do it. In Catalonia, orthophotos of the current year can be downloaded from ICGC as GTiff, but for the previous years only WMS is available. Using you leaflet method + something like ggsave() would be better than nothing (or than manually saving screenshots).

hansvancalster commented 2 years ago

I see. In that case, have a look at https://r-spatial.github.io/mapview/reference/mapshot.html

florisvdh commented 2 years ago

I assume your question has been sufficiently answered @aloboa. If not you're welcome to reopen the issue.