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

Add switch to ignore_cycleway #33

Open
Wizit38 opened this issue Oct 14, 2021 · 6 comments
Open

Add switch to ignore_cycleway #33

Wizit38 opened this issue Oct 14, 2021 · 6 comments

Comments

@Wizit38
Copy link

Wizit38 commented Oct 14, 2021

Hi
I'm trying to add a switch to ignore_cycleway

This is because in Singapore most of our cycleways are non segregated and shared. Their speed limit is 25kmh but at certain times of the day, they are very crowded making it extremely unpleasant to ride. My guess is that cycleways in big cities will face similar issues. With the switch, the tourer can choose to avoid cycleways until outside of town and then switch back to 'normal' routing.

I tried to implement this by adding the following code segment

if ignore_cycleway -> assign hascycleway = false

if ( ignore_cycleway ) then false 
# cycleway in both directions
else if and ( not cycleway= ) ( not cycleway=left|right|no|none|opposite|proposed|unknown ) then true

to replace line 174 of your original code

But it does not seem to work. Any idea why?

(I am testing on cheng san community club to Tuas lamp post 1. The route continues to use the PCN along Ang Mo Kio Ave 6 between Ang Mo Kio Ave 1 & Ang Mo Kio Ave 3 even though I set lefthandtraffic=true. By the way, was the profile supposed to ignore this cycleroute since it is on the opposite side of the road?)

@poutnikl
Copy link
Contributor

poutnikl commented Oct 14, 2021

I would not mix processing cycleroutes and cycleways, the latter either as highway=* cycleway[|left|right]=* either highway=cycleway and rather added a switch ignore_cycleways.

Note that for "feature cycleways", you cannot selectively promote, penalize nor avoid just the cycleway part of the road. All that applies to the whole road package, take it or leave it.

@Wizit38
Copy link
Author

Wizit38 commented Oct 14, 2021

Sorry, but I dont understand. What do you mean?

rather you add a switch ignore_cycleways?
Do you mean I should rename the switch?

Also, what do you mean by your 2nd part?

@poutnikl
Copy link
Contributor

poutnikl commented Oct 14, 2021

Rather point out what you do not understand.

I mean to have 2 switches. For cycleroutes ( marking analogical to hiking routes) and for cycleways ( physical structures )

If a cycleway is mapped as feature of the main road, Brouter considers it as a single road, with priority eventually modified by the cycleway presence. You cannot avoid the side "feature cycleway" without avoiding the main road in the same extent. The major road and the side cycleway share as a single way the common costfactor.

Preferring a road with "feature cycleway" is at the same level like preferring a road with a particular surface or highway=* classification.

It is just semantically assumed you take the side cycleway the major road is featured with.

@Wizit38 Wizit38 changed the title Add switch to ignore_cycleroutes Add switch to ignore_cycleway Oct 14, 2021
@Wizit38
Copy link
Author

Wizit38 commented Oct 14, 2021

Let me see if I understand correctly.
A cycleroute is made up of a collection of cycleways. Is this correct?

In the case of the route that I mentioned, the code segment that I did, was to assign hascycleway false if the switch was set. So I do not understand why brouter is still taking the Ang Mo Kio Park connector cycleway. Did I not code it correctly?

Also, I do not understand why brouter chooses to use the Ang Mo Kio Park connector cycleway since it is on the wrong side of the road. (traffic is on the left hand but the Ang Mo Kio park connector is on the right. I thought the purpose of the lefthandtraffic switch was to have brouter take a cycleway only if it was on the left hand of the road ie same side as traffic)

@poutnikl
Copy link
Contributor

poutnikl commented Oct 14, 2021

No, a cycleroute is NOT a collection of cycleways, even if some or all sections of a cycleroute MAY go along cycleways.

A cycleway is on physical level, a type of a road, independent or integrated. It is marked ( in Europe ) by the traffic sign of the white bicycle on the round dark blue background ( sometimes also with picture of pedestrian if shared ). Or by horizontal bicycle painting for cycleway tracks or lanes.

A cycleroute is on logical level, a road marking for bicycles, like major roads have their marking for cars, or hiking trails have their marking for hikers. It is marked ( in Europe ) by several ways, typically small rectangles or pointing arrows with black bicycle and route number on yellow background .

Cycleroutes can go along all types of OSM highways bicycles are allowed, typically from highway=path to highway=primary.

@utack
Copy link
Owner

utack commented Oct 14, 2021

I will have to think about this a bit more and don't have a quick solution right now
Unfortunately it is a bit more complex, as @poutnikl has hinted already
Currently there is no easy way to do it, It would include a few things

  • Differentiate between cycleways that are lanes and physically separated (track). That is a current weakness of the profile that is not adressed due to it being quite complex I must admit
  • Skip the cost reduction for the maxpeed penalty and the traffic penalty when the cycleway is both not physically separated and considered unpleasant or unsave (a new switch to be added)

These can be seen as two subtasks, and it is maybe a good impulse to finally implement point 1 in my profile

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

3 participants