# Directions: Prefer cycle\_highways

**URL:** https://ask.openrouteservice.org/t/directions-prefer-cycle-highways/2168
**Category:** openrouteservice
**Created:** [October 8, 2020, 9:37am UTC](https://ask.openrouteservice.org/t/directions-prefer-cycle-highways/2168 "2020-10-08T09:37:55Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Wouter\_Waeytens](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/wouter_waeytens/32/771_2.png) [@Wouter\_Waeytens](https://ask.openrouteservice.org/u/Wouter_Waeytens)
#### Post date: [October 8, 2020, 9:37am UTC](https://ask.openrouteservice.org/t/directions-prefer-cycle-highways/2168/1 "2020-10-08T09:37:55Z")

</div>

Hi

For a client we are looking into building a routing service specific for cycling.  
In Belgium there are a few cycle\_highways they are inputted in OSM.  
[https://wiki.openstreetmap.org/wiki/WikiProject\_Belgium/Conventions/Cycle\_Routes](https://wiki.openstreetmap.org/wiki/WikiProject_Belgium/Conventions/Cycle_Routes)  
And tagged with “cycle\_network=cycle\_highway”  
[https://wiki.openstreetmap.org/wiki/Tag:cycle\_network%3Dcycle\_highway](https://wiki.openstreetmap.org/wiki/Tag:cycle_network%3Dcycle_highway)

Is there any way get the best route preferring the segments tagged with cycle\_highways?

Thx

---

<div class="post-metadata">

### Author: ![HendrikLeuschner](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/hendrikleuschner/32/509_2.png) [@HendrikLeuschner](https://ask.openrouteservice.org/u/HendrikLeuschner)
#### Post date: [October 12, 2020, 8:39am UTC](https://ask.openrouteservice.org/t/directions-prefer-cycle-highways/2168/2 "2020-10-12T08:39:58Z")

</div>

Hi,  
currently this tagging is not used for the bike routing. We do have a _recommended_ setting for the bike routing, which will return a route optimized with regards both to speed and usability of roads for bikes. But that specific tag is not used. If you have the time and knowledge, you could adapt the process and add this tag to it?

Cheers

---

<div class="post-metadata">

### Author: ![Wouter\_Waeytens](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/wouter_waeytens/32/771_2.png) [@Wouter\_Waeytens](https://ask.openrouteservice.org/u/Wouter_Waeytens)
#### Post date: [October 12, 2020, 9:01am UTC](https://ask.openrouteservice.org/t/directions-prefer-cycle-highways/2168/3 "2020-10-12T09:01:18Z")

</div>

Hi

We are willing to invest some time, but have little to none experience in OSM & ORS.  
Can you point us in the right direction? Is there a basic guide on how to start on this?

Thx

---

<div class="post-metadata">

### Author: ![HendrikLeuschner](https://ask.openrouteservice.org/user_avatar/ask.openrouteservice.org/hendrikleuschner/32/509_2.png) [@HendrikLeuschner](https://ask.openrouteservice.org/u/HendrikLeuschner)
#### Post date: [October 12, 2020, 9:32am UTC](https://ask.openrouteservice.org/t/directions-prefer-cycle-highways/2168/4 "2020-10-12T09:32:23Z")

</div>

I can point you in a direction, but a guide I cannot really offer. I think if you are willing to invest some development time, you need to start by setting up your own small openrouteservice instance. As ORS is in some ways an extension of Graphhopper (GH), you will need this one as well.  
The basics of what you want to achieve can be done like this (from a quick look into it):  
The tags from the OSM file are read in the `OSMReader` class:

```auto
if (!relation.isMetaRelation() && relation.hasTag("type", "route"))
                        prepareWaysWithRelationInfo(relation);

```

This will call the `encodingManager`, which will be the `BikeFlagEncoder`. In this one, you will have to translate the relations that compromise the `cycle_network` types into values for ways. This might be a bit complicated. The basic problem is that as far as I can tell, the tag you are looking for is a `relation`, but we need the tag to be applied for all the `way`s that it corresponds to.  
Afterwards, you can add the tag to the `preferHighwayTag` field in the `BikeFlagEncoder` constructor.  
This will make cycleways preferred, in the same way as residential roads etc are preferred.  
If you want even “more” preferred, you will need to create an additional category like the `preferHighwayTag` and then assign it a preference value in `BikeCommonFlagEncoder.collect`.

I am aware that this is not an easy and quick process, sadly.  
Let me know if you need some additional help.

Cheers  
Hendrik
