繁体   English   中英

基于 GDAL/OGR 的并行空间处理和使用 python 的空间过滤器?

[英]Parallel spatial processing based on GDAL/OGR with spatial filter using python?

我在 Python 中使用 GDAL/OGR 顺序应用空间滤波器以计算点密度:

point = ogr.Geometry(ogr.wkbPoint)
point.AddPoint(xCoord, yCoord)
searchArea = point.Buffer(searchBuffer)
layer.SetSpatialFilter(searchArea)
density[i, j] = layer.GetFeatureCount()

但现在我想并行化我的代码,以提高性能。

如何在 Python 中与 GDAL/OGR 并行处理空间数据? 特别是,我可以在数据源上并行应用空间过滤器吗?

我想使用concurrent.futures.ThreadPoolExecutor() as executor

GDAL 不支持对一个数据集进行并行操作。 要么你必须多次打开它,要么,如果你需要一个高性能的实现,你将不得不自己实现它。 SetSpatialFilter都不是最好的方法,因为它需要对每一对(i, j)的特征进行迭代。

加载 R-Tree 中的所有特征,然后循环(i, j) 这是在 Python 中具有现有实现的标准算法。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM