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
itszero
April 13, 2015
Programming
0
1.3k
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
190
TaipeiFever
itszero
0
280
Other Decks in Programming
See All in Programming
為你自己學 Python
eddie
0
540
watsonx.ai Dojo #6 継続的なAIアプリ開発と展開
oniak3ibm
PRO
0
270
Pythonでもちょっとリッチな見た目のアプリを設計してみる
ueponx
0
220
ISUCON14公式反省会LT: 社内ISUCONの話
astj
PRO
0
140
ATDDで素早く安定した デリバリを実現しよう!
tonnsama
1
2.4k
チームの立て直し施策をGoogleの 『効果的なチーム』と見比べてみた
maroon8021
0
270
functionalなアプローチで動的要素を排除する
ryopeko
1
930
ファインディの テックブログ爆誕までの軌跡
starfish719
1
780
Fixstars高速化コンテスト2024準優勝解法
eijirou
0
200
traP の部内 ISUCON とそれを支えるポータル / PISCON Portal
ikura_hamu
0
230
Внедряем бюджетирование, или Как сделать хорошо?
lamodatech
0
980
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
450
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
175
51k
Being A Developer After 40
akosma
89
590k
Mobile First: as difficult as doing things right
swwweet
222
9.2k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
192
16k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
30
2.1k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
220
Designing for Performance
lara
604
68k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.7k
Documentation Writing (for coders)
carmenintech
67
4.6k
How to train your dragon (web standard)
notwaldorf
89
5.8k
Site-Speed That Sticks
csswizardry
3
310
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?