Talk:Key:layer/Archive 1

From OpenStreetMap Wiki
Jump to navigation Jump to search

Message in red, is it about workarounds?

"Do not use this tag to correct some render behaviour and let the output look better.". If someone does it, is that what is called a "workaround"? Logictheo 10:25, 29 August 2008 (UTC)

Yes, e.g. drawing a park inside a lake and making it layer=1 just to have it drawn on the map. In that example the correct way would be to cut a hole in the lake with a multipolygon relation. Alv 10:39, 12 September 2008 (UTC)

Layer

bridge=yes tells us: one thing (street, river) is upper than something tunnel=yes tells us: one thing (street, river) is under than something

Therefore we dont use a "layer"-attribute.

In layer we can read the OSM-Mantra: Do not use this tag to correct some render behaviour and let the output look better.

Bridge with layer=+1 is like animal=white horse+color=white...

--Markus 11:39, 3 September 2008 (UTC)

A tunnel does not go under something, it goes through something. Through the underground, through a hill, through a mountain or even a building. You should not use tunnel to mark a road going underneath a bridge.
A bridge goes over something. Over a field, river, road, an other bridge. The layer tag just tells the render engine to render the lowest layer first and the highest layer last.
--Skratz 14:01, 1 October 2008 (UTC)
No need to repeat that at so many locations, you don't want to have a discussion at different places at the same time, since that's impossible to follow up.
Now, your bridge with layer=1 is more like fruit=banana + color=yellow. Sure, most bananas are yellow, but you can also find them in green or brown, and if someone painted them, in red or purple. Likewise, bridges aren't always at layer 1 either, and tunnels aren't always at layer -1, so that's why we need this tag, since a bridge can well be at layer 0 in some cases, and we then need to enter in the data that road X is higher than road Y, and we've always used layer tags for that.
Also, the mantra you're citing is about doing some tricks with areas for example, where some people add a piece of natural=land in a natural=wood to have a place in the middle of the wood where there are no trees. That line has nothing to do with bridges or tunnels, because layer is giving physical properties of the real-life situation in those cases. --Eimai 12:36, 3 September 2008 (UTC)
For complex motorway junctions, bridges may themselves be bridged. In other circumstances, tunnels may themselves be tunneled under. So bridges can be layer +1, +2, etc. A bridge may go over something which has layer -1, so the bridge would be layer 0 etc. etc. Richard B 12:40, 3 September 2008 (UTC)
Yes Richard, for complex motorway junctions, the layer-concept may help.
But for a normal bridge or tunnel it's nativ how it works:
Bridge is upper
Tunnel is under
For normal cases (>95%?) we dont use a layer-attribut.
Yes Eimai, we have bridges starting on the floor, going up crossing something, and down to the floor. And bridges who connect "floor" to "floor", crossing a valley. And bridges going from a lower "floor" to a higher "floor". - What is in this cases the zero-level?
But we dont need a relativ attribute: each bridge is upper, and crosse something who is under.
In Switzerland there are tunnels like a screw: starting on a lower "floor" and screwing to an upper "floor"...
Yes, I know brown bananas - but (moast) tunnels will be under the bridge, and (moast) bridges will be over the tunnel.
So please lets cancel the "automatic layer"-attribute in connection with bridge or tunnel.
Thanks, --Markus 13:57, 3 September 2008 (UTC)
I don't really understand your problem. Read "layer=1" as "this thing is above anything with layer 0 or lower (and remember that by default everything has layer 0). If your bridge connects two sides over a valley then it's usually just layer 1, except when in that valley you have extra features that have layer 1.
I guess the thing you're proposing here is to automatically assume layer=1 for bridges and layer=-1 for tunnels? That makes sence IMHO. But don't start saying the layer tag is useless, it's obviously not.
For now, there's nothing assuming bridges are layer=1 by default (there are some tricks in mapnik renderers though I think), so telling here that you don't have to use a layer tag on bridges and tunnels isn't exactly how things work. You'll need some discussion on this and some sort of approval first. --Eimai 14:35, 3 September 2008 (UTC)

What kind of approuval do you look for?

Discussion: "Bridge and +1" is a pleonasm, also "tunnel and -1". It makes redundances. We dont need it.

--Markus 17:56, 3 September 2008 (UTC)

Approval means that mappers and renderers start applying the rule. And it's not a pleonasm, as said above several times, a bridge does not imply layer=1. It's layer=1 in most cases, but not all. --Eimai 18:31, 3 September 2008 (UTC)
I totally agree. I think bridges and tunnels are quite fundamental map features and usage recommendations regarding them should be considered more carefully. However, the implied values for those tags have not been subject to voting - or even proper discussion. Isn't it bit too early to actually document these kinds of things? Shouldn't this suggestion be placed under post-vote clean-up chapter on Proposed features page first?
These sort of unapproved radical changes make it unnecessarily hard to create translations. Personally, I hesitate translating them at all. Lazzko 14:02, 12 September 2008 (UTC)

Please see Proposed_features/default_layer_for_bridge_and_tunnel - Set default layer=1 for bridge=yes and layer=-1 for tunnel=yes

Examples

In my small region I have about 100 bridges which are 100% "layer 1" (100% pleonasm). And all tunnels are "layer -1" (100% pleonasm). So please, can you show me some examples with a normal bridge who is not "layer 1"? Thanks, --Markus 21:37, 3 September 2008 (UTC)

I don't know your requirement for a bridge to be normal, but there are plenty of bridges which aren't layer 1, see [1], [2], both near where I live, or go to [3] and have some layer fun :-) --Eimai 10:48, 4 September 2008 (UTC)
It's hardly a big issue to have a few objects tagged in this way. Just remember also how the renderer works. Objects in layer -5 are drawn first. Then objects in layer -4 are drawn on top. Then objects in layer -3 etc. Finally objects in layer +5 are drawn last. That has got to be simpler than requiring the renderers to have filters based on defaults for some objects, and still requiring layer tags for more complicated examples. Remember that bridges might be tagged bridge=yes, bridge=true, or even ones that specify what type of bridge it is, bridge=swing etc.
For what it's worth, data for the UK shows (on ways tagged bridge=yes and bridge=true);
  • 2 bridges with layer=-2 (0.0%)
  • 59 bridges with layer=-1 (0.4%)
  • 22 bridges with layer=0 (0.2%)
  • 12813 bridges with layer=1 (91.7%)
  • 896 bridges with layer=2 (6.4%)
  • 126 bridges with layer=3 (0.9%)
  • 43 bridges with layer=4 (0.3%)
  • 9 bridges with layer=5 (0.1%)
So nearly 10% of all bridges are tagged in a different layer than 1. Tagging something with a layer tag can only be redundant if one implies the other. It clearly does not. Looking at the stats for tunnels in European tagging suggests there are tunnels tagged between layer=3 and layer=-6. Richard B 11:36, 4 September 2008 (UTC)

Hi Eimai, thanks for your nice example. Its famous to see the result of nice rendering! It es a very good example for the exeptions when "layer" is necessary.

But moastly we dont need it. In your example 1: in this zoomlevel there is one crossing three lines together. In the next zoomlevel, there are 8 normal bridges which dont need any supplement keys. In Antwerpen, your example is the only case, who needs a layer. All other bridges (hundreds?) dont need a supplement key. Therefore I vote for canceling this unnecessary pleonasm for all normal bridges and tunnels.

Hi Richard, I'm not a statistician, but I think, before calculating we should check the probe. I suppose, in some of this cases we dont need a supplement key. And a "bridge-0/-1/-2" means something like "tunnel"? Also I'm astonished about bridge+5, do you now a source? Regardless, we can see that we dont need this pleonasm in moast cases. Every bridge implies that she is crossing over. And the renderer (if he has a little bit of intelligence) nows this (and we nows: "not tagging for the renderers"). So much more than 90% of the layer-tags are used redundant.

--Markus 17:10, 4 September 2008 (UTC)

Hmm, bridge -1 & -2 is *not* equal to tunnel. It means simply that it is above an object which has been tagged as layer -2 and -3 respectively. Layer 0 is not necessarily ground level. It all depends on what else might be there and tagged. The data has come from "Tagwatch" - you can see that from a link on the right-hand side on any wiki page about a tag or key. By not tagging for the renderer, we really mean; "don't introduce tagging which is incorrect, just to improve the output of the renderer" - e.g. don't tag things which don't have a vertical separation with layer tags just to improve the output. Whilst we could definitely improve on the renderers - I believe in this case that the current solution is simpler than the proposed solution. Richard B 22:14, 4 September 2008 (UTC)
In my understaning a pleonasm sounds wrong. So we should not use such doubling "to improve the output of some renderers"... As you says... --Markus 23:26, 4 September 2008 (UTC)
It's not animal=white horse+color=white, but animal=horse + horse=andalusian + color=white. Sure, most Andalusian horses are white but being white is unrelated to being Andalusian. Alv 10:43, 12 September 2008 (UTC)
Alv, with your example, you will say: you know simple bridges going under something? In my region all briges goes over something. So "bridge and layer+1" is a pleonasm, we dont need it for normal bridges. (like we dont need for rivers "water=yes" in moast cases). --Markus 18:32, 17 September 2008 (UTC)
If you're going to argument like that... All municipalities in my region belong to the country of Belgium. I therefore now claim that place=city/town/village + is_in=Belgium is a pleonasm. Hence place=city/town/village is sufficient and they should imply is_in=Belgium.
Silly idea? Yes, but you're proposing the same kind of thing.
I have no idea what you have against the layer tag. You're rallying against a tag that was well established at the early beginnings of OSM. --Eimai 19:08, 17 September 2008 (UTC)
Not under, but I do know a bridge on ground level. A motorway was built over a not-so-wet swamp and they decided to build a 470 meter long bridge but keep it real low and then piled some earth on the sides to seal the underside - there's no way under it, even for mice. That bridge was finished in 1970. It's not on osm map, because it's not evident from the landscape, at least not from the motorway and local mappers haven't found it yet. You seem to concentrate on the "not for renderers" clause, but layer information can be useful for other and any uses of osm data. It's not layer=+1 but layer=1, i.e. it's not the relative position ("this is over something") but locally absolute ("this object A is over objects B to E, except object C which is on layer=2") Alv 20:38, 17 September 2008 (UTC)
Hi Eimail, I have nothing against the layer tag. I'm agains useing it in a unnecessaty way as a pleonasm. "We have done it since a long long time" is not a valid argument. "Is-in" I did not now until yet - but it is also unnecessary: the fact is given by the boundary of your county. All included locations are "in". This is a hierachical relation. Layer may be useful for to tag floors in a building? But also here: we have to decide, floor=1 or layer=1 (and not floor=1+layer=1). --Markus 21:45, 17 September 2008 (UTC)
Well, let's not get distracted too much by the is_in tag (I agree it's a bad tag), but nevertheless, look at what you've written: it's unnecessary because you can make a boundary telling that every place in that boundary "is_in=country X". That would be like having a boundary around all bridges with layer=1 telling all bridges inside that boundary have layer=1.
And why do you keep calling it a pleonasm? Repeating it so often won't make it one. We've given enough explanation above why it is not a pleonasm. It might be in a small area where you live, but it's certainly not outside that area. --Eimai 11:58, 18 September 2008 (UTC)
Hi Alv, your 470m-bridge dont need al layer. A bridge is in all (normal) cases over the swamp (if there is not a flood or the piles broken). It does not matter, if the bridge is height=1 or height=100. --Markus 21:45, 17 September 2008 (UTC)

Hi Eimai, its not a good style to delete changes for the better against or without discussion:

Layer we need as raparation for missing altitude in cases of complex constructions (more than one bridge or tunnel). We need layers only for very local situations (never for the general z-dimension).

We do not need layers for areas like forest, water, not for normal (single) bridges, not for normal (single) tunnels. --Markus 15:31, 9 December 2008 (UTC)

So is everything on this page not a discussion then? The reason why I reverted is quite clear: the current practice is to tag every bridge and tunnel with a layer tag. You're trying to modify that so you should come up with a discussion first before changing it. --Eimai 15:40, 9 December 2008 (UTC)

The page does say very clearly that layer=* is not just there to make things render nicely. While it's not strictly necessary to tag everything this way, people do frequently tag it, therefore we should document it as such. It's certainly possible to have e.g. a railway running through a deep cutting (layer -1) over a bridge across a river, with a road bridge above it. You can't assume that something that is on a bridge is above all other features. Chriscf 09:35, 10 December 2008 (UTC)

Hi Chris, your example is good for layer. For "railway crossing street crossing river" we need layer (until we get altitude). We need layer in every case with more then one bridges and/or tunnels. But for normal single bridge we don't need layer.
Since a long time, the Wiki tells wrong things about layer. So all the people does it wrong. But doing wrong things, it's not a license for doing more wrong things, or for telling to others to do the same wrong things. --Markus 14:24, 10 December 2008 (UTC)
Where do you get this idea that specifying a layer value is somehow wrong? While we're at it, where do you get this idea about what constitutes a "bridge" and a "tunnel"? Chriscf 15:17, 10 December 2008 (UTC)
Adding layers for crossing and touching objects with vertical separation (regardless of whether either is a tagged as a bridge) seems to have been a original decision back in September 2006 (the oldest references to it that I could find in the mailing list archives) and documented as such in this wiki since early 2007. I think it's just good practice to keep it as such, or make a proposal to change it and convince all the notable old wizards for changes affecting such initial and long lived decisions. Alv 15:47, 10 December 2008 (UTC)

Layer vs. Height

The layer-concept is not valide, because the relation is not clear.

Much more better will be to add the x/y-coordinate with the geographical hight.

x/y/z-coordinate

--Markus 11:39, 3 September 2008 (UTC)

Since we generally lack the data that tells us at what altitude certain places are (and gps devices showing very inaccurate readings on that anyway -- or gps signals are inaccessible in tunnels for example), we replaced the z-coordinate with our simplified version called "layer". I don't see anything wrong with this. If you like to add height at every node, be my guest, but let's keep the bridges and tunnels situation simple for now and keep the layer for them. --Eimai 12:27, 3 September 2008 (UTC)
It is not possible to "replace" altitude by a local relative codeing like "layer".
It is not possible to map a larger area by "layer".
"Layer" like this is only useful as help-construction for complex under/over/under situations like Tokio-railstation or gaz/water/canalisation/electric-supply in big cities.
I think, "layer" was written for to help to the renderers, if they was not feeded by roules.
We should use the z-coordinate! Moast bridges and tunnels have a written alttitude at (start, middle, end). We can map it like a traffic sign. If there is no sign, we may ask in the gouverment.
--Markus 13:29, 3 September 2008 (UTC)
Let's just say the two can complement each other. You can't tell the height from the layer, and you can't tell the layer from height except when you have nodes every few meters on each way giving the accurate altitude. It may happen one day that we have that altitude data, but for now technology and resources just aren't available to do this. --Eimai 14:07, 3 September 2008 (UTC)

Until we will get the x/y/z-coordinate, we should do it like this:

bridge=yes

or

bridge=yes
+ altitude=###

or - in very complex situations:

bridge=yes
+ altitude=###
+ layer=+3

Then the applications (renderer, routing, etc.) can do their best! --Markus 14:17, 3 September 2008 (UTC)

Most applications do not need to know altitude, but they may need to know whether things are above or below other things. For instance, a routing engine tracking you over a bi-level bridge will need to know that to go in the direction you want to go, you will be driving on the lower deck on layer 1, not the upper deck on layer 2. The fact that the lower deck is 15m above ground is neither here nor there. The simple implication "a bridge is above something" is no good when you are mapping a four-level stack, in which three sets of bridges cross over a single point. It is also no good when mapping London Underground, where Bank/Monument and King's Cross/St. Pancras each have lines running on four levels, all underground. The idea that bridge must have a layer>=0 and a tunnel must have layer<=0 makes sense; that these values must be +1 or -1 does not. Chriscf 15:52, 1 October 2008 (UTC)

Altitude we need for acclivity (biker, car with trailer).

Layer we need as raparation for missing altitude in cases of complex constructions (more than one Bridge or tunnel). --Markus 15:31, 9 December 2008 (UTC)

Rendering Areas and Labels

This is probably mostly an Osmarender issue...

Renderers should ignore the layer key (or, more specifically, don't assume a default "layer=0") for things like landuse/natural areas and motorway junction labels, right? Well, Osmarender doesn't. If there's a tunnel (or other such below-grade item) marked with "layer=-1" inside an area such as "landuse=industrial", that tunnel won't be visible in Osmarender. Also, I've noticed that labels for motorway junctions are rendered as if they are at "layer=0" even if the ways making up the motorway and its links are at some higher level; therefore, the label is drawn behind the road lines.

Solution: Render all "background coloring" type elements as if they are "layer=-infinity", and render all "label" type elements as if they are "layer=+infinity". In the case of using XSLT, this probably is as simple as moving some things to the beginning or end of the template. (I've read a bit about XSLT, but I'm not an expert...)

The alternative is to apply layer tags to these things. But doing so for landuse or natural areas would go against the big rule about the layer key: "Do not use this tag to correct some render behaviour as in just to make the output look better. This tag should only be used for height differences that are real." Adding layer tags to motorway junction nodes sort of makes sense because you're recording the relative height of something real, but what if an exit branches off of a motorway at a point that's under a higher bridge? It's clearly best to have the label appear on the map in front of everything, regardless of what layer the feature itself is on. Vid the Kid 23:08, 13 April 2009 (UTC)

Things to avoid

I propose to remove "Adding a layer results in ways at ground level getting hidden" - just because some renderer is poorly written is not a valid reason to map differently. Valid reason is that generally landuse is not above highways and other features (except already noted "The exception to this rule is where a landuse is indeed above another landuse."). I propose to also remove "As an example, a road or a river which is tagged with layer=-1 may not be rendered when crossing a landuse=forest with an implicit layer=0 tag" (is it even happening in some real renderers?)

"Use the smallest suitable layer value. Simple bridges over a way at ground level should use layer=1, not layer=2." - is there any good reason for this rule? Mateusz Konieczny (talk) 14:21, 6 September 2015 (UTC)

landuse&layer - tweak it as you like but should be probably mentioned that it is nonsense with the exception.
waterway&layer=1 bellow landuse=forest: yes, a common trap for real renderers. Mapsforge suffers it unless data is prepossessed or hacks applied and a few online renderers that I have tried as well.
smallest layer value: convention and layer<=5. Not important but makes life easier for other mappers if people follow conventions. RicoZ (talk) 15:40, 6 September 2015 (UTC)