我收到此SSLError:HTTPSConnectionPool(host ='nominatim.openstreetmap.org',端口= 443):URL超过了最大重试次数:/ search?format = json&limit = 1&dedupe = 0&polygon_geojson = 1&q = Houston%2C + Texas %2C + USA(由SSLError(SSLError(“不好的握手:错误([('SSL例程','tls_process_server_certificate','证书验证失败')]))))))
我正在尝试使用以下代码行来获取德克萨斯州休斯顿地区的街道网络,但仍然收到上述错误。
location_point =(29.6849782,-95.3991907)
G = ox.graph_from_point(location_point,distance = 737884.22,distance_type ='bbox',network_type ='drive') G = ox.project_graph(G) 无花果,ax = ox.plot_graph(G,node_size = 0,node_color ='#66CCFF',fig_height = 10,fig_width = 12,margin = 0.03,dpi = 150,save = True,file_format ='png',show = True ,filename ='Harvey_map')
我尝试如下替换OSMnx中原始“ core.py”文件中的“请求”: 响应= request.get(URL,params = params,timeout = timeout,headers = get_http_headers())---->原始请求类型。替换为以下内容:
响应= request.get(URL,params = params,timeout = timeout,headers = get_http_headers(),verify = False)
但是,此解决方案无法解决问题。
location_point =(29.6849782,-95.3991907)
G = ox.graph_from_point(location_point,distance = 737884.22,distance_type ='bbox',network_type ='drive') G = ox.project_graph(G) 无花果,ax = ox.plot_graph(G,node_size = 0,node_color ='#66CCFF',fig_height = 10,fig_width = 12,margin = 0.03,dpi = 150,save = True,file_format ='png',show = True ,filename ='Harvey_map')
我希望将德克萨斯州休斯顿地区的街道网络地图作为OSMnx文档和示例。
答案 0 :(得分:0)
在解决了这个问题之后,我注意到减少“ ox”模块的“ ox.graph_from_point”方法的“ distance”自变量/或参数是可行的。换句话说,距“质心”或中心的半径不能太大。如有需要,请使用零食方法。