【问题标题】:Add National Hydrography Dataset basemap to leaflet map将国家水文数据集底图添加到传单地图
【发布时间】:2019-05-15 20:14:24
【问题描述】:

我想将 NHD(国家水文数据集)底图(平铺)添加到我的传单地图中。 Here 是提供我尝试使用的 Hydrography url 的链接。

leaflet()%>%
  setView(lng = -76.4, lat = 37, zoom = 09) %>% 
  addWMSTiles(baseUrl="https://basemap.nationalmap.gov/arcgis/rest/services/USGSHydroCached/MapServer",
              layers="Hydrography")

当前返回的底图是完全空白的。我希望它看起来像 this 从其他来源添加 WMS 磁贴似乎可以正常工作。

【问题讨论】:

    标签: r leaflet gis


    【解决方案1】:

    选项 #1 遵循 USGS 的 this 教程。

    grp <- c("USGS Topo", "USGS Imagery Only", "USGS Imagery Topo","USGS Shaded Relief", "Hydrography")

    GetURL <- function(service, host = "basemap.nationalmap.gov") {
    sprintf("https://%s/arcgis/services/%s/MapServer/WmsServer", host, 
    service)}`
    
    opt <- leaflet::WMSTileOptions(format = "image/png", transparent = TRUE)
    
    map <- leaflet::leaflet()
    map <- leaflet::addWMSTiles(map, GetURL("USGSHydroCached"),
       group = grp[5], options = opt, layers = "0")
    
    map <- leaflet::hideGroup(map, grp[5])`
    

    选项#2 使用inlmisc 包,CreateWebMap 函数默认添加水文基础层

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-08-22
      • 2018-07-03
      • 1970-01-01
      相关资源
      最近更新 更多