Skip to content

Instantly share code, notes, and snippets.

View Fnhid's full-sized avatar
๐Ÿšฉ

YuHyeon Cha Fnhid

๐Ÿšฉ
View GitHub Profile
@Fnhid
Fnhid / 1.py
Last active May 7, 2025 04:34
ํŠธ๋ฐ๊ฒฝ ์ค‘๊ฐ„๊ณผ์ œ ๋ฐ์ดํ„ฐ ์ „์ฒ˜๋ฆฌ์šฉ ์ฝ”๋“œ
# osmnx ๋ฐ์ดํ„ฐ ๋ถˆ๋Ÿฌ์˜ค๋Š” ์ฝ”๋“œ
import osmnx as ox
G = ox.graph_from_place('๋™์ž‘๊ตฌ, ์„œ์šธํŠน๋ณ„์‹œ, ๋Œ€ํ•œ๋ฏผ๊ตญ', network_type='all')
nodes, edges = ox.graph_to_gdfs(G, nodes=True, edges=True)
nodes.to_csv('seoul_nodes.csv', index=False)
print("node done")
edges.to_csv('seoul_edges.csv', index=False)
print("edge done")