shortest path search for real road networks and dynamic costs with pgrouting

48
 Shortest path search for real road networks Anton Patrushev

Upload: antonpa

Post on 17-Dec-2014

4.604 views

Category:

Technology


3 download

DESCRIPTION

This presentation will show the inside and current state of pgRouting development. It will explain the shortest path search in real road networks and how the data structure is important for getting better routing results. We will show how you can improve the quality of the search with dynamic costs and make the result look closer to the reality. We will demonstrate the way of using pgRouting together with other Open Source tools. Also you will learn about difficulties and limitations of implementing routing functionality in GIS applications, the difference between algorithms and their performance. pgRouting is an extension of PostgreSQL and PostGIS. A predecessor of pgRouting - pgDijkstra, written by Sylvain Pasche from Camptocamp, was extended by Orkney (Japan) and renamed to pgRouting, which now is a part of the PostLBS project. pgRouting can perform: * shortest path search (with 3 different algorithms) * Traveling Salesperson Problem solution (TSP) * driving distance geometry calculation

TRANSCRIPT

Page 1: Shortest path search for real road networks and dynamic costs with pgRouting

   

Shortest path search for real road networks

Anton Patrushev

Page 2: Shortest path search for real road networks and dynamic costs with pgRouting

   

What is pgRouting?

Page 3: Shortest path search for real road networks and dynamic costs with pgRouting

    Shortest path

Page 4: Shortest path search for real road networks and dynamic costs with pgRouting

    TSP and DD

Page 5: Shortest path search for real road networks and dynamic costs with pgRouting

    VRP (DARP)

Page 6: Shortest path search for real road networks and dynamic costs with pgRouting

   

Real road networks

How do they look like?

Page 7: Shortest path search for real road networks and dynamic costs with pgRouting

   

Like this...

Page 8: Shortest path search for real road networks and dynamic costs with pgRouting

   

...or like this...

Page 9: Shortest path search for real road networks and dynamic costs with pgRouting

   

...or sometimes like this.

Page 10: Shortest path search for real road networks and dynamic costs with pgRouting

   

What makes them real?

traffic lights signs road marking

Page 11: Shortest path search for real road networks and dynamic costs with pgRouting

   

How pgRouting can help here?

Page 12: Shortest path search for real road networks and dynamic costs with pgRouting

   

gid,source,target,cost,reverse_cost,x1, y1,x2, y2,rule,to_cost

source

target

Page 13: Shortest path search for real road networks and dynamic costs with pgRouting

   

It means we should increase costs.

Traffic lights make you slower.

Page 14: Shortest path search for real road networks and dynamic costs with pgRouting

   

A

BC

D

cost(A)=cost(A)+30seccost(B)=cost(B)+30seccost(C)=cost(C)+30seccost(D)=cost(D)+30sec

1min

Page 15: Shortest path search for real road networks and dynamic costs with pgRouting

   

Signs tell you about restrictions and road types.

Page 16: Shortest path search for real road networks and dynamic costs with pgRouting

   

Page 17: Shortest path search for real road networks and dynamic costs with pgRouting

   

cost(A)=length(A)reverse_cost(A)=∞

A

Page 18: Shortest path search for real road networks and dynamic costs with pgRouting

   

Sometimes the costs have different meaning.

Page 19: Shortest path search for real road networks and dynamic costs with pgRouting

   

cost(A)=length(A)/2reverse_cost(A)=length(A)*2

cost(B)=length(B)*3reverse_cost(B)=length(B)/3

A

B

Page 20: Shortest path search for real road networks and dynamic costs with pgRouting

   

Turn restrictions obviously restrict

turns.

Page 21: Shortest path search for real road networks and dynamic costs with pgRouting

   

A

BC

D

cost(A)=cost(A)+1mincost(B)=cost(B)+1mincost(C)=cost(C)+1mincost(D)=cost(D)+1min

1min

A

BC

D

rule(A)="D"to_cost(A, D)=∞

Page 22: Shortest path search for real road networks and dynamic costs with pgRouting

   

Road type signs can be used for cost calculation.

Page 23: Shortest path search for real road networks and dynamic costs with pgRouting

   

Not only types, but also conditions.

Page 24: Shortest path search for real road networks and dynamic costs with pgRouting

   

What about road marking?

Page 25: Shortest path search for real road networks and dynamic costs with pgRouting

   

It separates lanes, ...

Page 26: Shortest path search for real road networks and dynamic costs with pgRouting

   

...specifies road types, ...

Page 27: Shortest path search for real road networks and dynamic costs with pgRouting

   

... and restrictions.

A

B

C

D

rule(D)="A, B"to_cost(D)=∞

E

Page 28: Shortest path search for real road networks and dynamic costs with pgRouting

   

And you know what's cool about pgRouting?

Page 29: Shortest path search for real road networks and dynamic costs with pgRouting

   

All costs are dynamic.

Which is opposite to pre-calculated.

Page 30: Shortest path search for real road networks and dynamic costs with pgRouting

   

If the road is closed, ...

Page 31: Shortest path search for real road networks and dynamic costs with pgRouting

   

... there is an accident, ...

Page 32: Shortest path search for real road networks and dynamic costs with pgRouting

   

... a sign with restrictions limited

in time, ...

Page 33: Shortest path search for real road networks and dynamic costs with pgRouting

   ... bad weather conditions, ...

Page 34: Shortest path search for real road networks and dynamic costs with pgRouting

   

... or an obstacle, ...

Page 35: Shortest path search for real road networks and dynamic costs with pgRouting

   

You don't need to rebuild and reload

your network...

Page 36: Shortest path search for real road networks and dynamic costs with pgRouting

   ... and wait forever.

Page 37: Shortest path search for real road networks and dynamic costs with pgRouting

   

You only need to adjust the cost for this particular road.

And next search will go another way.

Page 38: Shortest path search for real road networks and dynamic costs with pgRouting

   

Cost can be virtually anything.

Page 39: Shortest path search for real road networks and dynamic costs with pgRouting

   

It is possible to use pgRouting with OSM data.

Page 40: Shortest path search for real road networks and dynamic costs with pgRouting

   

pgRouting can be used for different kinds of networks.

Page 41: Shortest path search for real road networks and dynamic costs with pgRouting

   

Canals and rivers, ...

Page 42: Shortest path search for real road networks and dynamic costs with pgRouting

   

... hiking trails, ...

Page 43: Shortest path search for real road networks and dynamic costs with pgRouting

   

... or any other kind of network.

Page 44: Shortest path search for real road networks and dynamic costs with pgRouting

   

Now it's showtime!

Page 45: Shortest path search for real road networks and dynamic costs with pgRouting

   

Thanks to people who put their photos to flickr under Creative Commons license.

Thanks to sxc.hu for being the best free photo stock.

Page 46: Shortest path search for real road networks and dynamic costs with pgRouting

   

Just want you to remember

pgrouting.orggeorepublic.deopenvrp.com

Page 47: Shortest path search for real road networks and dynamic costs with pgRouting

   

Page 48: Shortest path search for real road networks and dynamic costs with pgRouting