我有一个错误使用OSMNX: OS错误时使用ox.graph_from_place



我最近用pip重新安装了OSMNX,现在我得到了一个奇怪的操作系统错误,我以前从来没有见过,谷歌也没有帮助我…

下面是错误代码的摘录。我尝试重新启动环境,并尝试另一个VE运行它,但出现同样的错误。它实际上似乎不是OSMNX的一些本地错误,似乎是地质或形状。

没有,我从来没有遇到过类似的事情,我使用的是anaconda,作为这台机器的超级用户(win10)拥有所有权限。

OSError                                   Traceback (most recent call last)
~AppDataLocalTempipykernel_18096802543517.py in <module>
6 
7 # download the street network
----> 8 G = ox.graph_from_place('Berlin', network_type = 'drive', simplify=False)
~anaconda3libsite-packagesosmnxgraph.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 
~anaconda3libsite-packagesgeopandasbase.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     #
~anaconda3libsite-packagesgeopandasarray.py in unary_union(self)
636 
637     def unary_union(self):
--> 638         return vectorized.unary_union(self.data)
639 
640     #
~anaconda3libsite-packagesgeopandas_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
~anaconda3libsite-packagesshapelyops.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

我最近使用pip重新安装了OSMNX

您没有遵循OSMnx安装说明,因此出现此错误是预料之中的。遵循文档说明,它将解决。

相关内容