OSMNX geometries_from_bbox 用于单个道路的标签。

huangapple go评论71阅读模式
英文:

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)

huangapple
  • 本文由 发表于 2023年6月15日 02:20:59
  • 转载请务必保留本文链接:https://go.coder-hub.com/76476502.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定