<div dir="ltr"><div>Let me show you how you can find out more about specific variables like mode_ferry:<br></div><div><br>your best bet is to search the code base, for example, see this initial search for mode_ferry:<br><br><a href="https://github.com/Project-OSRM/osrm-backend/search?utf8=%E2%9C%93&q=mode_ferry&type=Code">https://github.com/Project-OSRM/osrm-backend/search?utf8=%E2%9C%93&q=mode_ferry&type=Code</a><br><br></div>you can see how we set result.forward_mode and result.backward_mode to mode_ferry there, so let's search for forward_mode:<br><div><div><br><a href="https://github.com/Project-OSRM/osrm-backend/search?utf8=%E2%9C%93&q=forward_mode&type=Code">https://github.com/Project-OSRM/osrm-backend/search?utf8=%E2%9C%93&q=forward_mode&type=Code</a><br><br></div><div>this gives us some lua profiles, which we ignore, since we want to see how the OSRM implementation uses forward_mode and backward_mode; the last search hit is scripting_environment.cpp:<br></div><div><br><a href="https://github.com/Project-OSRM/osrm-backend/blob/8f6fc0146ba76d34d20c5b7a87b75249bbb12b82/extractor/scripting_environment.cpp#L121-L124">https://github.com/Project-OSRM/osrm-backend/blob/8f6fc0146ba76d34d20c5b7a87b75249bbb12b82/extractor/scripting_environment.cpp#L121-L124</a><br><br></div><div>this is where we expose the ExtractionWay's set_forward_mode and set_backward_mode member functions, aliasing them to the lua properties forward_mode and backward_mode --- so let's go on searching for the ExtractionWay type:<br><br><a href="https://github.com/Project-OSRM/osrm-backend/blob/8f6fc0146ba76d34d20c5b7a87b75249bbb12b82/extractor/extraction_way.hpp#L112-L115">https://github.com/Project-OSRM/osrm-backend/blob/8f6fc0146ba76d34d20c5b7a87b75249bbb12b82/extractor/extraction_way.hpp#L112-L115</a><br><br></div><div>in those member functions, the forward_travel_mode and backward_travel_mode are set accordingly. If you check their types a few lines below in the member attribute declarations, you will see they are of type TravelMode. And here it is:<br><br><a href="https://github.com/Project-OSRM/osrm-backend/blob/8f6fc0146ba76d34d20c5b7a87b75249bbb12b82/data_structures/travel_mode.hpp#L34-L35">https://github.com/Project-OSRM/osrm-backend/blob/8f6fc0146ba76d34d20c5b7a87b75249bbb12b82/data_structures/travel_mode.hpp#L34-L35</a><br><br></div><div>a quick search for TRAVEL_MODE_INACCESSIBLE reveals the following line in the extractor:<br><br><a href="https://github.com/Project-OSRM/osrm-backend/blob/9ef1f8cba31ec8323b357d233f1c552b1c7c9e09/extractor/extractor_callbacks.cpp#L95-L99">https://github.com/Project-OSRM/osrm-backend/blob/9ef1f8cba31ec8323b357d233f1c552b1c7c9e09/extractor/extractor_callbacks.cpp#L95-L99</a><br></div><div><br></div><div>where ways are discarded, if they are inaccessible! Tada!<br><br><br></div><div>As you can see, even though it is quite a bit of effort tracing back specific variables, it can be done in a few minutes with only the most basic tools (I did this entirely using the Github search functionality --- of course you can use grep or your code browser of choice, too).<br><br></div><div>Hope that helps,<br></div><div>Daniel J H<br></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 11, 2015 at 7:06 PM, Richard Marsden <span dir="ltr"><<a href="mailto:winwaed@gmail.com" target="_blank">winwaed@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 bgcolor="#FFFFFF"><div>By coincidence I was working through the lua scripts trying to understand them.</div><div><br></div><div>So what is the significance of the 1,2,3?  Just unique identifiers. As long as they're non-zero, they will be enabled?</div><span class="HOEnZb"><font color="#888888"><div><br></div></font></span><div><span class="HOEnZb"><font color="#888888">Richard</font></span><div><div class="h5"><br><br>On Nov 11, 2015, at 9:23 AM, Daniel Hofmann <<a href="mailto:hofmann@mapbox.com" target="_blank">hofmann@mapbox.com</a>> wrote:<br><br></div></div></div><div><div class="h5"><div></div><blockquote type="cite"><div><div dir="ltr">If you take a look at the car profile, you will see a ferry_mode variable, that sets the travel mode:<br><div><br><a href="https://github.com/Project-OSRM/osrm-backend/blob/8f6fc0146ba76d34d20c5b7a87b75249bbb12b82/profiles/car.lua#L151" target="_blank">https://github.com/Project-OSRM/osrm-backend/blob/8f6fc0146ba76d34d20c5b7a87b75249bbb12b82/profiles/car.lua#L151</a><br><br></div><div>If you set this to 0 (i.e. 'inaccessible") as defined here:<br></div><div><br><a href="https://github.com/Project-OSRM/osrm-backend/blob/8f6fc0146ba76d34d20c5b7a87b75249bbb12b82/data_structures/travel_mode.hpp#L34-L35" target="_blank">https://github.com/Project-OSRM/osrm-backend/blob/8f6fc0146ba76d34d20c5b7a87b75249bbb12b82/data_structures/travel_mode.hpp#L34-L35</a><br><br></div><div>then the extractor discards ferry routes because you marked them inaccessible.<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Nov 11, 2015 at 9:03 AM, Peter Becker <span dir="ltr"><<a href="mailto:floyd.net@gmail.com" target="_blank">floyd.net@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello, i dont want any ferries in my routes. Is this possible?<br>
<br>
_______________________________________________<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.org/listinfo/osrm-talk</a><br>
</blockquote></div><br></div>
</div></blockquote><blockquote type="cite"><div><span>_______________________________________________</span><br><span>OSRM-talk mailing list</span><br><span><a href="mailto:OSRM-talk@openstreetmap.org" target="_blank">OSRM-talk@openstreetmap.org</a></span><br><span><a href="https://lists.openstreetmap.org/listinfo/osrm-talk" target="_blank">https://lists.openstreetmap.org/listinfo/osrm-talk</a></span><br></div></blockquote></div></div></div><br>_______________________________________________<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.org/listinfo/osrm-talk</a><br>
<br></blockquote></div><br></div>