标签: r coordinates gis geocoding spatial
如何计算通过多边形的线数,给出以下内容。
Here is a sample picture
答案 0 :(得分:0)
假设spdf是SpatialPolygonDataFrame类的对象,sl是SpatialLines类的对象
尝试
libray(rgeos) overlap <- over(sl, spdf) sum(!is.na(overlap))
或直接
libray(rgeos) overlap <- length(sl[spdf,])