Skip to content

Commit

Permalink
0.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Rimagination committed Nov 14, 2024
1 parent 587d968 commit 4eb10d9
Showing 1 changed file with 34 additions and 34 deletions.
68 changes: 34 additions & 34 deletions .Rhistory
Original file line number Diff line number Diff line change
@@ -1,37 +1,3 @@
library(sf)
library(dplyr)
# 合并 sf 对象
merged1 <- bind_rows(main, coast,ten_line,undefined)
# 删除多余属性
merged1 <- merged1 %>% select(-gb,-FID_中国, -Shape_Leng)
# 保存为 GeoJSON 文件
st_write(merged1, "D:/权威地图/天地图准确拆分/buffer_line.geojson", driver = "GeoJSON")
#生成缓冲线
# 合并 sf 对象
merged2 <- bind_rows(main, ten_line)
# 删除多余属性
merged2 <- merged2 %>% select(-gb,-FID_中国, -Shape_Leng)
# 保存为 GeoJSON 文件
st_write(merged2, "D:/权威地图/天地图准确拆分/buffer_line.geojson", driver = "GeoJSON")
#载入查看
buffer <- st_read("D:/权威地图/天地图准确拆分/buffer_line.geojson")
plot(buffer)
# Create buffers for mainland border and ten-dash line
mainland_buffer <- st_buffer(data[data$name == "mainland_line", ], dist = 20000, singleSide = TRUE)
dashline_buffer <- st_buffer(data[data$name == "10_dashline", ], dist = 20000, singleSide = TRUE)
# Combine buffers
buffer_data <- rbind(mainland_buffer, dashline_buffer)
ggplot()+
geom_sf(data = buffer_data)+
geom_boundary_cn()
ggplot()+
geom_boundary_cn()
ggplot()+
geom_boundary_cn()
sar <- st_read("D:/权威地图/天地图准确拆分/sar.shp")
ten_line <- st_read("D:/权威地图/天地图准确拆分/纯十段线.shp")
main<- st_read("D:/权威地图/天地图准确拆分/大陆已定.shp")
coast<- st_read("D:/权威地图/天地图准确拆分/海岸线.shp")
undefined<- st_read("D:/权威地图/天地图准确拆分/未定国界.shp")
# 修改 name 属性
sar$name <- "SAR_boundary"
Expand Down Expand Up @@ -510,3 +476,37 @@ use_pkgdowns()
use_pkgdown()
?use_pkgdown()
use_github_pages()
usethis::use_pkgdown()
pkgdown::build_site()
pkgdown::clean_site()
pkgdown::build_site()
pkgdown::build_site()
pkgdown::build_site()
pkgdown::build_site()
pkgdown::build_site()
usethis::use_pkgdown()
pkgdown::build_site()
library(marmap)
install.packages("marmap")
library(marmap)
depth_data <- getNOAA.bathy(lon1 = 100, lon2 = 130, lat1 = 20, lat2 = 50, resolution = 1)
library(ggplot2)
ggplot() +
geom_raster(data = depth_df, aes(x = lon, y = lat, fill = z)) +
geom_mapcn() +
scale_fill_viridis_c(option = "C", name = "Sea Depth (m)") +
theme_minimal() +
labs(title = "China Map with Sea Depth")
depth_df <- fortify.bathy(depth_data)
library(ggplot2)
ggplot() +
geom_raster(data = depth_df, aes(x = lon, y = lat, fill = z)) +
geom_mapcn() +
scale_fill_viridis_c(option = "C", name = "Sea Depth (m)") +
theme_minimal() +
labs(title = "China Map with Sea Depth")
usethis::use_pkgdown()
pkgdown::build_site()
rlang::last_trace()
pkgdown::build_site()
pkgdown::build_site()

0 comments on commit 4eb10d9

Please sign in to comment.