def load_graph(json_dict):
g = nx.MultiDiGraph()
for item in json_dict['features']:
coord = item['geometry']['coordinates']
coord_u = get_node(coord[0])
coord_v = get_node(coord[-1])
g.add_edge(coord_u, coord_v, id=item['properties']['id'])
return g
export_nodes_and_id_maker.py 文件源码
python
阅读 24
收藏 0
点赞 0
评论 0
评论列表
文章目录