Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

factor brouter pseudo traffic into traffic penalty #26

Open
utack opened this issue Sep 7, 2020 · 1 comment
Open

factor brouter pseudo traffic into traffic penalty #26

utack opened this issue Sep 7, 2020 · 1 comment

Comments

@utack
Copy link
Owner

utack commented Sep 7, 2020

factor in the pseudo traffic tags from brouter for traffic penalty

@Wizit38
Copy link

Wizit38 commented Oct 13, 2021

While waiting for this add, I modified the profile slightly to better handle the traffic situation.

I increased the number of traffic_tier from 4 to 6,

  • splitting tertiary and secondary roads
  • splitting primary and trunk roads

The code segments are as follows:
assign traffic_tier1 0.1 # pedestrian paths
assign traffic_tier2 0.2 # residential roads
assign traffic_tier3 0.4 # Tertiary roads
assign traffic_tier4 0.5 # Secondary roads
assign traffic_tier5 1.0 # Primary roads
assign traffic_tier6 3.0 # Trunk roads /motorways

assign traffic_cost
# many pedestrians but no cars expected
if or and highway=pedestrian ( not segregated=yes )
( highway=platform|corridor )
then traffic_tier1
# anything without motor vehicles is fine
else if not any_motoraccess then 0.0
else if low_traffic then 0.0
# 3+ lanes = lots of expected traffic
else if and ( and oneway=yes|true|1|-1 lanes=3|4|5|6|7 ) ( not hascycleway ) then traffic_tier5
else if and lanes=5|6|7 ( not hascycleway ) then traffic_tier5
# no one likes HGVs (Heavy Goods Vehicle)
else if hgv=designated then traffic_tier5
# wild traffic guesses based on roadtype only
else if not hascycleway then
if highway=motorway|motorway_link|trunk|trunk_link then traffic_tier6
else if highway=primary|primary_link then traffic_tier5
else if highway=secondary|secondary_link then traffic_tier4
else if highway=tertiary|tertiary_link then traffic_tier3
else if highway=residential|mini_roundabout|road|unclassified then traffic_tier2
else 0.0
else if hascycleway then
if highway=motorway|motorway_link|trunk|trunk_link|primary|primary_link|secondary|secondary_link then traffic_tier2
else if highway=tertiary|tertiary_link then traffic_tier1
else 0.0
else 0.0

(By the way, I also increased initialcost_waypreference from 100 to 140 (the route was turning into a tertiary road and then turning back to the same secondary road after a few hundred meters. See cheng san community club to tuas lamp post 1 along tuas south ave 5).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants