Skip to content

add hazard=* tag for highways#1776

Merged
tyrasd merged 3 commits intoopenstreetmap:mainfrom
aaei924:hazard
Jan 13, 2026
Merged

add hazard=* tag for highways#1776
tyrasd merged 3 commits intoopenstreetmap:mainfrom
aaei924:hazard

Conversation

@aaei924
Copy link
Copy Markdown
Contributor

@aaei924 aaei924 commented Oct 24, 2025

Description, Motivation & Context

By this field, iD editor allows people to map hazard=* key on highway features easily. hazard=* is for boundary and highway, but currently iD tagging schema supports hazard key only for boundary. This PR adds hazard key support also for highways. This single key has been divided into hazard_boundary.json and hazard_highway.json files, because the key has different values depending on features.

This tag has been approved by proposal procedure.

Related issues

Links and data

Relevant OSM Wiki links:

  • key:hazard: You can find Wiki page for each values in this page.

Relevant tag usage stats:

https://taginfo.openstreetmap.org/keys/hazard

Checklist and Test-Documentation Template

Read on to get your PR merged faster…

Follow these steps to test your PR yourself and make it a lot easier and faster for maintainers to check and approve it.

This is how it works:

  1. After you submit your PR, the system will create a preview and comment on your PR:

    🍱 Your pull request preview is ready.
    If this is your first contribution to this project, the preview will not happen right away but requires a click from one of the project members. We will do this ASAP.

  2. Once the preview is ready, use it to test your changes.

  3. Now copy the snippet below into a new comment and fill out the blanks.

  4. Now your PR is ready to be reviewed.

## Test-Documentation

### Preview links & Sidebar Screenshots

<!-- Use the preview to find examples, select the feature in question and **copy this link here**.
     Find examples of nodes/areas. Find examples with a lot of tags or very few tags. – Whatever helps to test this thoroughly.
     Add relevant **screenshots** of the sidebar of those examples. -->

<!-- FYI: What we will check:
     - Is the [icon](https://github.com/ideditor/schema-builder/blob/main/ICONS.md) well chosen.
     - Are the fields well-structured and have good labels.
     - Do the dropdowns (etc.) work well and show helpful data. -->

### Search

<!-- **Test the search** of your preset and share relevant **screenshots** here.
     - Test the preset name as search terms.
     - Also test the preset terms and aliases as search terms (if present). -->

### Info-`i`

<!-- **Test the info-i** for your fields and preset and share relevant **screenshots** here.
     The info needs to help mappers understand the preset and when to use it.
     [Learn more…](https://github.com/openstreetmap/id-tagging-schema/blob/main/CONTRIBUTING.md#info-i)
 -->

### Wording

- [ ] American English
- [ ] `name`, `aliases` (if present) use Title Case
- [ ] `terms` (if present) use lower case, sorted A-Z
<!-- Learn more in https://github.com/openstreetmap/id-tagging-schema/blob/main/GUIDELINES.md#2-design-the-preset -->

@tordans
Copy link
Copy Markdown
Collaborator

tordans commented Oct 25, 2025

This single key has been divided into hazard_boundary.json and hazard_highway.json files, because the key has different values depending on features.

I don't see anything about hazard_boundary in the changes, though.

@github-actions
Copy link
Copy Markdown

🍱 Your pull request preview is ready

Please use this preview to check your changes. Ideally use the test documentation template and document your test results by commenting on the PR. This will speed up the review process for everyone.

FYI, once this PR is merged, you can use the iD Editor Preview to test your changes in interaction with all other changes.

@tordans
Copy link
Copy Markdown
Collaborator

tordans commented Oct 25, 2025

@aaei924 the examples at https://wiki.openstreetmap.org/wiki/Proposal:Hazard#Examples all show a combination of tags … but different tags. Mostly traffic_sign, but also boundary, landuse. This PR does not handle any relation to other tags. Is the established practice to just use the hazard key on highway=* without addition?

Another thing I wonder is, that https://wiki.openstreetmap.org/wiki/Key:hazard#Traffic_hazards does not promote tagging the road way too much. Tagging the traffic sign itself is mentioned instead.

And TBH, I wonder why we would want to promote tagging the road way given that those signs are super hard to tag on a way: The have a start but usually not an "end" sign, so one has to come up with a length without being able to verify it. And once we split the road, the sign is copied which would suggest a new traffic_sign object that is not there. We have that same issue with maxspeed of course, but those have a better start and end definition or signage.

So personally I am not convinced we would want those tags to be promoted on ways. Rather having more traffic_sign=* + hazard=* nodes as a vertex or next to the road.

@tordans
Copy link
Copy Markdown
Collaborator

tordans commented Oct 25, 2025

On a technical note, there are some highway classes missing like trunk_link. But lets first talk about the general idea.

@tordans tordans added waitfor-discussion a discussion in the osm community (e.g. a tag proposal) is required before this can be worked on add-field add existing field to more entries, for field creation see new-field new-field create a new field (see add-field for cases where field from presets is added to new entries) and removed add-field add existing field to more entries, for field creation see new-field labels Oct 25, 2025
@1ec5
Copy link
Copy Markdown
Contributor

1ec5 commented Oct 25, 2025

At least in the Americas, warning signs of all sorts can come with “Next X Miles” or “Next X km” plaques. To the contrary, I couldn’t imagine tagging hazard=curve on just a vertex along the roadway, since the extent of the curve is plainly visible and the warning is usually tied to an advisory speed (maxspeed:advisory=*).

Copy link
Copy Markdown
Collaborator

@matkoniecz matkoniecz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be clearly about signed hazards, as https://wiki.openstreetmap.org/wiki/Key:hazard mentions

not about subjective rating

if actual tagging degenerated into subjective ratings it must not be promoted by iD

Comment thread data/fields/hazard_highway.json
Comment thread data/fields/hazard_highway.json Outdated
Co-authored-by: Tobias <t@tobiasjordans.de>
@aaei924 aaei924 requested a review from matkoniecz October 26, 2025 20:17
@aaei924
Copy link
Copy Markdown
Contributor Author

aaei924 commented Oct 26, 2025

@aaei924 the examples at https://wiki.openstreetmap.org/wiki/Proposal:Hazard#Examples all show a combination of tags … but different tags. Mostly traffic_sign, but also boundary, landuse. This PR does not handle any relation to other tags. Is the established practice to just use the hazard key on highway=* without addition?

Another thing I wonder is, that https://wiki.openstreetmap.org/wiki/Key:hazard#Traffic_hazards does not promote tagging the road way too much. Tagging the traffic sign itself is mentioned instead.

And TBH, I wonder why we would want to promote tagging the road way given that those signs are super hard to tag on a way: The have a start but usually not an "end" sign, so one has to come up with a length without being able to verify it. And once we split the road, the sign is copied which would suggest a new traffic_sign object that is not there. We have that same issue with maxspeed of course, but those have a better start and end definition or signage.

This tag on highway is seemed to have been intended to use with traffic_sign=* tags.

Many hazard signs even don't have any explicit end sign, but in some cases, for example, most of hazard=school_zone signs in Korea have their end sign on the road. We had better add this tag on ways only in cases we can find out where they start and end. If we don't know where the end point is, just placing a node and applying hazard tag may be encouraged.

@1ec5
Copy link
Copy Markdown
Contributor

1ec5 commented Oct 26, 2025

Even if a warning sign doesn’t come with an explicit distance, it often still has a natural start and end because the same sign is posted as you approach from either direction. (This only applies to two-way roads, of course.) I think users would be able to figure that out themselves, but if not, the help text from the data item could suggest the right method.

Comment thread data/fields/hazard_highway.json Outdated
Comment thread data/fields/hazard_highway.json Outdated
Copy link
Copy Markdown
Collaborator

@matkoniecz matkoniecz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Descriptions at https://wiki.openstreetmap.org/wiki/Tag:hazard=dangerous_junction and other tag pages should also be fixed

right now it looks like permitting 100% subjective tagging

while https://wiki.openstreetmap.org/wiki/Key:hazard is clear that it is about signed hazards on roadways

@matkoniecz

This comment was marked as resolved.

@aaei924
Copy link
Copy Markdown
Contributor Author

aaei924 commented Oct 27, 2025

Descriptions at https://wiki.openstreetmap.org/wiki/Tag:hazard=dangerous_junction and other tag pages should also be fixed

right now it looks like permitting 100% subjective tagging

while https://wiki.openstreetmap.org/wiki/Key:hazard is clear that it is about signed hazards on roadways

@matkoniecz I've just edited that wiki page. I clarified that the tag is only used when there's a traffic sign.

@aaei924 aaei924 requested a review from matkoniecz October 27, 2025 14:40
Copy link
Copy Markdown
Collaborator

@matkoniecz matkoniecz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

note "and other tag pages should also be fixed"

I checked random one - https://wiki.openstreetmap.org/wiki/Tag%3Ahazard%3Dchildren and it is also missing info that it is valid only for signed hazards

other value pages also should be fixed

@matkoniecz
Copy link
Copy Markdown
Collaborator

Is anyone planning to fix documentation?

@matkoniecz matkoniecz added waitfor-documentation documentation about this tag is missing in the OSM wiki and removed waitfor-discussion a discussion in the osm community (e.g. a tag proposal) is required before this can be worked on labels Dec 8, 2025
@aaei924
Copy link
Copy Markdown
Contributor Author

aaei924 commented Dec 17, 2025

Is anyone planning to fix documentation?

I changed all documents of approved values at traffic hazards. It's good to proceed.

@aaei924 aaei924 requested a review from matkoniecz December 17, 2025 06:59
@matkoniecz matkoniecz removed the waitfor-documentation documentation about this tag is missing in the OSM wiki label Jan 13, 2026
@tyrasd tyrasd merged commit a905680 into openstreetmap:main Jan 13, 2026
5 checks passed
@aaei924 aaei924 deleted the hazard branch January 16, 2026 20:13
@matkoniecz matkoniecz changed the title add hazard=* tag for highways add hazard=* tag for highways Mar 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

new-field create a new field (see add-field for cases where field from presets is added to new entries)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants