우선 Geopandas는 설치되어있는 상태였어서 에러는 안났다.
설치하기
- 공식 문서
https://osmnx.readthedocs.io/en/stable/
OSMnx 1.2.3 — OSMnx 1.2.3 documentation
OSMnx 1.2.3 OSMnx is a Python package that lets you download geospatial data from OpenStreetMap and model, project, visualize, and analyze real-world street networks and any other geospatial geometries. You can download and model walkable, drivable, or bik
osmnx.readthedocs.io
들어가서 이부분 복사
onda config --prepend channels conda-forge
conda create -n ox --strict-channel-priority osmnx

anaconda prompt 키고 한줄씩 복붙하면 콘솔창에 가상환경 세팅되는게 보인다.
다 설치되면 Anaconda Navigator 켜서 ox 가상환경 클릭

세팅된 가상환경에 JupyterLab, Notebook Install 눌러서 설치해준다.

잘 설치되었는지 확인하기
https://geoffboeing.com/2016/11/osmnx-python-street-networks/
OSMnx: Python for Street Networks
Check out the journal article about OSMnx. OSMnx is a Python package to retrieve, model, analyze, and visualize street networks from OpenStreetMap. Users can download and model walkable, drivable, …
geoffboeing.com
여기 참고해보는것도 좋다.
import osmnx as ox
ox.config(use_cache=True, log_console=True)
ox.__version__ #버전확인
# get a graph for some city
# www.openstreetmap.org에서 검색 결과가 city-state-country 단위로 나와야 함
G = ox.graph_from_place('부평구, 인천, 대한민국', network_type='drive')
fig, ax = ox.plot_graph(G)

참고자료
https://joshkobeng.medium.com/installing-osmnx-on-windows-cc96a3b432ea
Installing OSMnx on Windows
This is a step-by-step approach to installing the Open Street Map (OSMnx) library for python using conda. These are personal steps I took…
joshkobeng.medium.com
'Python' 카테고리의 다른 글
| [Seaborn] legend 위치 옮기기 (1) | 2023.01.06 |
|---|---|
| 공공데이터포털 Open API를 JSON으로 불러오기 (0) | 2022.12.21 |
| [Geopandas] 기초 시각화, geojson 사용하기 (0) | 2022.12.15 |
| [Python] tqdm (0) | 2022.11.28 |
| [Python] Groupby로 묶은 df 다시 되돌리기 (0) | 2022.11.22 |