<div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:12px"><div id="yui_3_16_0_1_1417617698788_15308">Hi Carsten <br></div><div id="yui_3_16_0_1_1417617698788_15297"><br></div><div id="yui_3_16_0_1_1417617698788_15310" dir="ltr">Many thanks....the link you mention shows the route instructions describe each street and gives the position of the start point, its length, and time in seconds.</div><div id="yui_3_16_0_1_1417617698788_15331" dir="ltr"><br></div><div id="yui_3_16_0_1_1417617698788_15353" dir="ltr">This is very helpful.</div><div id="yui_3_16_0_1_1417617698788_15333" dir="ltr"><br></div><div id="yui_3_16_0_1_1417617698788_15335" dir="ltr">Still the documentation is not fully clear (to me).<br></div><div id="yui_3_16_0_1_1417617698788_15320" dir="ltr"><br></div><div id="yui_3_16_0_1_1417617698788_15338" dir="ltr">Take the example in the link: <br></div><div id="yui_3_16_0_1_1417617698788_15337" dir="ltr">    ["Turn left",</div><div id="yui_3_16_0_1_1417617698788_15336" dir="ltr">    "High Street",</div><div id="yui_3_16_0_1_1417617698788_15341" dir="ltr">    200,                   <------ 200 m long<br></div><div id="yui_3_16_0_1_1417617698788_15343" dir="ltr">    4,                        <------ position (of the starting point on the street?)<br></div><div id="yui_3_16_0_1_1417617698788_15345" dir="ltr">    10,                      <------- time to traverse this street?<br></div><div id="yui_3_16_0_1_1417617698788_15347" dir="ltr">    "200m",</div><div id="yui_3_16_0_1_1417617698788_15349" dir="ltr">    "NE",</div><div id="yui_3_16_0_1_1417617698788_15351" dir="ltr">    22.5</div><div id="yui_3_16_0_1_1417617698788_15603" dir="ltr">    ]</div><div id="yui_3_16_0_1_1417617698788_15324" dir="ltr"><br></div><div id="yui_3_16_0_1_1417617698788_15941" dir="ltr">My questions are:</div><div id="yui_3_16_0_1_1417617698788_15944" dir="ltr"><br></div><div id="yui_3_16_0_1_1417617698788_15945" dir="ltr">1. What is the lat/long of the starting position on High Street i.e how to convert "4" to lat/long. <br></div><div id="yui_3_16_0_1_1417617698788_17024" dir="ltr"><br></div><div id="yui_3_16_0_1_1417617698788_17026" dir="ltr">    I think this has to do with via indices and via points in the link you mention, but that seems a bit murky (at least to me). Any clarification would help a lot.</div><div id="yui_3_16_0_1_1417617698788_18441" dir="ltr">    What is the difference between via_indices and via_points. Is there a via_point for each point in the route instruction? Can I just use one or the other?<br></div><div id="yui_3_16_0_1_1417617698788_15950" dir="ltr"><br></div><div id="yui_3_16_0_1_1417617698788_15947" dir="ltr">2. After say 5 seconds of travel on High Street, what would be the lat/long of the new position.<br></div><div id="yui_3_16_0_1_1417617698788_15951" dir="ltr"><br></div><div id="yui_3_16_0_1_1417617698788_15964" dir="ltr">Thanks</div><div id="yui_3_16_0_1_1417617698788_15963" dir="ltr">Sriram<br></div><div id="yui_3_16_0_1_1417617698788_15312"><span></span></div><br>  <div id="yui_3_16_0_1_1417617698788_15289" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 12px;"> <div id="yui_3_16_0_1_1417617698788_15288" style="font-family: HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif; font-size: 16px;"> <div dir="ltr"> <hr size="1">  <font face="Arial" size="2"> <b><span style="font-weight:bold;">From:</span></b> Carsten Malchow <carsten64stadt@gmx.de><br> <b><span style="font-weight: bold;">To:</span></b> osrm-talk@openstreetmap.org <br> <b><span style="font-weight: bold;">Sent:</span></b> Wednesday, December 3, 2014 10:43 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [OSRM-talk] Plotting position in time using OSRM<br> </font> </div> <div id="yui_3_16_0_1_1417617698788_15287" class="y_msg_container"><br><div id="yiv1059649895"><div id="yui_3_16_0_1_1417617698788_15286"><div id="yui_3_16_0_1_1417617698788_15285" style="font-family:Verdana;font-size:12.0px;"><div id="yui_3_16_0_1_1417617698788_15284">
<div>Hi Sriram</div>

<div id="yui_3_16_0_1_1417617698788_15295"> </div>

<div id="yui_3_16_0_1_1417617698788_15293">to reply a part of your question:</div>

<div id="yui_3_16_0_1_1417617698788_15292">take a look at this documentacion [1]</div>

<div id="yui_3_16_0_1_1417617698788_15283">
<div id="yui_3_16_0_1_1417617698788_15291">The first number is driving directions.</div>

<div>The geomerty is a compressed tring that you have to decompress.</div>

<div id="yui_3_16_0_1_1417617698788_15282">also discripted in the Link below.</div>

<div> </div>

<div>Kind regards</div>

<div> </div>

<div>Carsten</div>

<div> </div>

<div>[1] https://github.com/Project-OSRM/osrm-backend/wiki/Output-json</div>

<div style="margin:10px 5px 5px 10px;padding:10px 0 10px 10px;border-left:2px solid #C3D9E5;word-wrap:break-word;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Mittwoch, 03. Dezember 2014 um 09:58 Uhr<br clear="none">
<b>Von:</b> "S R" <sriram_ott@yahoo.com><br clear="none">
<b>An:</b> "osrm-talk@openstreetmap.org" <osrm-talk@openstreetmap.org><br clear="none">
<b>Betreff:</b> [OSRM-talk] Plotting position in time using OSRM</div>

<div>
<div class="qtdSeparateBR"><br><br></div><div class="yiv1059649895yqt7741810159" id="yiv1059649895yqt78126"><div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:HelveticaNeue , Helvetica Neue , Helvetica , Arial , Lucida Grande , sans-serif;font-size:12.0px;">
<div id="yiv1059649895yui_3_16_0_1_1417617698788_5392">I would like to create a simple simulation of  a trip using OSRM.</div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_5391"> </div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_5390">I believe the steps would be as follows (my questions are in parenthesis below)</div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_5389"> </div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_5388">a. Load OSM map of a city into OSRM</div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_5397">b. Choose a random begin, end location that falls within the city lat/long (how to find lat/long limits of the loaded map?)</div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_5400">c. Compute the distance (in time) between start, end using OSRM</div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_5401">d. Also compute a path between start, end using OSRM (are the node vertices mentioned in route the same as in the OSM map?)</div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_5402">e. The difficult part:</div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_5403">    -- start the simulation by displaying the map along with position marker (Leaflet?)</div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_5404">    -- As time progresses, determine the location along the OSRM route computed above (how can this be done?)</div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_5406">       and adjust the position marker.</div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_6764">   </div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_6054">An OSRM route looks like this:</div>

<pre id="yiv1059649895yui_3_16_0_1_1417617698788_6055"><span id="yiv1059649895yui_3_16_0_1_1417617698788_6767"><span>"</span>route_instructions<span id="yiv1059649895yui_3_16_0_1_1417617698788_6766">"</span></span>: [
        [
            <span><span>"</span>10<span>"</span></span>,    <-------------------- what is this id and how to convert it to lat/long
            <span id="yiv1059649895yui_3_16_0_1_1417617698788_6765"><span>"</span>Schulstraße<span>"</span></span>,
            <span>126</span>,
            <span>0</span>,
            <span>18</span>,
            <span><span>"</span>126m<span>"</span></span>,
            <span><span>"</span>SE<span>"</span></span>,
            <span>116</span>
        ],
        [
            <span><span>"</span>7<span>"</span></span>,     <----------------  how to find elapsed time to this point from previous one
            <span><span>"</span>Am Rahmtor<span>"</span></span>,
            <span>57</span>,
            <span>2</span>,
            <span>11</span>,
            <span id="yiv1059649895yui_3_16_0_1_1417617698788_7592"><span>"</span>57m<span>"</span></span>,
            <span><span>"</span>NE<span>"</span></span>,
            <span>38</span>
        ]

Given a start and end lat/long, a network distance (time) can be obtained as follows:
<span id="yiv1059649895yui_3_16_0_1_1417617698788_6763"><span>"</span>distance_table<span>"</span></span>: [
        [
            <span>0</span>,
            <span id="yiv1059649895yui_3_16_0_1_1417617698788_6761">26084</span>
        ],
        [
            <span id="yiv1059649895yui_3_16_0_1_1417617698788_6762">26084</span>,
            <span>0</span>
        ]

This would be useful if the route way-points above could be converted into time units.
</pre>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_5409">Would appreciate any help with the above questions,</div>

<div id="yiv1059649895yui_3_16_0_1_1417617698788_5411">Sriram</div>
</div></div>
_______________________________________________ OSRM-talk mailing list OSRM-talk@openstreetmap.org <a rel="nofollow" shape="rect" target="_blank" href="https://lists.openstreetmap.org/listinfo/osrm-talk">https://lists.openstreetmap.org/listinfo/osrm-talk</a></div>
</div>
</div>
</div></div></div></div><br><div class="yqt7741810159" id="yqt28711">_______________________________________________<br clear="none">OSRM-talk mailing list<br clear="none"><a shape="rect" ymailto="mailto:OSRM-talk@openstreetmap.org" href="mailto:OSRM-talk@openstreetmap.org">OSRM-talk@openstreetmap.org</a><br clear="none"><a shape="rect" href="https://lists.openstreetmap.org/listinfo/osrm-talk" target="_blank">https://lists.openstreetmap.org/listinfo/osrm-talk</a><br clear="none"></div><br><br></div> </div> </div>  </div>