需要帮助重新解决R中的转换问题.
我已经计算了一团云的凸包.我想从构成凸包的点开始构建一个多边形对象,并将其保存为可由GIS软件(ArcMap等)读取的shapefile.
我的代码看起来像这样:
gps <- read.csv(f) ##reads the lat-long coordinates file
x <- gps$LONGITUDE ##tells R which columns is which
y <- gps$LATITUDE
z<-chull(x,y) ##calculates the convex hull --this is just a list of x-y points, N vertex
dfHull <-cbind(x[z],y[z]) ##the convex hull expressed as a list of selected x-y points
plot(dfHull) ##this plots the vertex of the polygon, just a check
lines(dfhull) ##plots the polygon in screen
##generate polygon shapefile, from dfHull, and …Run Code Online (Sandbox Code Playgroud) 我正在尝试从 WMS 层提取数据。
举个例子,我想分析一下我的区域是否触及了Natura2000区域,以及Natura2000区域的具体情况是什么。
Natura2000 区域的 WMS 层可以在以下位置找到: https: //geodata.nationaalgeoregister.nl/natura2000/ows?service=WMS &request=GetLegendGraphic&format=image/png&width=20&height=20 &layer=natura2000 "
假设我的区域是一个围绕某个 x 和 y 坐标、半径为 7500 米的圆;
我试图用传单包来完成此任务,但它似乎更像是一个显示信息的工具,而不是分析信息的工具。
x.WGS=6.662226
y.WGS=52.53206
leaflet() %>% setView(x.WGS, y.WGS, zoom = 11) %>%
addTiles() %>%
addMarkers(lng = x.WGS, lat = y.WGS)%>%
addWMSTiles(
"https://geodata.nationaalgeoregister.nl/natura2000/ows?service=WMS&request=GetLegendGraphic&format=image/png&width=20&height=20&layer=natura2000",
layers = "natura2000",
options = WMSTileOptions(format = "image/png", transparent = TRUE),
attribution = "") %>%
addCircles(lng = x.WGS, lat = y.WGS, weight = 1,
radius = 7500)
Run Code Online (Sandbox Code Playgroud)
我希望它返回两件事。我的区域是否触及了任何 Natura2000 区域?换句话说,它们的名称是什么。如果我在 Qgis 中加载 WMS 层,则 Natura2000 区域的名称应位于naam_n2k下。
在我的示例中,答案应该是我的区域涉及两个 …