简体   繁体   English

我在使用 OSMNX 时遇到错误:使用 ox.graph_from_place 时出现操作系统错误

[英]I have an error using OSMNX: OS error when using ox.graph_from_place

I recently reinstalled OSMNX using pip and now I get a strange OS error I honestly have never seen before and google did not help me as well...我最近使用 pip 重新安装了 OSMNX,现在我收到一个奇怪的操作系统错误,老实说,我以前从未见过,谷歌也没有帮助我......

Here is a code excerpt with the error.这是带有错误的代码摘录。 I tried to restart the environment and also tried another VE to run it but the same error appears.我尝试重新启动环境,也尝试了另一个 VE 来运行它,但出现了同样的错误。 It does actually not seem to be some native bug of OSMNX and seems to go to geopandas or shapely.它实际上似乎不是 OSMNX 的一些本地错误,并且对于 geopandas 或 shapely 来说似乎是 go。

And no, I have never encountered anything similar and I am using anaconda, being the superuser (win10) of this machine with all rights.不,我从来没有遇到过类似的事情,我使用的是 anaconda,是这台机器的超级用户 (win10),拥有所有权利。

OSError                                   Traceback (most recent call last)
~\AppData\Local\Temp\ipykernel_18096\802543517.py in <module>
      6 
      7 # download the street network
----> 8 G = ox.graph_from_place('Berlin', network_type = 'drive', simplify=False)

~\anaconda3\lib\site-packages\osmnx\graph.py in graph_from_place(query, network_type, simplify, retain_all, truncate_by_edge, which_result, buffer_dist, clean_periphery, custom_filter)
    345 
    346     # extract the geometry from the GeoDataFrame to use in API query
--> 347     polygon = gdf_place["geometry"].unary_union
    348     utils.log("Constructed place geometry polygon(s) to query API")
    349 

~\anaconda3\lib\site-packages\geopandas\base.py in unary_union(self)
    726         POLYGON ((0 1, 0 2, 2 2, 2 0, 1 0, 0 0, 0 1))
    727         
--> 728         return self.geometry.values.unary_union()
    729 
    730     #

~\anaconda3\lib\site-packages\geopandas\array.py in unary_union(self)
    636 
    637     def unary_union(self):
--> 638         return vectorized.unary_union(self.data)
    639 
    640     #

~\anaconda3\lib\site-packages\geopandas\_vectorized.py in unary_union(data)
    909         data = [g for g in data if g is not None]
    910         if data:
--> 911             return shapely.ops.unary_union(data)
    912         else:
    913             return None

~\anaconda3\lib\site-packages\shapely\ops.py in unary_union(self, geoms)
    159             subs[i] = g._geom
    160         collection = lgeos.GEOSGeom_createCollection(6, subs, L)
--> 161         return geom_factory(lgeos.methods['unary_union'](collection))
    162 
    163 operator = CollectionOperator()

OSError: exception: access violation writing 0x0000000000001101

I recently reinstalled OSMNX using pip我最近使用 pip 重新安装了 OSMNX

You did not follow the OSMnx installation instructions so this error is to be expected.您没有按照 OSMnx 安装说明进行操作,因此会出现此错误。 Follow the documented instructions and it will resolve.按照记录的说明进行操作,它将解决。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM