【发布时间】:2019-10-10 04:40:33
【问题描述】:
我试图通过 QGIS 算法按位置提取来找出 shapefile 中的所有多边形,它给了我完美的结果,但需要太多时间,大约 25 小时。现在,如果可能的话,我希望它由其他库(如 geopandas 或其他库)来完成。谁能建议我哪个图书馆可以提供帮助?
这就是在 geopandas 中所做的:
import itertools
import geopandas as gpd
gi = gpd.GeoDataFrame.from_file("D:\Shape_file_uploader\qgis\laneGroup.shp")
geoms = gi['geometry'].tolist()
intersection_iter = gpd.GeoDataFrame(gpd.GeoSeries([poly[0].intersection(poly[1]) for poly in itertools.combinations(geoms, 2)
【问题讨论】:
-
geopandas 应该是您尝试的第一个电话
-
@BrunoVermeulen 请看上面的代码,我做对了吗?我已经添加了
-
我将提供一个关于如何解决的暂定答案
-
您能解释一下按位置提取的作用吗?
-
按位置提取给出了一个 shapefile,它是输入 shapefile 中多边形相交的结果。结果是准确的,但需要更长的时间。