power line questions

I have a few questions about the Tag power=line
http://wiki.openstreetmap.org/wiki/Tag:power%3Dline

  1. Layers. Power lines usually are strung up above the ground with towers or poles holding them up. Often they cross roads and other map features. Should power lines typically be given a layer of 1? Should the towers have layer 0 (layer tag omitted) or 1?

  2. Often I see power lines strung up in parallel. If there are sets of towers and lines running next two each other, should each of these be given their own way in the map? Or should this be like a road with multiple lanes which is just modeled as a single way.

Thanks,
Peter
Derry, NH, USA

Personally, I tag lines in parallel as a single way.

With regards to the layer, unless they cross anything that is layered above then layer 1 should suffice.

Unlike bridges, tunnels and other ways in OSM power=line doesn’t seem to need a layer-tag. Perhaps because we assume that there is no other feature running above a power line. Why this assumption doesn’t apply to bridges (is always “above”) and tunnels (is always “below”) I don’t know.

Nothing in the documentation suggests that they don’t need layers. Some renderers might draw them over other features if they don’t have a layer tag, but we don’t tag for some specific renderers, do we?

@PHerison: you can have bridges over bridges. Just look at a reasonably complex traffic interchange. Hence the need for layers.

Yes, if I have more than 2 ways, or 2 bridges (or tunnels), crossing each other, a layer tag is need indeed. But if I have only 2 ways crossing, where on of them has a bridge (or a tunnel)-tag, why do I have to specify the layer? Why does bridge=yes does not implicate “above” and tunnel=yes “below”?

I think we’re getting into the technical realm there. Layer tags are used by the osm2pgsql tool, which is used to import the OSM data into a postgis database for rendering with mapnik. It uses the layer tags to set a z_order field. Then mapnik queries the postgis database with an ‘order by z_order’ to get the ways back in the order to paint them, from lowest layer to highest layer.

If we have 2 crossing bridges or tunnels, without layer tag, the osm2pgsql tool would need to recognize that and add the layer/z_order tag internally. But first it has to recognize such a thing, and it’s not smart enough to do so. I don’t think it ever will be, as it’s not doing anything more than convert the data as it encounters it. It can’t compare ways.

Thanks for all the answers. I think that it makes most sense to give power lines a layer tag. There are also definitely places where we have power lines on top of or below bridges.

As for the parallel power lines question, I think the fact that the nodes in a power line can represent towers would indicate that each tower should be mapped out separately and that the ways are simply connecting the dots between the towers.

More technical stuff:

OSM’s stylesheet for mapnik (osm.xml) draws features in various different layers. Each layer has its own Z-ordering. So between all roads, the layer=* tag makes sense. It doesn’t interact with other layers.

Because powerlines are drawn in another layer, after all roads are drawn, setting a layer=-1 will not make it render under a road or bridge. YMMV.

Very interesting, I didn’t realise that. That’s useful to know, thanks very much. :slight_smile: