Homonymous keys

From OpenStreetMap Wiki
(Redirected from Homonymous key)
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.

Causes

These conflicts have multiple causes, depending on the nature of the incompatibility. See the list below for details.

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.

List of homonymous keys

Due to the ever-changing nature of OSM (see any tags you like), this list will always be incomplete; however, please help document these namespace collisions whenever you encounter them.

Homonyms in English

These conflicts arise when "iterative refinement" tagging schemes use words that have homonyms in the English language:

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
  • brewery=* – whether the establishment is or has a brewery, or the name of the brewery that supplies beer to the establishment
  • highway=*
    • when used as a primary feature tag – the road/path classification (e.g., highway=motorway), or a piece of road furniture closely associated with a road (e.g., highway=bus stop)
  • model=*
    • when used with shop=model – the variety of hobby models or kits sold (discussed but not documented)
    • when used with various primary feature tags (such as man made=street cabinet) – the model name or number of the feature itself
  • school=*
    • when used with amenity=school – the type or level of instruction given at the school
    • when used with route=* – whether a route is intended to transport students (e.g., a school bus route)

Containment versus refinement

These conflicts often arise when a crude tagging scheme is established before a more granular micromapping technique is introduced later on:

  • emergency=*
    • when used as a primary feature tag – the type of public safety feature
    • when used with barrier=* or highway=* – whether emergency vehicles are allowed
    • when used with amenity=hospital — whether the hospital offers emergency care
  • junction=*
    • when used as a primary feature tag – whether two or more ways form a junction at the node
    • when used with highway=* – the type of junction
  • kerb=*
    • when used as a primary feature tag – the type of kerb
    • when used with crossing=* – whether there is a kerb at either end of the crossing (and optionally also what type of kerb it is)

Incompatible formats

These conflicts arise due to "iterative refinement" tagging schemes:

  • network=*
    • when used with amenity=atm, amenity=bicycle_rental – the name of an organization that coordinates operation in various locations
    • when used with route=road;bus;train etc. – an identifier for a coherent system of routes, typically based on the containing region's region code
    • when used with route=bicycle;hiking;mtb etc. – the route's scope and mode of transportation
    • when used with type=network – the route's scope and/or mode of transportation

Other nuances

  • type=*
    • when used on a relation – the technical type of relation
    • when used with various primary feature tags – the type of aerodrome, reservoir, tree, etc.

Homonymous roles

Some relation types also document roles inconsistently, with similar consequences for editors and data consumers:

See also