Homonymous keys

From OpenStreetMap Wiki
Jump to navigation Jump to search

Some keys serve a different purpose or have a different data type depending on the primary tag of the element. In other cases, a homonymous key may have different semantics when tagged on a node versus a way. These conflicts often arise when "iterative refinement" tagging schemes use words that have homonyms in the English language.

List of homonymous keys


Homonyms in English

Refining the feature versus something tangential to it

  • admin_level=*
    • when used with boundary=* – the administrative level of the boundary itself
    • when used with government=* – the administrative level of the government unit that operates the feature
  • distance=*
  • min_height=*
    • when used with attraction=* – minimum height required to ride the attraction
    • when used with building=* – height above ground level at which the building begins

Containment versus refinement

  • bench=*
  • emergency=*
    • when used as a primary feature tag – the kind of public safety feature
    • when used with highway=* – whether emergency vehicles are allowed
  • junction=*
    • when used as a primary feature tag – whether two or more ways form a junction at the node
    • when used with highway=* – the kind of junction
  • kerb=*
    • when used as a primary feature tag – the kind of kerb
    • when used with crossing=* – whether there is a kerb at either end of the crossing
  • swimming_pool=*

Differing formats

Other nuances

Disadvantages

An editor's developers may find it difficult to implement a field for a key that has a homonym associated with a different preset, especially if the homonymous keys have different data types or acceptable values. iD's fields suggest likely values based on taginfo lists of most common values by key. Since taginfo does not segment these lists by primary feature tag, irrelevant suggestions may appear.

If an element is tagged with multiple feature tags and each feature tag can potentially be used with a different homonym, a renderer or other data consumer may produce inconsistent, nondeterministic, or nonsensical results. For example, if a feature is simultaneously tagged building=yes and attraction=carousel, min_height=* may indicate either the height of the space beneath the carousel (if it sits on an elevated structure) or the minimum height required to ride the carousel. Indeed, every renderer that conforms to the Simple 3D buildings specification inaccurately depicts way 161214224 floating above the ground. A renderer may need to ignore the tag when set to a typical child height, which may be neither desirable nor feasible.

As an extreme example, various uses of type=* had to be deprecated in favor of other keys because it was impossible to indicate the type of a reservoir etc. that is mapped as a multipolygon, which requires type=multipolygon.

Mitigation

Some tagging schemes have made use of namespaces, subkeys, or more descriptive keys to avoid key conflicts. For example, construction=* is now used as a namespace to quality most feature tags; its use as a key only continues with certain feature keys that are unlikely to be tagged on the same feature. aerodrome=* replaced type=* on aeroway=aerodrome features, making it possible to map an airport as a multipolygon relation. man_made=flagpole features are tagged flag:type=* and potentially tower:type=*.

Confusion may still arise despite namespacing. For example, building:condition=* indicates the building's state of (dis)repair, while parking:condition=* indicates the condition that must be satisfied to park.

Some mappers avoid tagging multiple primary feature tags on a single feature, instead mapping multiple features to represent the same physical object. However, this approach can run counter to the "One feature, one OSM element" principle.