我是osm的新手。 目前,我正在尝试使用python中的osmnx包检索多个城市的建筑多边形
代码:
place = "Kuala Lumpur, Malaysia"
graph = ox.footprints.footprints_from_place(place, footprint_type='building')
graph.head()
它很好用
但是,如果我想获得另一个状态,它将返回一个错误
(如果我想在国家级检索它,也会得到相同的结果——在本例中为-place=“Malaysia”)
place = "Selangor, Malaysia"
graph = ox.footprints.footprints_from_place(place, footprint_type='building')
graph.head()
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-20-9e3439b6fc4c> in <module>()
1 place = "Selangor, Malaysia"
----> 2 graph = ox.footprints.footprints_from_place(place, footprint_type='building')
3
4 graph.head()
5 frames
/usr/local/lib/python3.6/dist-packages/shapely/geometry/multipolygon.py in geos_multipolygon_from_polygons(arg)
175 # no implicit flattening.
176 if isinstance(obs[0], MultiPolygon):
--> 177 raise ValueError("Sequences of multi-polygons are not valid arguments")
178
179 exemplar = obs[0]
ValueError: Sequences of multi-polygons are not valid arguments
有人能帮我吗? 谢谢
看起来OSMnx的
footprints
模块没有正确处理或忽略复杂(可能是无效的?)多边形几何体。请注意are underway将footprints
和pois
模块替换为更强大、更健壮、更通用的geometries
模块的努力。同时,我相信您可以通过以下pois
模块实现您的目标:相关问题 更多 >
编程相关推荐