为了账号安全,请及时绑定邮箱和手机立即绑定

从 0.5.1 升级到 0.8.2 后,graph_from_polygon

从 0.5.1 升级到 0.8.2 后,graph_from_polygon

杨魅力 2021-09-11 10:49:45
去年在 osmnx 上完成我的论文工作后,我有一段时间退回到 Python PTSD 中。但随着 2017 年 ACS 5 年估计的发布,我有一些新的数据分析要做。所以我将我的 osmnx 更新到 0.8.2,做了 conda update --all -c conda-forge,并启动了我的旧笔记本。它主要有效,但我在 graph_from_polygon 函数中遇到错误。TypeError                                 Traceback (most recent call last)<ipython-input-60-96e1e789c1a5> in <module>()---> 58     network, network_stats, tract_polygon = load_network(optimal_tracts, utm_crs)     59 <ipython-input-56-3036c449a01f> in load_network(opt_tracts, my_crs)     34 ---> 35     net = ox.core.graph_from_polygon(projected_circle,network_type='bike')     36 /Users/tom/anaconda/lib/python2.7/site-packages/osmnx/core.pyc in graph_from_polygon(polygon, network_type, simplify, retain_all, truncate_by_edge, name, timeout, memory, max_query_area_size, clean_periphery, infrastructure, custom_filter)   1741    max_query_area_size=max_query_area_size,   1742    infrastructure=infrastructure, custom_filter=custom_filter)-> 1743         G_buffered = create_graph(response_jsons, name=name, retain_all=True, network_type=network_type)   1744         G_buffered = truncate_graph_polygon(G_buffered, polygon_buffered, retain_all=True, truncate_by_edge=truncate_by_edge)   1745 /Users/tom/anaconda/lib/python2.7/site-packages/osmnx/core.pyc in create_graph(response_jsons, name, retain_all, network_type)   1358     # add length (great circle distance between nodes) attribute to each edge to   1359     # use as weight-> 1360     if len(G.edges) > 0:   1361         G = add_edge_lengths(G)   1362 TypeError: object of type 'instancemethod' has no len()到目前为止,这些包仍然可以很好地协同工作。projected_circle似乎正确创建为 UTM 经纬度多边形(epsg:32617,测试城市夏洛特,北卡罗来纳州)。这是相关的代码。(opt_tracts是一组人口普查区域的 GeoDataFrame)。
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 301 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信