英文:
OSMNX geometries_from_bbox tag for a single way
问题
我有一个函数,它可以提取具有标签'building': True
的几何体,这个函数运行良好,但是这个'way': 12345
似乎不起作用。如何通过geometries_from_bbox按id提取单个way?
英文:
Probably simpler than I think: I have a function that pulls geometries_from_bbox with tags like
'building':True
That works fine, but this
'way':12345
doesn't seem to work. How can I pull a single way by id via geometries_from_bbox?
答案1
得分: 1
OSMnx的geometries
模块仅按标签/值查询:文档。
相反,使用OSMnx的geocode
模块按地名或OSM ID检索对象:
import osmnx as ox
ox.geocode_to_gdf(query="W398261765", by_osmid=True)
英文:
OSMnx's geometries
module only queries by tag/value: docs.
Instead, use OSMnx's geocode
module to retrieve an object by place name or by OSM ID:
import osmnx as ox
ox.geocode_to_gdf(query="W398261765", by_osmid=True)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论