【问题标题】:OSMNX: get external coordinates of a building giving a coordinate where it is locatedOSMNX:获取建筑物的外部坐标,给出它所在的坐标
【发布时间】:2021-12-18 20:33:27
【问题描述】:

希望有人可以帮助我

我正在尝试检索给定坐标/地理定位的最近建筑物的外部坐标。

我可以获得给出地址的建筑物的所有外部坐标(代码如下),但我需要检索相同的信息,现在给出坐标/地理定位。

例如,我需要获取位于该点的建筑物的外部坐标,纬度/经度为:53.2588051,-2.124499。

import osmnx as ox

tesco = ox.geocode_to_gdf('Tesco, Exchange Street, SK11 6UZ, Macclesfield, Cheshire, GB')
polygon = tesco.iloc[0]['geometry']
polygon.exterior.coords
list(polygon.exterior.coords)

我尝试使用方法“ox.pois_from_point”,但出现错误:AttributeError: module 'osmnx' has no attribute 'pois_from_point'

非常感谢!

【问题讨论】:

标签: python-3.x osmnx


【解决方案1】:
import osmnx as ox

tags = {'building': True} # would return all building footprints in the area
center_point = (53.2588051, -2.124499)

a = ox.geometries.geometries_from_point(center_point, tags, dist=20)
polygon = a.iloc[0]['geometry']
polygon.exterior.coords
list(polygon.exterior.coords)

【讨论】:

    猜你喜欢
    • 2021-12-03
    • 2012-07-18
    • 2012-10-22
    • 1970-01-01
    • 1970-01-01
    • 2021-05-11
    • 1970-01-01
    • 1970-01-01
    • 2018-02-24
    相关资源
    最近更新 更多