<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span>Hi,</span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><span><br></span></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">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.</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">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?</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; ">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?</div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><br></div><div><font size="3">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.&nbsp;</font></div><div><font
 size="3"><br></font></div><div><font size="3">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.</font></div><div><font size="3"><br></font></div><div><font size="3">Furthermore, supose 4 nodes, A, B, C, D:</font></div><div><font size="3"><br></font></div><div><font size="3">A: sidewalk and bicicle line and rental bicicle</font></div><div><font size="3">B: sidewalk</font></div><div><font size="3">C sidewalk, bicicle line and rental bicicle</font></div><div><font size="3">D: sidewalk, bicicleline and bicicle parking</font></div><div><font size="3"><br></font></div><div>raw costs (reverse al equal):</div><div>A - B: 10</div><div>A - C: 20</div><div>B - D: 10</div><div>C -D: 2</div><div><br></div><div>The
 topography looks:</div><div><br></div><div>A &nbsp;-- &nbsp;10 ------B</div><div>| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div><div>20 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10</div><div>| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div><div>C ---- 2 -------D</div><div><br></div><div>If the edeges are cloned depending the vechicle used, it looks like:</div><div><br></div><div>x0 : node is sidewalk. Cost&nbsp;
multiplier&nbsp;&nbsp;1 (doesn't modify cost)</div><div>x1: node is public bike. Cost&nbsp;
multiplier&nbsp;&nbsp;0.2 (divide cost by 5)</div><div>x2: node is private bike. Cost multiplier 0.2</div><div><br></div><div>A0 --- 10 ---- B0</div><div>| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;|</div><div>20 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 10</div><div>| &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; |</div><div>C0 ---- 2 ----- D0</div><div><br></div><div>A1</div><div>|</div><div>4</div><div>|</div><div>C1</div><div><br></div><div>A2</div><div>|</div><div>4</div><div>|</div><div>C2 ----- 0.5 ... D2</div><div><br></div><div>And :</div><div><br></div><div>A0 - A1: 0 (cost)</div><div>C0 - C1: 0</div><div>D0 - C2: 0</div><div><br></div><div>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.</div><div>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.</div><div><br></div><div>Of course i'm aware that this increase the state space for A*, the other aproach is to modify how A* expand nodes.&nbsp;</div><div><br></div><div>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.</div><div><br></div><div>Maybe the easiest way is to modify osm2pgrouting so it imports the topology i described?</div><div><br></div><div>Hope it's easy to inderstand.</div><div><br></div><div>Best regards.</div><div>Javier.</div><div><font size="3"><br></font></div><div style="font-family: 'times new roman', 'new york', times, serif; font-size: 12pt; "><blockquote style="border-left: 2px solid
 rgb(16, 16, 255); margin-left: 5px; margin-top: 5px; padding-left: 5px;"><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div style="font-size: 12pt; font-family: 'times new roman', 'new york', times, serif; "><div dir="ltr"><font size="2" face="Arial">  <b><span style="font-weight:bold;">De:</span></b> Stephen Woodbridge &lt;woodbri@swoodbridge.com&gt;<br> <b><span style="font-weight: bold;">Para:</span></b> pgrouting-users@lists.osgeo.org <br> <b><span style="font-weight: bold;">Enviado:</span></b> Jueves 9 de febrero de 2012 18:49<br> <b><span style="font-weight: bold;">Asunto:</span></b> Re: [pgrouting-users] Importing for multimodal routes<br> </font> </div> <br>On 2/9/2012 11:00 AM, Javier Mr wrote:<br>&gt; Hi,<br>&gt;<br>&gt; i'm planning to use pgRouting for multimodal routing. I know there is a<br>&gt; branch of pgRouting for MMPTR, but until i gather more information about<br>&gt; it i'm trying to avoid
 it.<br>&gt;<br>&gt; What i'm planning is to make several graph, each one for each type of<br>&gt; vehicle, pedestrians, bikes, etc... and each line of bus, train, subway,<br>&gt; etc... Then connect this graphs by making edeges from, for example, a<br>&gt; bus station to the closest pedestrian edege with length of 0. This way i<br>&gt; would have a big state set for the A* algorithm that should perform<br>&gt; multimodal planing. Is there a reason why this shoulnd't be done?<br>&gt;<br>&gt; I have some doubts about how osm2pgrouting woks. I have seen that OSM is<br>&gt; capable of storing all this things, but i don't know if osm2pgrouting<br>&gt; import all that into the DB, does it?.<br>&gt;<br>&gt; There are some libraries that work with OSM XML format, any in<br>&gt; particular that you recomend?<br><br>There are a few tools that will load OSM data into a postgres databse <br>that pgRouting can use. You might want to read the documenation:<br><br><a
 href="http://www.pgrouting.org/docs/tools.html" target="_blank">http://www.pgrouting.org/docs/tools.html</a><br><br>-Steve<br><br><br>_______________________________________________<br>Pgrouting-users mailing list<br><a ymailto="mailto:Pgrouting-users@lists.osgeo.org" href="mailto:Pgrouting-users@lists.osgeo.org">Pgrouting-users@lists.osgeo.org</a><br><a href="http://lists.osgeo.org/mailman/listinfo/pgrouting-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/pgrouting-users</a><br><br><br> </div> </div> </blockquote></div>   </div></body></html>