<div dir="ltr">Hi Patrick,<div><br></div><div> Nobody has written a "How to make a public transport profile" document for OSRM, you'll have to piece it together from examples and reading code.</div><div><br></div><div> That said, the "testbot" profile here: <a href="https://github.com/Project-OSRM/osrm-backend/blob/master/profiles/testbot.lua">https://github.com/Project-OSRM/osrm-backend/blob/master/profiles/testbot.lua</a></div><div><br></div><div> is fairly simple. There are 3 functions: `process_node`, `process_way`, and `process_turn`. The `process_way` function is run for every way in the OSM file you input, and it decides whether to include it in the routing graph (by setting properties on the `result` object), or to exclude it (by simply returning without doing any work).</div><div><br></div><div> As someone else pointed out in another thread, the `car.lua` profile is pretty complex - it's developed over time, and has a lot of logic in it that makes it hard to understand. I'd start with the testbot profile above, and add the stuff you think you need.</div><div><br></div><div> You might also want to take a look at <a href="https://github.com/Project-OSRM/osrm-frontend/tree/gh-pages/debug">https://github.com/Project-OSRM/osrm-frontend/tree/gh-pages/debug</a> which is a web viewer that can show you what the routing graph looks like.</div><div><br></div><div>daniel</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Apr 30, 2018 at 8:39 AM, Patrick Agin <span dir="ltr"><<a href="mailto:agin.patrick@gmail.com" target="_blank">agin.patrick@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Thanks again Daniel. Could you just give me an example (with a snippet of code maybe) of a good implementation of point 1 (<span style="font-size:12.8px">Lua profile that only includes public transport ways in the graph). I just don't have any clue about implementing this and I'm not aware of any docs that could help me with that. </span><span class="HOEnZb"><font color="#888888"><div><span style="font-size:12.8px">Patrick </span></div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">2018-04-30 11:30 GMT-04:00 Daniel Patterson <span dir="ltr"><<a href="mailto:daniel@mapbox.com" target="_blank">daniel@mapbox.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi Patrick,<div><br></div><div> This could be tricky, depending on how long the traces you're trying to match are.</div><div><br></div><div> The OSRM Lua profiles basically act as a filter - they decide which ways from OSM are included in the routing graph, and assign properties to edges in the graph.</div><div><br></div><div> The map-matching algorithm will try to snap your coordinate list to the most likely path across the routing graph.</div><div><br></div><div> In order to only snap to public transport paths, you'll need:</div><div><br></div><div> 1) A Lua profile that only includes public transport ways in the graph.</div><div> 2) A way to ensure that all the public transport paths are connected together (this could be difficult without including lots of extra stuff you don't want in the graph)</div><div> 3) GPS traces that are somewhat close to the actual paths themselves, as mapped in OSM</div><div><br></div><div> (2) could be the really tricky bit here. If the public transport paths are not connected, then any GPS trace you have that spans two public transport routes (say, a bus change, or a train change) but those routes aren't actually connected by the graph, will cause problems with the map-matching algorithm.</div><div><br></div><div>daniel</div></div><div class="gmail_extra"><br><div class="gmail_quote"><div><div class="m_-2828252037286740036h5">On Mon, Apr 30, 2018 at 7:23 AM, Patrick Agin <span dir="ltr"><<a href="mailto:agin.patrick@gmail.com" target="_blank">agin.patrick@gmail.com</a>></span> wrote:<br></div></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class="m_-2828252037286740036h5"><div dir="ltr">Hi everyone,<div>I'm trying to define a profile to force match service to take public transport routes only. I tried to add residential in excludable so I can add exclude=residential at query time but it does not change anything to the returned answer. Can someone help or point me towards documentation that could help (I've read profile.md but it does not help me much).</div><div>Thanks a lot,</div><div>Patrick (newbie with osrm)</div></div>
<br></div></div>______________________________<wbr>_________________<br>
OSRM-talk mailing list<br>
<a href="mailto:OSRM-talk@openstreetmap.org" target="_blank">OSRM-talk@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank">https://lists.openstreetmap.or<wbr>g/listinfo/osrm-talk</a><br>
<br></blockquote></div><br></div>
<br>______________________________<wbr>_________________<br>
OSRM-talk mailing list<br>
<a href="mailto:OSRM-talk@openstreetmap.org" target="_blank">OSRM-talk@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank">https://lists.openstreetmap.or<wbr>g/listinfo/osrm-talk</a><br>
<br></blockquote></div><br></div>
</div></div><br>______________________________<wbr>_________________<br>
OSRM-talk mailing list<br>
<a href="mailto:OSRM-talk@openstreetmap.org">OSRM-talk@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/osrm-talk" rel="noreferrer" target="_blank">https://lists.openstreetmap.<wbr>org/listinfo/osrm-talk</a><br>
<br></blockquote></div><br></div>