Remove layer tag from LoMaps?

Started by karlchick, October 29, 2023, 13:31:05

0 Members and 1 Guest are viewing this topic.

karlchick

I found that LoMaps include layer=1 but OAM exclude it. I have to say that I have not found layer tags useful, they tend of mess up the rendering and usually seem to correspond to lazy mapping to quick fix lots of errors in osm.

Attached is an example if a cycleway with layer=1, showing lomap and oam maps rendering a highlight of the cycle routes underneath the highways. In this case the embankment is drawn above the highlight for lomap. The theme draws the. In the correct order to avoid this (embankment, highlight, cycleway)... but (I suspect) the layer tag overrides the theme in this case.

I'm not sure what tag transforms OAM is doing here, their documentation only mentions filtering out the layer=-1 for waterways with tunnel set...

Perhaps filter out layer tag on ways that it should not be used on, as per: https://wiki.openstreetmap.org/wiki/Key:layer

Some points from osm documentation that support this:

With some exceptions, layer=* on way ways should be used only in combination with one of tunnel=*, bridge=*, highway=steps, highway=elevator, covered=* or indoor=yes. For area areas, it could be used in combination with tags such as man_made=bridge, special types of building=* and similar.

Roads, railways, waterways etc. should not be tagged with a layer just because they are raised up on an embankment or are in a cutting - use embankment=* and cutting=*, respective waterway=ditch for this purpose.
User id: 62b600722
Author of the OS Map Theme:
DiscussDownload
  •  

john_percy

The difference is that in Lomaps routes are not attached to the original highway, so they don't keep the layer=1 value. In OSM the route remains as a tag on the highway.
Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

voldapet

QuoteThe difference is that in Lomaps routes are not attached to the original highway, so they don't keep the layer=1 value. In OSM the route remains as a tag on the highway.
Exactly...

I know that 'layer' complicates some situations like streams in forest areas etc. But generally, the layer tag is important for bridges, junctions...so instead of removing it, would it be better to add it also for cycling routes?
  •  

karlchick

#3
I don't think I made my point clear enough.

I'm not suggesting removal of the layer tag for ways that are supposed to use it,  eg Bridges. Only for ways that are not supposed to use it... like cycleways for instance. This is defined is the osm guidelines and also copied out in post #1.

When a way has a layer tag applied, the way is drawn under or above other ways (by the mapsforge rendering engine?) with no possibility for the theme to alter this.

In my example I was using routes with cycleway but this is not relevant to the layer tag here... further along the same cycleway is another embankment on the cycleway for which it has no layer tag,  this is drawn as expected,  see attached.

Hence my suggestion layer tag is filtered out for ways that should not use it, as per osm guidelines in first post.
User id: 62b600722
Author of the OS Map Theme:
DiscussDownload
  •  
    The following users thanked this post: john_percy

john_percy

.@voldapet is correct that adding the layer to cycle routes (and hiking routes and MTB routes) is needed in any case.
Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

voldapet

@karlchick
I understand that in this situation the "layer" tag is probably misapplied (as per the instructions). However, I have always tried to avoid manipulating OSM data "from the table" (unless it's necessary)

I really think the best solution is to add a "layer" tag for hike & vike way as well. Please try the following map (not posted in the store). I think it should solve your problems.  https://gofile.me/7ecf2/CVYghVabB

In any case, this is very likely to cause further complications. Mapsforge has an internal limit where a node/path can have a maximum of 15 tags. I know there are already paths with 15 tags and I'm afraid that using a layer tag will exceed this limit. Well, we'll see during the next generation
  •  
    The following users thanked this post: john_percy

john_percy

That works for me, and also improves the rendering of routes over bridges etc., which was problematic with Lomaps.
Voluntary and Velocity themes - https://voluntary.nichesite.org
  •  

freischneider

I don't know much about this. But I have also often read about the limit of 15 tags at OAM.
Maybe several parties would have to write to Mapsforge to extend this limit to 18 or 20 tags.
Poco F5, Xiaomi Redmi Note 10 Pro, Android 13
Locus Map 4 Gold (always latest version)
LM4 User-ID: 11cec7cb5  (Devices-ID poco F5)
  •  

karlchick

#8
Thanks for test map, yes it does fix my issue and improves the bridge for routes. Too (as John pointed out), attached, and now I understand what you mean about adding layer tag... but I do feel the cost of using one of the 15 tags is a little high, and possibly blocks other/future more worthy tags...

I can understand your concern about modifying osm data... although it looks like OAM are doing this already in this case.
User id: 62b600722
Author of the OS Map Theme:
DiscussDownload
  •  

karlchick

I've just noticed that the test map you provided also now exposes natural=saddle, although without (it seems) any direction information. I note that natural=saddle is not listed in the latest tag-mapping file I can find: https://github.com/asamm/lomaps-mapsforge/blob/main/various/tag-mapping-xml/tag-mapping-tourist.xml

Is this a new addition that will in LoMap v4 maps? If so, can we also have direction tag?

I also wonder if adding direction tag, if it could be provided for viewpoints too...
User id: 62b600722
Author of the OS Map Theme:
DiscussDownload
  •  

voldapet

@karlchick I'm sorry, but the map does not include natural=saddle. Maybe there is some OSM element with a combination mountain_pass=yes and natural=saddle but natural=saddle (alone) is not available in the test map even in the latest version.

>I also wonder if adding direction tag, if it could be provided for viewpoints too...
Why not but could I ask you how you work with this tag in your theme, please?
  •  

karlchick

#11
Viewpoints are displayed similar to OS maps, but use a 360 symbol. On OS maps they sometimes use a 180 viewpoint oriented in the direction of the view, see attached.

It's probably just a "nice to have feature", perhaps useful in some instances when exploring new areas via the map, but you can usually figure out which orientation the view is likely to be based on contours...
User id: 62b600722
Author of the OS Map Theme:
DiscussDownload
  •  

voldapet

I can understand what you want to achieve. But the question is if it is really vital.

There are 2 million directional features in OSM, but only 1.5% are combined with an aspect or saddle. Only 2% of the saddle elements also have a direction marker. The situation is better for viewpoints - 11% of viewpoints have a directional marker. I'm just wondering if this is really necessary...

https://taginfo.openstreetmap.org/keys/direction#values
https://taginfo.openstreetmap.org/tags/natural=saddle#combinations
https://taginfo.openstreetmap.org/tags/tourism=viewpoint#combinations
  •  

karlchick

No, I agree, it's not an essential of a map.

The biggest issue for me is the miss-processing bu the map rendering engine for "no" and "yes" values that are common to many different keys.

Another improvement could be if the rendering engine could process multiple categories, e.g. cat="os-25k|os-dyn", it would greatly reduce the size of theme file.
User id: 62b600722
Author of the OS Map Theme:
DiscussDownload
  •  

voldapet

QuoteThe biggest issue for me is the miss-processing bu the map rendering engine for "no" and "yes" values that are common to many different keys.
I'm not sure if I understand it correctly but I guess it's related to this issue https://github.com/mapsforge/mapsforge/pull/1366 and this is already fixed

QuoteAnother improvement could be if the rendering engine could process multiple categories, e.g. cat="os-25k|os-dyn", it would greatly reduce the size of theme file.
@Menion Could I kindly ask you to check how difficult it would be to implement?
  •