OpenStreetMap logo OpenStreetMap

A map of part of London

I have a couple of web maps, and they are supposed to show pedestrian crossings. If there’s some crossing infrastructure (for example - zebra stripes, or tactile paving and a lowered kerb) you’re supposed to see a “crossing” icon. If there are traffic signals associated with the crossing, that icon should be replaced with a “traffic signals” one.

Years ago it was straightforward - you’d get a https://wiki.openstreetmap.org/wiki/Tag:highway=crossing tag on a node on the roadway, and there would be another tag, such as crossing_ref to say what sort of crossing it was. Some crossings (such as pelican, puffin and pegasus) have traffic signals; others (zebra and informal crossings) tend not to.

Unfortunately, it has got a lot more complicated.

Sometimes, the highway tag is crossing;<something> or <something>;crossing. Sometimes that something should be ignored and treated as a crossing.

Some crossings are added with https://wiki.openstreetmap.org/wiki/Tag:crossing=<something> but without any https://wiki.openstreetmap.org/wiki/Tag:highway=crossing tag. Of course I could just look for that, but in addition to https://wiki.openstreetmap.org/wiki/Tag:highway=crossing I now also need to think about https://wiki.openstreetmap.org/wiki/Tag:railway=crossing (and tram_crossing) and handle those separately (in my case, like level crossings). I also need to look for https://wiki.openstreetmap.org/wiki/Tag:disused:highway=crossing and exclude those, even if a crossing tag is set. If highway is set to something that is not crossing, I probably should treat the object as whatever that something is rather than a crossing.

Attributes of crossings are often added with semicolon tags such as crossing:markings, crossing:island, crossing:signals (and for railway crossings crossing:barrier, crossing:bell etc.), and also tags such as crossing_ref (which is still around) and tactile_paving.

Alas, sometimes attributes such as crossing:markings can occur without a crossing tag, and in that case that’s a pretty good indicator that the object with that tag is a crossing. However, what about crossing:island? There’s a whole forum thread about that right now (it actually seems to be sometimes used to tag part of a crossing). In addition, tags such as crossing:markings will have “negative” values (ones that should be treated as if there aren’t crossing markings) and those negative values aren’t always no. Of course, each individual crossing: tag that I am interested in needs to be checked separately.

Once we’ve worked out that there is a crossing here, we need to see if it has traffic signals. That requires checking values in three different tags (crossing, crossing_ref and crossing:signals) and in the case of crossing, that includes some semicolon combinations.

Finally we want to exclude any crossings that we’ve got this far with that don’t really have any infrastructure (not even tactile_paving) - if someone has added https://wiki.openstreetmap.org/wiki/Tag:highway=crossing but then explictly said “there is no infrastructure here” we shouldn’t show it as a crossing, because it isn’t one really.

All in all, that’s about 200 lines of lua.

Surely things don’t need to be that complicated?

Location: Lot's Village, Brompton, Royal Borough of Kensington and Chelsea, Greater London, England, SW10 0PJ, United Kingdom
Email icon Bluesky Icon Facebook Icon LinkedIn Icon Mastodon Icon Telegram Icon X Icon

Discussion

Comment from cquest on 5 November 2025 at 08:23

There is a detailed rendering on pedestrian crossings on the french basemap:

https://demo.addok.xyz/#20/48.80332/2.48515

It also shows tactile paving as well as bollards, but I’m quite sure I do not handle all tags as this as been done 10+ years ago !!

Comment from SomeoneElse on 5 November 2025 at 20:55

@cquest Interesting - is there a link to the tags used anywhere?

Comment from kumakyoo on 17 November 2025 at 16:49

First of all, there is the question, what qualifies as a crossing. It’s easy whenever there are markings or traffic lights. But all the crossings without markings are often difficult to spot: Lowered kerbs? Tactil paving? Island? Is one of that enough to qualify a place for a crossing. And what, if a lot of people cross at that place, but there is nothing visible on the ground? Does this still qualify as a crossing?

What’s next, is the problem with separately mapped sidewalks: In this case, for working pedestrian routing you need crossings at every place, where the street forks or cross. (And the other way round: In the case of attached sidewalks, people assume, that crossing is possible at every place, and there is no way to map if it is actually not possible.)

And: In my oppinion: If one maps a crossing, the main tag ‘highway=crossing’ should always be added. (Some people omit this, when they think, the crossing does not qualify enough for a full crossing, but do not want to map nothing there.)

Comment from SomeoneElse on 17 November 2025 at 22:53

@kumakyoo You can see the code I’m using at https://github.com/SomeoneElseOSM/SomeoneElse-style/blob/master/shared_lua.lua#L7373 , but answering your questions:

Lowered kerbs? Tactil paving? Island? Is one of that enough to qualify a place for a crossing

Yes, I’ll show any of those as a https://wiki.openstreetmap.org/wiki/Tag:highway=crossing.

And what, if a lot of people cross at that place, but there is nothing visible on the ground? Does this still qualify as a crossing?

No, without infrastructure that wouldn’t.

or working pedestrian routing you need crossings at every place

Yes - that’s exactly the point I’ve made at various places in https://community.openstreetmap.org/t/separate-sidewalks-or-not-near-ealing/132613 and similar threads.

If one maps a crossing, the main tag ‘highway=crossing’ should always be added.

I believe that it makes sense to do that too, although there are edge cases where some other highway tag makes sense.

Comment from Pieter Vander Vennet on 24 November 2025 at 21:55

Small note: the link to the github is not a permalink; the linenumber drifted out of sync. This is a permanent (but stale) link: https://github.com/SomeoneElseOSM/SomeoneElse-style/blob/26fca6b352b17b7be36066a13a54a8e17a9f6a28/shared_lua.lua#L7424

Log in to leave a comment