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