如何可视化检索到的 OSM 建筑物数据并将其转换为 shapefile?
How to visualize and convert retrieved OSM buildings data to shapefile?
我已使用此脚本从 OSM 检索数据:
import overpy
api = overpy.Overpass()
print('Obtaining Data...')
result = api.query("""
[out:json]
[timeout:25]
;
(
relation
["building"]
(51.909331730124,4.3151378631592,51.954898210091,4.405689239502);
way
["building"]
(51.909331730124,4.3151378631592,51.954898210091,4.405689239502);
);
out;
>;
out skel qt;
""")
我想在执行一些空间分析之前可视化数据并将其保存为 shapefile。我不知道如何 convert/save 它作为一个 shapefile,任何人都可以提供任何建议吗?
谢谢!
import osmnx as ox
import ast
point = 'point coordinates'
dist = 'distance in m'
buildings = ox.geometries.geometries_from_point(point, {'building': True}, dist=dist)
并转换为地理数据框:
buildings_save = buildings.applymap(lambda x: str(x) if isinstance(x, list) else x)
我已使用此脚本从 OSM 检索数据:
import overpy
api = overpy.Overpass()
print('Obtaining Data...')
result = api.query("""
[out:json]
[timeout:25]
;
(
relation
["building"]
(51.909331730124,4.3151378631592,51.954898210091,4.405689239502);
way
["building"]
(51.909331730124,4.3151378631592,51.954898210091,4.405689239502);
);
out;
>;
out skel qt;
""")
我想在执行一些空间分析之前可视化数据并将其保存为 shapefile。我不知道如何 convert/save 它作为一个 shapefile,任何人都可以提供任何建议吗?
谢谢!
import osmnx as ox
import ast
point = 'point coordinates'
dist = 'distance in m'
buildings = ox.geometries.geometries_from_point(point, {'building': True}, dist=dist)
并转换为地理数据框:
buildings_save = buildings.applymap(lambda x: str(x) if isinstance(x, list) else x)