matsalu_wms.R 2.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. library(leaflet)
  2. year <- format(Sys.Date(), "%Y")
  3. leaflet() %>% addTiles() %>% setView(-93.65, 42.0285, zoom = 7) %>%addWMSTiles(
  4. "http://basemap.nationalmap.gov/arcgis/services/USGSHydroNHD/MapServer/WMSServer?",
  5. layers = "0",
  6. options = WMSTileOptions(format = "image/png", transparent = TRUE),
  7. attribution = "")
  8. i <- 9
  9. # Ajaloliste kaartide kihid
  10. layers <- c(
  11. "yheverstakaart_alt", "kaheverstakaart_alt", "kolmeverstakaart_alt",
  12. "HYBRID", "Halduspiir_raster", "vanaBaaskaart", "ekj_50T", "kk1940", "lehman",
  13. "ew_25T", "ew_50T", "ew_200T", "pk_trykk", "heereskarte"
  14. )
  15. url <- paste0("https://xgis.maaamet.ee/xgis2/service/c9me/ajal?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&LAYERS=", layers[i], "&SRS=EPSG%3A3301&STYLES=&WIDTH=1236&HEIGHT=687&BBOX=450632.44047619053%2C6404438.244047619%2C459828.86904761905%2C6409549.851190476")
  16. cat(url)
  17. wms_map_url <- "https://kaart.maaamet.ee/wms/ajalooline?version=1.3.0"
  18. wms_map_url <- "http://basemap.nationalmap.gov/arcgis/services/USGSHydroNHD/MapServer/WMSServer?"
  19. x <- 23.4784
  20. y <- 58.7864
  21. ## WMS: transpordivõrgud
  22. wms_map_url <- "https://inspire.maaamet.ee/arcgis/rest/services/public/tn_com/MapServer/exts/InspireView/service"
  23. leaflet() %>% addTiles() %>% setView(x, y, zoom = 14) %>% addWMSTiles(
  24. wms_map_url,
  25. layers = c("1","2"),
  26. options = WMSTileOptions(format = "image/png", transparent = TRUE),
  27. attribution = "Maa-amet")
  28. ## WMS: Ortofoto
  29. wms_map_url <- "https://inspire.maaamet.ee/arcgis/rest/services/public/orthophoto/MapServer/exts/InspireView/service"
  30. leaflet() %>% addTiles() %>% setView(x, y, zoom = 15) %>%addWMSTiles(
  31. wms_map_url,
  32. layers = "0",
  33. options = WMSTileOptions(format = "image/png", transparent = TRUE),
  34. attribution = paste0("Aluskaart: Maa-amet ", year, " "))
  35. #' Ortofotode allalaadimine: https://geoportaal.maaamet.ee/est/Ruumiandmed/Ortofotod/Laadi-ortofotod-alla-p610.html
  36. #' Ruudustik 1:10000, näiteks 'matsalu ruut' on 62173.
  37. #'
  38. ## WMS: Ortofotod
  39. k <- 0
  40. wms_map_url <- "https://inspire.maaamet.ee/arcgis/rest/services/public/orthophoto/MapServer/exts/InspireView/service"
  41. leaflet() %>% addTiles() %>% setView(x, y, zoom = 15) %>%addWMSTiles(
  42. wms_map_url,
  43. layers = k,
  44. options = WMSTileOptions(format = "image/png", transparent = TRUE),
  45. attribution = "Maa-amet")
  46. k <- k + 1
  47. # Tuumaelektrijaamad
  48. leaflet() %>% addTiles() %>% setView(x, y, zoom = 4) %>% addWMSTiles(
  49. "http://sedac.ciesin.columbia.edu/geoserver/wms",
  50. layers = "energy:energy-pop-exposure-nuclear-plants-locations_plants",
  51. options = WMSTileOptions(format = "image/png", transparent = TRUE),
  52. tileOptions(tms = TRUE),
  53. attribution = "")