executing command gUnionCascaded(sPDF) gives error on unix machine with a diff version of rgeos package Error in TopologyFunc(groupID(spgeom[ids[[i]]], id[ids[[i]]]), names(ids)[i], : IllegalArgumentException: Points of LinearRing do not form a closed linestring.#sample code:library(rgeos)library(rworldmap)sPDF <- getMap()poly_globe <- gUnionCascaded(sPDF)plot(poly_globe)推荐答案最终,这看起来像是 rworldmap 提供的数据集存在问题.这些问题似乎可以通过快速应用 cleangeo 包中的 clgeo_Clean() 解决.Ultimately, it looks like this traces to problems with the dataset provided by rworldmap. The problems seem to be cured by a quick application of clgeo_Clean() from the cleangeo package.试试这个看看是不是这样:Try this to see that that's the case:library(rgeos)library(rworldmap)library(cleangeo)sPDF <- getMap()sPDF <- clgeo_Clean(sPDF)poly_globe <- gUnionCascaded(sPDF)plot(poly_globe) 这篇关于使用 rgeos 库合并国家多边形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-12 19:41