janbar / osmin

GPS Navigator On-Road/Off-Road for Android and Linux devices

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enhancement: Add OpenCycle Overlay

magdesign opened this issue · comments

Would be very nice to have OpenCycle Map overlay under Style

https://wiki.openstreetmap.org/wiki/Cycle_routes

In the menu "Configure Map" you can select others styles. The style "outdoor" looks like cycle map. isn't it ?

I does not look like, the paths look more like walkingpaths.

The outdoor view on osmin looks like this:
cycle

Cycling routes are usually in colors and numbered like this:
cyclemap_official

Need to add a new stylesheet (resources/stylesheets/), starting by a copy of outdoor or standard. I have to check if @Karry made already a stylesheet for cycle.

To try on my end, am I right that I would have to change outdoor.oss

and edit from here:

IF cycloRoutes {

cycle_network=*
might be the solution

OpenCycleMap style can be found here:
http://www.thunderforest.com/maps/opencyclemap/
but this looks like a paid project.... see this discussion

Hi guys. It seems to me, that what you want is to distinguish routes with icn=yes (international), ncn=yes (national), rcn=yes (regional) and lcn=yes (local) tags... Not sure how these tags are adopted in different countries. But OSM Scout maps doesn't import this information now. We just distinguish road bike routes and mountain bike routes:

  TYPE route_bicycle
    = RELATION ("type"=="route" AND "route"=="bicycle")
      {Name, Ref, Operator, Network, Color}
      ROUTE

  TYPE route_mtb
    = RELATION ("type"=="route" AND "route"=="mtb")
      {Name, Ref, Operator, Network, Color}
      ROUTE

So first, you would need to extend import definition here: https://github.com/Framstag/libosmscout/blob/master/stylesheets/map.ost#L2376 and then you can start improving stylesheet...

Thanks Karry, by trying to show on the map the needed relation: "network"=="lcn"
image

But updating the ost file to split "route_bicycle" in 3 new types i.e "route_bicycle_lcn", "route_bicycle_ncn" and "route_bicycle_icn" , we have to build new maps.
Instead we could create a new stylesheet "cycle.oss" to highlight route_bicycle (but only one color regardless the network value).

create a new stylesheet "cycle.oss" sounds like a good solution.
I think the color is not very important, but to fetch the number of the cycle route would be great (if possible).

I just want to note, that using multiple style sheets on the same database was one of the main goals of libosmscout. Yes, this requires that the database holds all types required by all style sheets, so adding types are splitting types might be necessary - breaking compatibility.
Note also that while style sheets do not have includes (one could add such feature) you can generate variants (like we do for day/night versions) and one could generate stylesheets from modular "snippets" .
Using such technics, one could generate multiple stylesheets with individual specializations or layers from base styles.
Storing the stylesheets in the upstream libosmscout projects has the advantage that they can reuse between applications and that we can test such stylesheets,
IF you are missing visualization primitives, please make a ticket :-)

Yes it is possible to fetch the number. In my previous preview I printed the network.name. Instead we can print the ref.name which is the number.
I think to start from the winter-sports.oss to create the cycle.oss.

What is actually missing in the outdoor map? Outdoor style shows cycle route "ref" already ... ROUTE.TEXT {label: Ref.name I am not against new specialized cycle map, just curious about your requirements. I love road cycling and outdoor style (originally created by Vlad, I just added routes on top of it) is enough for me usually.

But updating the ost file to split "route_bicycle" in 3 new types i.e "route_bicycle_lcn", "route_bicycle_ncn" and "route_bicycle_icn" , we have to build new maps.

It is not so big issue IMO, I rebuild whole world monthly usually. Question is if this "cycle network hierarchy" brings some additional information to the user. In Czech, route quality and infrastructure around it is the same usually...

And speaking about updating stylesheet, you know StyleEditor, right? :-)

I post a stylesheet "cycle.oss" for road cycle (no mountain bike).

cycle.zip

@Karry , the outddor map is right for me. I guess @magdesign would like a stylesheet for bike path only. The joined oss file should resolve the need. (build with StyleEditor :-) ).

@Framstag, yep I will make a PR to add a new stylesheet for cycle, if we resolve the issue ;)

Looks nice :-) Just route labels are poorly visible. And it would be great to see international routes even on low zoom...

@Karry , I updated the style, but attributes are limited for a path text.
cycle.zip

I have now added includes to OST and OSS files (using 'MODULE ""' syntax). I added some sample modules, but do not have plans myself to further modularize current styles. I suggest you to team up with @Karry for experiments in this area. Together with the already implemented conditionals, this should help to add more variants of style easily. It may also help with #10. Note that I had to increase the NDK version (for the also new use for std::filesytem).

Have fun :-)

Yes 💯
This is what I was missing... thank you all for this awesome work.

Just updated the wiki on this.