[pgrouting-users] Importing for multimodal routes

Javier Mr javiersdevmail at ymail.com
Mon Feb 13 11:48:06 EST 2012


Hi,

i have been playing around with osm2pgrouting and pgrouting itself, i have followed the pgrouting workshop and i have things more clear. However i still have a few questions.

1. If we have a edge conection nodes A and B and the type of the way that allow several tranvel modes (for example 'residential'), for example bicicle and car, then 1 edge is created, rigth?

2. If i want to limit the type of ways used for routing, that can be achieved by the SQL text sentence in the A* algorithm so it just retrieve that types of ways, rigth?

3. Now, my problem. I don't want to limit the type of vehicle used, but the cost of taking a road by car, cicling or by foot isn't the same, and even more not all type of ways are suitable for all types of vehicles, cars can't go through pedestrian ways. I want to calculate the cheapest routing regardless the vehicle used. My first idea is to 'clone' edges so i can create disjointed graphs. 

For example A and B are nodes of a way type residential, then some edeges are created 1 from A to B and vehicle Car, 2 from A to B and vehicle Bike and 3 from A to B and vehicle foot (since is a residential way). Now if i compute A* it should giveme the cheapest way and implicit is the vehicle used.

Furthermore, supose 4 nodes, A, B, C, D:

A: sidewalk and bicicle line and rental bicicle
B: sidewalk
C sidewalk, bicicle line and rental bicicle
D: sidewalk, bicicleline and bicicle parking

raw costs (reverse al equal):
A - B: 10
A - C: 20
B - D: 10
C -D: 2

The topography looks:

A  --  10 ------B
|                        |
20                     10
|                        |
C ---- 2 -------D

If the edeges are cloned depending the vechicle used, it looks like:

x0 : node is sidewalk. Cost multiplier  1 (doesn't modify cost)
x1: node is public bike. Cost multiplier  0.2 (divide cost by 5)
x2: node is private bike. Cost multiplier 0.2

A0 --- 10 ---- B0
|                        |
20                     10
|                         |
C0 ---- 2 ----- D0

A1
|
4
|
C1

A2
|
4
|
C2 ----- 0.5 ... D2

And :

A0 - A1: 0 (cost)
C0 - C1: 0
D0 - C2: 0

Now if my initial state is A2 it implies i am in A with my private bike so if my goal is C0 (by foot) i have to park by bike in D in order to achieve the goal.
Or if initial state is A0 and goal state is C0 i would do: A0 - A1 - C1 - C0, so i have rented a public bike and i have also returned it.

Of course i'm aware that this increase the state space for A*, the other aproach is to modify how A* expand nodes. 

If you know a better approach to achieve this please share. If not, i was planning to modify how the network topology is created, thats why i ask in the first mail for a easy to used OSM XML libreary, and since it's only for importing i don't really care about the programming language.

Maybe the easiest way is to modify osm2pgrouting so it imports the topology i described?

Hope it's easy to inderstand.

Best regards.
Javier.

De: Stephen Woodbridge <woodbri at swoodbridge.com>
>Para: pgrouting-users at lists.osgeo.org 
>Enviado: Jueves 9 de febrero de 2012 18:49
>Asunto: Re: [pgrouting-users] Importing for multimodal routes
> 
>On 2/9/2012 11:00 AM, Javier Mr wrote:
>> Hi,
>>
>> i'm planning to use pgRouting for multimodal routing. I know there is a
>> branch of pgRouting for MMPTR, but until i gather more information about
>> it i'm trying to avoid it.
>>
>> What i'm planning is to make several graph, each one for each type of
>> vehicle, pedestrians, bikes, etc... and each line of bus, train, subway,
>> etc... Then connect this graphs by making edeges from, for example, a
>> bus station to the closest pedestrian edege with length of 0. This way i
>> would have a big state set for the A* algorithm that should perform
>> multimodal planing. Is there a reason why this shoulnd't be done?
>>
>> I have some doubts about how osm2pgrouting woks. I have seen that OSM is
>> capable of storing all this things, but i don't know if osm2pgrouting
>> import all that into the DB, does it?.
>>
>> There are some libraries that work with OSM XML format, any in
>> particular that you recomend?
>
>There are a few tools that will load OSM data into a postgres databse 
>that pgRouting can use. You might want to read the documenation:
>
>http://www.pgrouting.org/docs/tools.html
>
>-Steve
>
>
>_______________________________________________
>Pgrouting-users mailing list
>Pgrouting-users at lists.osgeo.org
>http://lists.osgeo.org/mailman/listinfo/pgrouting-users
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/pgrouting-users/attachments/20120213/02cadf4d/attachment-0001.html


More information about the Pgrouting-users mailing list