首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Geodataframe中所有线串(约100,000)的凸包

问Geodataframe中所有线串(约100,000)的凸包
EN

Stack Overflow用户
提问于 2021-03-10 18:28:33
回答 1查看 84关注 0票数 0

我有一个Geopandas数据框架,大约有100万行字符串,我想用Geopandas的相应工具(GeoSeries.convex_hull)来计算它们的凸包。这会导致非常长的计算时间(大约4小时)。有没有人知道如何更快地做到这一点?

Geodataframe如下所示:

代码语言:javascript
复制
   s_p_ed_hik  length lanes  i                                         geometry
0    2.658196   4.263  None  0  LINESTRING (8.52441 47.39506, 8.52443 47.39502)
1    2.658196   4.263  None  0  LINESTRING (8.52441 47.39506, 8.52443 47.39502)
2    2.874100   4.343  None  0  LINESTRING (8.52443 47.39502, 8.52449 47.39502)
...

以下是关于我的Geopandas Dataframe的Linestring长度的统计数据:

代码语言:javascript
复制
count    1063284.000000
mean         12.693328
std          13.335160
min           0.385000
25%           4.956000
50%           9.507000
75%          13.638000
max         287.713000
EN

回答 1

Stack Overflow用户

发布于 2021-03-11 02:07:59

确保您安装了pygeos - https://geopandas.readthedocs.io/en/latest/getting_started/install.html#using-the-optional-pygeos-dependency。这将为您提供矢量化操作和很大的加速比。

代码语言:javascript
复制
conda install -c conda-forge pygeos

您也可以尝试使用dask-geopandas来实现多核。

代码语言:javascript
复制
pip install git+https://github.com/geopandas/dask-geopandas.git

https://github.com/geopandas/dask-geopandas

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/66562851

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档