Questions tagged «self-intersection»

1
获取TopologyException:输入几何1无效,这是由于R中的自相交导致的?
由无效的多边形几何形状引起的“ TopologyException:输入几何1无效”自相交错误已得到广泛讨论。但是,我没有在网络上找到仅依赖于R功能的便捷解决方案。 例如,我已经设法从map("state", ...)遵循Josh O'Brien 在这里的好答案的输出中创建一个“ SpatialPolygons”对象。 library(maps) library(maptools) map_states = map("state", fill = TRUE, plot = FALSE) IDs = sapply(strsplit(map_states$names, ":"), "[[", 1) spydf_states = map2SpatialPolygons(map_states, IDs = IDs, proj4string = CRS("+init=epsg:4326")) plot(spydf_states) 现在,这种广泛应用的数据集的问题在于自相交发生在以下给定的点。 rgeos::gIsValid(spydf_states) [1] FALSE Warning message: In RGEOSUnaryPredFunc(spgeom, byid, "rgeos_isvalid") : Self-intersection at or near point …
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.