从点创建凸包多边形并保存为shapefile

 笑看斜阳 发布于 2022-12-23 22:15

需要帮助重新解决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 save it externally as a shapefile ???

源文件仅包含lat-long坐标,例如:

52.73336     N  0.365974
52.7332  N  0.366051
52.73289     N  0.36636
52.73297     N  0.366258
52.73298     N  0.366243
52.733   N  0.366112
52.73308     N  0.365942
52.73317     N  0.365881
52.73321     N  0.36593
52.73328     N  0.365942
52.73352     N  0.36579
52.73362     N  0.365678
52.73391     N  0.365536
52.7373  N  0.36543
52.73289     N  0.36728

我知道有一些软件包(rgdal,maptools,..)来帮助解决这些问题,但我对空间的东西非常不熟悉.我真正需要的是生成多边形对象并将其保存为shapefile.

任何帮助赞赏.在此先感谢,开发.

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有