osmandapp / OsmAnd

OsmAnd
https://osmand.net
Other
4.72k stars 1.03k forks source link

Neutral routing profile for hybrid profiles (Canoe) #20611

Open Jan-NiklasB opened 3 months ago

Jan-NiklasB commented 3 months ago

Describe the idea

As described in #16105 and the ticket referenced there, there is a need for a (base-)profile ignoring the type of vehicle and only using the routing rules.

Expected behaviour

When using the routing settings added after this, the expected behavior, if the startpoint is 53.09693,9.35765 and endpoint is 53.09649,9.35664 , is that the route goes out of the water at the slipping point and back in on the other side after routing over the bridge following the segments tagged with "canoe=portage".

<routingProfile name="Canoe" restrictionsAware="true" minSpeed="1.0" defaultSpeed="2.6" maxSpeed="4.0" onewayAware="true" baseProfile="boat">
        <parameter id="height" name="Height" description="Maximum vehicle height to be permitted on the route" type="numeric" values="0,1.49,1.99,2.49,2.99,3.49,3.99,4.49,4.99,5.49,5.99,6.49,6.99,7.49,7.99,8.49,8.99,9.49,9.99,10.99,11.99,12.99,13.99,14.99,15.99,16.99,17.99,18.99,19.99,20.99,21.99,22.99,23.99,24.99,25.99,26.99,27.99,28.99,29.99" valueDescriptions="-,1.5m,2m,2.5m,3m,3.5m,4m,4.5m,5m,5.5m,6m,6.5m,7m,7.5m,8m,8.5m,9m,9.5m,10m,11m,12m,13m,14m,15m,16m,17m,18m,19m,20m,21m,22m,23m,24m,25m,26m,27m,28m,29m,30m"/>
        <parameter id="width" name="Width" description="Maximum vehicle width to be permitted on the route" type="numeric" values="0,1.49,1.99,2.49,2.99,3.49,3.99,4.49,4.99,5.49,5.99,6.49,6.99,7.49,7.99,8.49,8.99,9.49,9.99,10.99,11.99,12.99,13.99,14.99" valueDescriptions="-,1.5m,2m,2.5m,3m,3.5m,4m,4.5m,5m,5.5m,6m,6.5m,7m,7.5m,8m,8.5m,9m,9.5m,10m,11m,12m,13m,14m,15m"/>
        <parameter id="allow_streams" name="Allow streams" description="Allow streams and drains" type="boolean"/>
        <parameter id="allow_intermittent" name="Allow intermittent" description="Allow intermittent water ways" type="boolean"/>
        <parameter id="allow_portages" name="Allow Portages" description="Allow ways around weirs etc. by foot" type="boolean"/>

        <way attribute="access">

            <if param="allow_portages">
                <select value="1" t="waterway" v="portage"/>
                <select value="1" t="canoe" v="portage"/>
                <select value="1" t="canoe" v="put_in"/>
                <select value="1" t="canoe" v="egress"/>
            </if>

            <select value="-1" t="osmand_change" v="delete"/>

            <select value="-1" t="canoe" v="no"/>
            <select value="1" t="canoe" v="yes"/>

            <if param="allow_intermittent">
                <select value="1" t="intermittent" v="yes"/>
            </if>
            <select value="-1" t="intermittent" v="yes"/>
            <select value="1" t="intermittent" v="no"/>
            <select value="-1" t="waterway" v="dam"/>
            <select value="-1" t="waterway" v="weir"/>
            <select value="-1" t="waterway" v="waterfall"/>

            <select value="-1" t="seamark:bridge:clearance_height_open">
                <gt value1=":height" value2="$seamark:bridge:clearance_height_open" type="length"/>
            </select>
            <select value="-1" t="seamark:bridge:clearance_height">
                <gt value1=":height" value2="$seamark:bridge:clearance_height" type="length"/>
            </select>
            <select value="-1" t="seamark:bridge:clearance_width">
                <gt value1=":width" value2="$seamark:bridge:clearance_width" type="length"/>
            </select>
            <select value="1"  t="waterway" v="river"/>
            <if param="allow_streams">
                <select value="1" t="waterway" v="stream"/>
                <select value="1" t="waterway" v="drain"/>
            </if>
            <select value="1"  t="waterway" v="canal"/>
            <select value="1"  t="waterway" v="tidal_channel"/>
            <select value="1"  t="waterway" v="fairway"/>
            <select value="1" t="waterway" v="boat_lift"/>

            <!-- disable polygon routing to avoid intersection with waterway=fairway -->
            <!-- <select value="1"  t="seamark:type" v="fairway"/>  -->

            <select value="-1"/>
        </way>

        <way attribute="area">
            <select value="1"  t="seamark:type" v="fairway"/>
            <select value="0"/>
        </way>

        <way attribute="oneway">
            <select value="1" t="oneway" v="yes"/>
            <select value="1" t="oneway" v="1"/>
            <select value="-1" t="oneway" v="-1"/>
        </way>

        <way attribute="speed" type="speed">
            <!-- Use same speed everywhere to allow user easier control speed -->
            <!-- <select value="1" t="canoe" value="portage"/> -->
        </way>

        <way attribute="priority">
            <select value="0.6"  t="waterway" v="fairway"/>
            <select value="2"  t="waterway" v="river"/>
            <if param="allow_intermittent">
                <select value="0.5" t="intermittent" v="yes"/>
            </if>
            <if param="allow_streams">
                <select value="1" t="waterway" v="stream"/>
                <select value="0.5" t="waterway" v="drain"/>
            </if>
            <select value="1.3"  t="waterway" v="canal"/>
            <select value="1.5" t="canoe" v="yes"/>
            <select value="1" t="canoe" v="portage"/>
            <!-- <select value="0" t="highway"/> -->
            <select value="0.2"/>
        </way>

        <point attribute="obstacle">
            <select value="-1" t="access" v="no"/>
            <select value="-1"  t="access" v="private"/>
            <select value="0"  t="access" v="yes"/>
            <select value="0"  t="access" v="permissive"/>
            <select value="0"  t="access" v="customers"/>
            <select value="-1" t="waterway" v="dam"/>
            <select value="-1" t="waterway" v="weir"/>
            <select value="-1" t="waterway" v="waterfall"/>
            <select value="-1" t="seamark:bridge:clearance_height_open">
                <gt value1=":height" value2="$seamark:bridge:clearance_height_open" type="length"/>
            </select>
            <select value="-1" t="seamark:bridge:clearance_height">
                <gt value1=":height" value2="$seamark:bridge:clearance_height" type="length"/>
            </select>
            <select value="-1" t="seamark:bridge:clearance_width">
                <gt value1=":width" value2="$seamark:bridge:clearance_width" type="length"/>
            </select>
            <select value="450" t="waterway" v="lock_gate"/>

            <select value="1" t="canoe" v="put_in"/>
            <select value="1" t="canoe" v="egress"/>
            <select value="1" t="leisure" v="slipway"/>

        </point>
        <point attribute="obstacle_time">
            <select value="450" t="waterway" v="lock_gate"/>
            <select value="300" t="canoe" v="put_in"/>
            <select value="300" t="canoe" v="egress"/>
            <select value="300" t="leisure" v="slipway"/>
        </point>

    </routingProfile>

Alternatives you've considered

Trying around with the routing.xml, but nothing seems to work till now.

Context

Guess that isn't only relevant to ships, but also for other vehicles like e.g. amphibious vehicles.

yuriiurshuliak commented 3 months ago

To better understand your request, could you clarify a few points?

Jan-NiklasB commented 3 months ago

I'll try to answer your questions:

  1. Hybrid in this context relates to the kind of vehicle not to the type of engine (so for example amphibious vehicles, kayak-profile which combines boat and walking) so it ignores restrictions to a specific type of path (like a kayak being unable to route over streets)
  2. It's more like a general request so one can restrict this profile to a specific kind of path by by changing the routing xml
  3. I guess this is more or less what I mean
  4. It's more about a neutral profile, which can be customized to your needs
  5. I added the current profile, but I didn't saved every change I tried, as related in my post, this isn't currently possible as it seams