Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个SpatialLines代表道路的SpatialPolygons对象和一个包含城市的对象。
SpatialLines
SpatialPolygons
我想知道如何 用 R 中SpatialLines的对象覆盖对象。SpatialPolygons
我想知道经过这两个城市的线路以及在哪些城市?
是否可以?
您需要包含几何操作的 GEOS 库的 rgeos 包。
然后可能 gIntersection 或 gIntersects 会做你想要的。
通常,空间对象的叠加由包中的over函数处理sp。在over( ?over) 文档的“方法”部分中,有一个 的方法列表over,其中不包括 和 的Lines组合Polygons。幸运的是,文档over说通过安装rgeos软件包可以使用这些方法。
over
sp
?over
Lines
Polygons
rgeos