wiki:Presets/UnitedKingdomAddresses

Version 4 (modified by achadwick, 2 years ago) ( diff )

Support either the global addr:place schema (by default), and permit the Wiki's addr:substreet schema too (but make it clear it's weird)

United Kingdom addresses preset

These presets allow convenient use of the UK-specific addressing tags described in https://wiki.openstreetmap.org/wiki/Addresses_in_the_United_Kingdom

The icons are my own work, and are hereby released into the public domain. As the icons are 16x16 low-detail representations of well-known and commonly available items used on paper envelopes, no infringement upon the trade marks or copyrights of The Royal Mail Group Limited or its subsidiaries is intended or could reasonably be inferred from their use in map editing software or otherwise. No sponsorship or endorsement is implied, or would be accepted.

Usage

The main UK Address preset covers all the accepted tags for tagging. There's a second preset that can be use for migrating tags that are deprecated in the UK to better accepted alternatives in the UK schema.

The preset itself

<?xml version="1.0" encoding="UTF-8"?>
<presets xmlns="http://josm.openstreetmap.de/tagging-preset-1.0"
  author="achadwick"
  description="United Kingdom addresses"
  shortdescription="UK Addresses"
  version="1.11_2025-08-06"
>

  <chunk id="premises">
    <optional text="Premises">
      <!-- Sub-building name -->
      <text key="addr:unit"
        text="Single Unit (&quot;Flat 1&quot;, &quot;Unit B&quot;, &quot;17&quot;)"
        match="key"
      />
      <text key="addr:flats"
        text="Multiple Units (e.g. &quot;3-7;10;14;16-18&quot;)"
        match="key"
      />
      <!-- Building name/number -->
      <text key="addr:housename"
        text="Building Name"
        match="key"
      />
      <text key="addr:housenumber"
        auto_increment="-2,-1,+1,+2"
        text="Building Number"
        match="key"
      />
    </optional>
  </chunk>

  <chunk id="thoroughfare-place">
    <optional text="Thoroughfare. Valid combinations: A, B, A+C, B+C, &lt;none&gt;">
      <!--
      For this schema, A+B is globally forbidden.
      That's fine though. We have addr:parentstreet when A is needed.
      -->
      <text key="addr:place"
        use_last_as_default="true"
        text="A: non-Street grouping"
        match="key"
      />
      <text key="addr:street"
        use_last_as_default="true"
        text="B: Street (actual or child)"
        match="key"
      />
      <text key="addr:parentstreet"
        use_last_as_default="true"
        text="C: Street (parent, if required)"
        match="key"
      />
    </optional>
  </chunk>

  <chunk id="thoroughfare-substreet">
    <optional text="Thoroughfare ('substreet' schema). Combinations: A, B, A+B, B+C, &lt;none&gt;">
      <!--
      For this schema, A+C is counterproductive: you *should* use street if permitted
      -->
      <text key="addr:substreet"
        use_last_as_default="true"
        text="A: non-Street grouping"
        match="key"
      />
      <text key="addr:street"
        use_last_as_default="true"
        text="B: Street (actual)"
        match="key"
      />
      <text key="addr:parentstreet"
        use_last_as_default="true"
        text="Street (parent, if required)"
        match="key"
      />
    </optional>
  </chunk>

  <chunk id="locality">
    <optional
      text="Locality. Subareas include hamlets/villages/towns/suburbs. One intermediate max."
    >
      <text key="addr:suburb"
        use_last_as_default="true"
        text="Optional: Subarea (of Post Town)"
        match="key"
      />
      <text key="addr:hamlet"
        use_last_as_default="true"
        text="Rare: Intermediate (if hamlet)"
        match="key"/>
      <text key="addr:village"
        use_last_as_default="true"
        text="Rare: Intermediate (if village)"
        match="key"
      />
      <text key="addr:town"
        use_last_as_default="true"
        text="Rare: Intermediate (if town)"
        match="key"
      />
      <text key="addr:city"
        use_last_as_default="true"
        text="Required: Post Town (or city)"
        match="key"
      />
      <space />
      <text key="addr:postcode"
        use_last_as_default="true"
        text="Postcode"
        match="key"
      />
    </optional>
  </chunk>

  <group name="Annotation">

    <!-- UK address -->
    <item name="UK Address"
      preset_name_label="true"
      icon="stamp1-16.svg"
      icon_size="48"
      type="node,way,closedway,multipolygon"
      match_expression='"addr:"*=* -("addr:substreet"=*)'
    >
      <link href="https://wiki.openstreetmap.org/wiki/Addresses_in_the_United_Kingdom"/>
      <reference ref="premises"/>
      <reference ref="thoroughfare-place"/>
      <reference ref="locality"/>
    </item>

    <item name="UK Address (UK-specific addr:substreet schema)"
      preset_name_label="true"
      icon="stamp1-16.svg"
      icon_size="48"
      type="node,way,closedway,multipolygon"
      match_expression='"addr:substreet"=* -("addr:place"=*)'
    >
      <link href="https://wiki.openstreetmap.org/wiki/Addresses_in_the_United_Kingdom"/>
      <reference ref="premises"/>
      <reference ref="thoroughfare-substreet"/>
      <reference ref="locality"/>
    </item>

    <!-- Addresses with tags and combinations that are deprecated in the UK -->

    <item
      name="UK Address: Deprecated place+substreet combination"
      preset_name_label="true"
      icon="stamp3-16.svg"
      icon_size="48"
      type="node,way,closedway,multipolygon"
      match_expression='"addr:substreet"=* AND "addr:place"=*'
    >
      <label text="addr:place must not be used together with addr:substreet: their meanings overlap."/>
      <label text="To fix this, pick one of the schemas below."/>

      <reference ref="thoroughfare-place"/>
      <space/>
      <item_separator />
      <reference ref="thoroughfare-substreet"/>
    </item>

    <item
      name="UK Address: Tags to Avoid"
      preset_name_label="true"
      icon="stamp2-16.svg"
      icon_size="48"
      type="node,way,closedway,multipolygon"
    >
      <link href="https://wiki.openstreetmap.org/wiki/Addresses_in_the_United_Kingdom#Tags_to_avoid"/>

      <optional text="Avoid: too vague, or they duplicate approved tags">
        <text key="addr:terrace"
          text="Terrace [1]"
          match="key"
        />
        <text
          key="addr:locality"
          text="Locality [2]"
          match="key"
        />
        <text
          key="addr:site"
          text="Site [1]"
          match="key"
        />
      </optional>

      <optional text="Avoid: the UK doesn't have these administrative area types">
        <text key="addr:subdistrict"
          text="Sub-district [2]"
          match="key"
        />
        <text key="addr:province"
          text="Province"
          match="key"
        />
        <text key="addr:state"
          text="State"
          match="key"
        />
      </optional>

      <optional text="Not needed: OSM admin boundaries are sufficient">
        <text key="addr:district"
          text="Local Authority"
          match="key"
        />
        <text key="addr:county"
          text="County"
          match="key"
        />
        <text key="addr:country"
          text="Country"
          match="key"
        />
      </optional>

      <!--
        Make it easier to replace deprecated tags with accepted ones
        by putting the most common accpeted alternatives here.
      -->

      <optional text="Hint: consider replacing [1]s and [2]s above with…">

        <text key="addr:substreet"
          use_last_as_default="true"
          text="[1] Non-Street grouping"
          match="none"
        />

        <text key="addr:suburb"
          use_last_as_default="true"
          text="[2] Subarea of Post Town"
          match="none"
        />

        <space />

        <preset_link
          preset_name="UK Address"
          text="Or use one of the accepted tags from the full list:"
        />
      </optional>

    </item>

  </group>
</presets>

Presets_UnitedKingdomAddresses-preset.xml, Presets_UnitedKingdomAddresses.zip

Attachments (3)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.