This script use to generate weighted graph from OpenStreetMap data
1. images/images.png: image of graph with highlight source and destination
2. nodes_origin.csv: list of nodes in graph generated from OpenStreetMap.
edges_origin.csv: list of edges in graph generated from OpenStreetMap.
3. adj_list.json: adjacency list as json format.
4. graph.graphml: graphml format of graph for later plotting.
pip3 install -r requirements.txt
---
areas:
- "Quận 10"
- "Quận 3"
- "Quận 1"
or you can use bbox to specify the area which more accurate than above method, if you specify both, bbox will be used. bbox is in format of [north, south, east, west]
bbox: [10.7880, 10.7591, 106.7048, 106.6556]
include source and destination for highlight in areas_list.txt (optional, still manually find the node id)
src_node: 2302073725 # Đai học Bách Khoa
dest_node: 11221021745 # Chợ Bến Thành
include custom filter for flexibility shrink the data (you will thank me later when dealing with Floyd-Warshall algorithm)
custom_filter: '["highway"~"primary|secondary|tertiary"]'
python3 osmnx2graph.py