空间网络工具包
snkit的Python项目详细描述
snkit-空间网络工具包
/sn_k_t/–听起来像snicket(名词, (北英语)房屋之间的狭窄通道;小巷。
为什么使用snkit?
snkit
帮助整理空间网络数据。
假设有一些边和节点(线和点、连接和顶点)。他们都没有 是完全连接的,并且没有明确的数据来定义哪个节点位于哪个节点的末尾 边,或连接哪些边。
例如:
snkit
有方法:
- 向每条边添加端点
- 将节点连接到最近的边
- 在连接点处拆分边
- 创建节点和边id,并将from_id和to_id添加到每个边
空间网络
snkit数据清理过程的输出可能如下所示:
节点
geometry | id | other attributes... |
---|---|---|
^{ | node_0 | ... |
^{ | node_1 | ... |
^{ | node_2 | ... |
边
geometry | id | from_id | to_id | other attributes... |
---|---|---|---|---|
^{ | edge_0 | node_10 | node_22 | ... |
^{ | edge_1 | node_22 | node_21 | ... |
^{ | edge_2 | node_21 | node_25 | ... |
开始
安装系统库(仅在ubuntu上测试):
sudo apt-get install -y libspatialindex-dev libgeos-dev gdal-bin
或者使用conda安装主要依赖项:
conda install pandas geopandas shapely rtree fiona
使用pip:
安装或升级snkit
pip install --upgrade snkit
请参阅demo notebook以获取 小规模示威。
推荐信
With five lines of snkit I replaced four or five hundred lines of custom code!
a.满足的客户(@czor847)
相关项目
致谢
MIT License
Copyright (c) 2018 Tom Russell and snkit contributors
最初的snkit开发是在epsrc赞助的mistral项目的{a10}中进行的,作为 Infrastructure Transition Research Consortium。