Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Routing OpenStreetMap
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
itszero
April 13, 2015
Programming
0
1.4k
Routing OpenStreetMap
Brief introduction to A* and routing on OpenStreetMap data.
itszero
April 13, 2015
Tweet
Share
More Decks by itszero
See All by itszero
d3.js: the core concepts
itszero
1
2.4k
EcoSec
itszero
1
200
TaipeiFever
itszero
0
310
Other Decks in Programming
See All in Programming
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
190
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.3k
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1k
Architectural Extensions
denyspoltorak
0
280
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
Basic Architectures
denyspoltorak
0
660
AI巻き込み型コードレビューのススメ
nealle
1
150
AIによる開発の民主化を支える コンテキスト管理のこれまでとこれから
mulyu
3
180
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
Package Management Learnings from Homebrew
mikemcquaid
0
210
2026年 エンジニアリング自己学習法
yumechi
0
130
Featured
See All Featured
Darren the Foodie - Storyboard
khoart
PRO
2
2.4k
The SEO identity crisis: Don't let AI make you average
varn
0
67
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
Context Engineering - Making Every Token Count
addyosmani
9
650
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
65
Rebuilding a faster, lazier Slack
samanthasiow
85
9.4k
sira's awesome portfolio website redesign presentation
elsirapls
0
150
AI: The stuff that nobody shows you
jnunemaker
PRO
2
250
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
240
Statistics for Hackers
jakevdp
799
230k
AI Search: Where Are We & What Can We Do About It?
aleyda
0
6.9k
Fireside Chat
paigeccino
41
3.8k
Transcript
Routing OpenStreetMap Zero Cho
A quick recap on Graph
node edge 1 weight 5 1 10
node edge 1 weight 5 1 10 shortest path, weight
= 7
Georgia Institute ofTechnology d a o R l l i
t 4 1 t e e r t S a t t e i r a M W N t S h t 0 1 Tech Pk y N W W N e v A l l i h p m e H W N e u n e v A h t r o N FerstDrNW Fers tDr NW WilliamsSt SpringSt NW 10thStN WPeachtree St NW t S e e r t h c a
a Fers tDr NW
None
None
How is routing done?
many ways. We will talk about A-star algorithm today.
S 1 E 2 node 1/-10 5/6 1/1 10/10 7/5
S 1 E 2 node 1/-10 5/6 1/1 10/10 7/5
S 1 E 2 node 1/-10 5/6 1/1 10/10 7/5
1 2 0 + 5 0 + 6
S 1 E 2 node 1/-10 5/6 1/1 10/10 7/5
2 0 + 6 5 - 10 E 5 + 1
S 1 E 2 node 1/-10 5/6 1/1 10/10 7/5
E 5 + 1 -5 + 10
S 1 E 2 node 1/-10 5/6 1/1 10/10 7/5
E 5
which leads us to my first result… A* OpenStreetMap router
written in Ruby https://github.com/itszero/osm-simple-router
which is great… except it’s…
so slow.
How do we improve it?
Moving to neo4j a Graph-based database.
Cypher Query Language MATCH (actor:Person)-[:ACTED_IN]->(movie:Movie) WHERE movie.title =~ "T.*" RETURN
movie.title as title, collect(actor.name) as cast ORDER BY title ASC LIMIT 10;
Sure it helps having proper storing and querying engine, but
the data is still too much. ~25x improves? 5 secs?
None
None
intersections
overlay link 3 5 8*
take Atlanta metro area for an example 2,567,916 nodes ➔
452,313 (-83%) 10,669,432 relationships ➔ 1,843,440 (-83%) 4.65 secs. routing time ➔ 1.30 secs.
Now we have the algorithm, all we need to do
is plug it into the database.
which leads us to my second result… A* OpenStreetMap router
for Neo4j https://github.com/itszero/neo4j-astar-example (code is really ugly tho)
None
Questions?