wiki:Presets/UnitedKingdomAddresses

United Kingdom addresses preset

These presets allow convenient use of the UK-specific addressing tags described in the OSM wiki. The UK has a somewhat odd arrangement of Premises, Thoroughfare, and Locality (and Postcode) where the Thoroughfare is sometimes 2-level, and the Locality is sometimes 3-level. In response, the UK OSM community has come up with two mutually exclusive, competing schemas, both of which are implemented here with a slight favour for the trickier but globally accepted schema using "addr:place".

These presets also contain a number of dialogs to help mappers avoid deprecated combinations, and several tags which have been pointed out by the community as tags to avoid (for example, because the UK doesn't have a particular level in the administrative hierarchy).

Installation

In JOSM: install it from the Presets → Preset Preferences... menu. It shows up as "UK Addresses (by achadwick)" in the left-hand list. Click the arrow to transfer it to your list of installed presets, on the right.

These presets make heavy use of chunk, reference, and match_expression. They may not work outside JOSM.

How to use these presets

Presets for acceprted UK address tagging schemas

Note that there is disagreement within the community over how to represent addresses with both Thoroughfares and Dependent Thoroughfares (in Royal Mail terminology). Until consensus is reached, this preset bundle presents both of the typical schemas used, on a mutually exclusive basis, but considers them equally valid. Your best bet is to add one of the "green stamp" approved presets to your toolbar, and stick with it.

  • UK Address: approved worldwide schema
    • Use this for tagging addresses in the United Kingdom, in envelope order.
    • The wiki page mentions this schema, but suggests the one below. Not everyone agrees with this editing decision.
    • These presets marginally favour this approach,
    • This preset uses only globally-approved OSM tags.
  • UK Address: accepted regional schema
    • Use this for tagging addresses in the United Kingdom, in envelope order.
    • The wiki page favours this schema, but not everyone agrees since it has to use a UK-specific tag for dependent thoroughfares.
    • For now it is treated as equally valid.

Helper presets for fixing deprecated/unaccepted tags

The bundle contains a small number of additional preset dialogs for migrating tags and combinations that are deprecated or not widely accepted in the UK to better accepted alternatives.

  • UK Address: tags to avoid
    • Visible if you have used certain addr:* tags which the community has suggested are best avoided.
  • UK Address: deprecated place+street combination
    • Either schema.
    • You cannot use addr:place together with addr:street because their meanings overlap
  • UK Address: deprecated place+substreet combination
    • Region-specific schema only.
    • You cannot use addr:place together with addr:substreet because their meanings overlap.

The markers for these will only appear in the sidebar if you use the deprecated combination. Click the marker, and the preset's dialog will offer suggestions for fixing the error.

XML definition

This is what's served to JOSM. Be careful when editing it.

<?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"
  icon="stamp1-16.svg"
  version="1.10_2024-07-22"
>

  <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="C: 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: approved worldwide schema"
      preset_name_label="true"
      icon="stamp1-16.svg"
      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: accepted regional schema"
      preset_name_label="true"
      icon="stamp1-16.svg"
      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"
      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="Both of these tags are used when addresses are grouped by something other than a street." />
      <label text="To fix this problem, use only one of the schemas below."/>

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

    <item
      name="UK Address: deprecated place+street combination"
      preset_name_label="true"
      icon="stamp3-16.svg"
      type="node,way,closedway,multipolygon"
      match_expression='"addr:place"=* AND "addr:street"=*'
    >
      <label text="addr:place cannot be used together with addr:street. Their meanings overlap."/>
      <label text="The addr:place tag is used when addresses are grouped by something other than a street." />

      <reference ref="thoroughfare-place"/>
      <space/>

      <label text="You may have meant to use a Locality tag instead." />

      <reference ref="locality"/>
      <space/>

    </item>


    <!-- And a grab-bag of tags to avoid -->

    <item
      name="UK Address: tags to avoid"
      preset_name_label="true"
      icon="stamp2-16.svg"
      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 accepted alternatives here.
      -->

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

        <text key="addr:place"
          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

Copyrights and trade marks

The attached 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.

Last modified 2 months ago Last modified on 2024-07-22T16:46:21+02:00

Attachments (3)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.