使用 Python 通过 igraph 分析 shapefile

Using Python for analyzing shapefiles with igraph

在分析 .shp 文件中的数据时,我有一些使用 networkX 的经验。我希望在执行最短路径分析时优化速度并遇到 igraph。 Networkx has/had read_shp("somefile.shp") 函数用于传入.shp 文件。 igraph 中是否有用于读取 .shp 文件和创建图形的模拟?

不,没有(从0.9.8版本开始),但是你可以将networkx图转换成igraph格式,然后在上面使用igraph的快速分析方法。

https://igraph.org/python/api/latest/igraph.Graph.html#from_networkx