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
Prepare for Jakarta EE 11 - Performance and Developer Productivity
ivargrimstad
0
670
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
22
15k
ADRを一年運用してみた/adr_after_a_year
hanhan1978
7
2.3k
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
210
Ruby Pattern Matching
bkuhlmann
0
920
今、知っておきたい! 生成AIエージェントの世界
elith
3
350
TYPO3 v13 – The road to LTS: What's new and new APIs
luisasofie_xoxo
0
190
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
590
try! Swift Tokyo 2024 参加報告 / try! Swift Tokyo 2024 Report
hironytic
0
200
Hanami and htmx
bkuhlmann
0
200
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
6
880
Rubyでたのしむクリエイティブコーディング/Enjoy Creative coding with Ruby
chobishiba
1
170
Featured
See All Featured
For a Future-Friendly Web
brad_frost
171
8.9k
The Art of Programming - Codeland 2020
erikaheidi
41
12k
The Straight Up "How To Draw Better" Workshop
denniskardys
227
130k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
34
8.9k
Art, The Web, and Tiny UX
lynnandtonic
288
19k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
Code Reviewing Like a Champion
maltzj
513
39k
We Have a Design System, Now What?
morganepeng
42
6.7k
Writing Fast Ruby
sferik
620
60k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
352
28k
Building Applications with DynamoDB
mza
88
5.6k
A better future with KSS
kneath
231
16k
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?