【发布时间】:2022-10-14 04:02:13
【问题描述】:
我想在R中的shapefile上覆盖excel中的lat-long对应的wmo点。我遇到了其他人的问题,但我仍然无法做到。我已经尝试过这段代码,但没有工作。请帮忙。
shapestate <- read_sf(file.path(dir_ls$input_dir, 'shapefile'), 'State_sim')
plot(st_geometry(shapestate), col="darkblue", main="Tahoe HUC8", axes=TRUE)
wmo<-read.xlsx(file.path(dir_ls$input_dir, 'cyclone', 'checking wind speed.xlsx'))
coordinates(wmo) <- ~ LAT + LON
IND<-spTransform(shapestate, CRS("+proj=longlat +ellps=WGS84 +datum=WGS84"))
points(wmo$LAT ~ wmo$LON, col = "red", cex = 1, pch = 19)
在这个给定的链接中共享了 excel 中对应的 lat-long 的 shapefile 和值。 shapefile and wmo values in excel
【问题讨论】:
标签: r geospatial