abrensch / brouter

configurable OSM offline router with elevation awareness, Java + Android
MIT License
476 stars 115 forks source link

Update profiles for new db tags #579

Closed afischerdev closed 1 year ago

afischerdev commented 1 year ago

Since the server works with new database tags we need a profile update. Also add the idea from web-client issue. Lookups.dat is replaced and sql-script updated.

devemux86 commented 1 year ago

Are the new tags usable in the car profiles?

afischerdev commented 1 year ago

@devemux86 Yes, I think so, but I don't have a convertible car for testing.

Please keep in mind #561 is still open.

quaelnix commented 1 year ago

Reformatting the code and changing things at the same time makes it extra hard to read the diff. Please don't do that.


I think the the new penalties: https://github.com/abrensch/brouter/blob/e66468b091506833eb5890656a0ef3a538397ab2/misc/profiles2/fastbike.brf#L239-L242 should be added after this line: https://github.com/abrensch/brouter/blob/e66468b091506833eb5890656a0ef3a538397ab2/misc/profiles2/fastbike.brf#L247

afischerdev commented 1 year ago

@quaelnix

should be added after this line: min 9999

I'm not sure about this. I think min is here to protect the absolut breaking of the lines before and not to stop the calculation. When we place the add penalty behind it could again reach the level of 10000.

quaelnix commented 1 year ago

The idea behind the min 9999 thing is to ensure that all ways below this line are taken into account by the navigation hint generator. If you add new costs on arbitrary way segments above this line you risk breaking this logic.

afischerdev commented 1 year ago

@quaelnix You are right, it works but it brings different result values.

EssBee59 commented 11 months ago

It appears that the way we firstly added the "no_river_penalty" and "no_forest_penalty" can cause irritations:

Example: When "consider_river" was selected, a basic cost was added when no tag found (no river here)

assign no_river_penalty switch consider_river switch estimated_river_class= 3 switch estimated_river_class=1 2 switch estimated_river_class=2 1.5 switch estimated_river_class=3 1 switch estimated_river_class=4 0.5 switch estimated_river_class=5 0.2 switch estimated_river_class=6 0 99 0

Also when no river is found at all on the possible routes, the new routing differed a bit from the original routing without the consider_river option. To avoid irritations with this effect, I now prefer the following (new) logic:

Assuming the minimum costfactor in the profile is 1 1-multiply ALL the cost parameters by 4. (the min costfactor is now 4, but the routing did not change (only the cost-sum changed) 2-change the "no_river_penalty" and "no_forest_penalty" in "river_advantage" and "forest_advantage"

example: assign river_advantage switch consider_river switch estimated_river_class= 0 switch estimated_river_class=1 -1 switch estimated_river_class=2 -1.5 switch estimated_river_class=3 -2 switch estimated_river_class=4 -2.5 switch estimated_river_class=5 -2.7 switch estimated_river_class=6 -3 99 0

It is important to keep the costfactor >= 1, so "-3" should be here the highest possible advantage As recommended, never select "consider_river" and"consider_forest" together.

racebike-verylowtraffic.brf.txt

devemux86 commented 11 months ago

As recommended, never select "consider_river" and"consider_forest" together.

@EssBee59

Are there other combinations of the new tags that we should avoid using together?

EssBee59 commented 11 months ago

My remark about "never---" was not thought functionally but technically: With the new profile version above, selecting "consider_river" and"consider_forest" together could lead to a situation where costfacor is lower than 1 (I had trouble with such a situation in the past with a costfactor = 0.95)

In the following new version (attached below), I added at the beginning of costfactor "max 1 .....", and with that change the "never" can be ignored! To your question: Theoretically no restriction exists on the use of the options. But I did not check the result is, if as example you want river and forest at the same time! For my own, I only use maximum at the same time "consider_elevation" + "consider_traffic" + 1 further consider option.

new version of the profile:

racebike-verylowtraffic.brf.txt

Stapawe commented 11 months ago

As recommended, never select "consider_river" and"consider_forest" together.

@EssBee59

Are there other combinations of the new tags that we should avoid using together?

The averaging effects of adding penalties (examples in the issue mentioned above), by decreasing cost ratios between ways, is the stronger, the bigger penalties are added to the bigger number of ways, so roads without penalties are rare, so it depends on area.