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
270
Other Decks in Programming
See All in Programming
受け取る人から提供する人になるということ
little_rubyist
0
250
初めてDefinitelyTypedにPRを出した話
syumai
0
420
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
0
100
RubyLSPのマルチバイト文字対応
notfounds
0
120
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
310
React CompilerとFine Grained Reactivityと宣言的UIのこれから / The next chapter of declarative UI
ssssota
1
100
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
150
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.3k
NSOutlineView何もわからん:( 前編 / I Don't Understand About NSOutlineView :( Pt. 1
usagimaru
0
340
Pinia Colada が実現するスマートな非同期処理
naokihaba
4
230
Macとオーディオ再生 2024/11/02
yusukeito
0
380
イベント駆動で成長して委員会
happymana
1
340
Featured
See All Featured
Designing for humans not robots
tammielis
250
25k
No one is an island. Learnings from fostering a developers community.
thoeni
19
3k
What's in a price? How to price your products and services
michaelherold
243
12k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
10
720
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
169
50k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
6
430
Side Projects
sachag
452
42k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
356
29k
4 Signs Your Business is Dying
shpigford
180
21k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
The Myth of the Modular Monolith - Day 2 Keynote - Rails World 2024
eileencodes
16
2.1k
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?