手动用Bbox画范围框,显示Bbox范围
# Tue Nov 03 00:06:30 2020 -
# 字符编码:UTF-8
# R 版本:R x64 4.0.3 for window 10
# cgh163email@163.com
# 个人笔记不负责任
# —— 拎了个梨🍐
.rs.restartR()
# addExtent,向单张地图添加空间对象的范围/bbox
require(leafem)
rm(list=ls());gc()
# addExtent向单张地图添加空间对象的范围/bbox
# 此函数用于将空间对象的边界框添加到单张或mapview地图中。
library(leaflet)
raster::plot(gadmCHE)
sf::st_bbox(gadmCHE)
leaflet() %>%
addProviderTiles("OpenStreetMap") %>%
addExtent(gadmCHE)
leaflet(gadmCHE) %>%
addProviderTiles("OpenStreetMap") %>%
addExtent()
# Tue Nov 03 00:24:27 2020 ----diy--------------------------
map.gz <- sf::st_read('https://geo.datav.aliyun.com/areas/bound/geojson?code=440100_full')
leaflet() %>% amap() %>%
addExtent(map.gz)
# Tue Nov 03 00:19:54 2020 --
require(sf)
mybbox <- st_bbox(c(xmin = 16.1, xmax = 16.6, ymax = 48.6, ymin = 47.9), crs = st_crs(4326))
leaflet() %>%
addProviderTiles("OpenStreetMap") %>%
addExtent(mybbox)