Relation:boundary

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — Relation:boundary
Afrikaans Alemannisch aragonés asturianu azərbaycanca Bahasa Indonesia Bahasa Melayu Bân-lâm-gú Basa Jawa Baso Minangkabau bosanski brezhoneg català čeština dansk Deutsch eesti English español Esperanto estremeñu euskara français Frysk Gaeilge Gàidhlig galego Hausa hrvatski Igbo interlingua Interlingue isiXhosa isiZulu íslenska italiano Kiswahili Kreyòl ayisyen kréyòl gwadloupéyen Kurdî latviešu Lëtzebuergesch lietuvių magyar Malagasy Malti Nederlands Nedersaksies norsk bokmål norsk nynorsk occitan Oromoo oʻzbekcha/ўзбекча Plattdüütsch polski português português do Brasil română shqip slovenčina slovenščina Soomaaliga suomi svenska Tiếng Việt Türkçe Vahcuengh vèneto Wolof Yorùbá Zazaki српски / srpski беларуская български қазақша македонски монгол русский тоҷикӣ українська Ελληνικά Հայերեն ქართული नेपाली मराठी हिन्दी অসমীয়া বাংলা ਪੰਜਾਬੀ ગુજરાતી ଓଡ଼ିଆ தமிழ் తెలుగు ಕನ್ನಡ മലയാളം සිංහල ไทย မြန်မာဘာသာ ລາວ ភាសាខ្មែរ ⵜⴰⵎⴰⵣⵉⵖⵜ አማርኛ 한국어 日本語 中文(简体)‎ 吴语 粵語 中文(繁體)‎ ייִדיש עברית اردو العربية پښتو سنڌي فارسی ދިވެހިބަސް
Public-images-osm logo.svg boundary
Boundary.png
Description
For grouping boundaries and marking enclaves/exclaves.
Group: Properties
Members

  • Way - inner
  • Way - outer
  • Node - admin_centre
  • Relation - subarea
Status: De facto

boundary=* relations are used for grouping boundaries and marking enclaves/exclaves.

Relations are used in order to:

  • Avoid name:left=*, name:right=*, nation:right=*, and region:right=*. This has been replaced by one relation per country, province, city, etc.
  • Make it easier to stitch all the parts of a border to each other
  • Avoid multiple duplicated ways above each other.
  • Avoid to connect boundaries to physical features like woods or rivers. Sooner or later these features change in reality and get updated in OSM – but usually the shape of the boundary remains. An exception is if the boundary is legally defined to be the physical feature.

Way tags

Boundary ways should have boundary=administrative and the admin_level=* for the highest border (when a country, state, county are on the same way the admin_level would be 2). source=* is always recommended.

Because boundaries can be rendered both from relations and individual ways, tagging the ways is, in the strictest sense optional. There was a render issue (see this Github discussion), but this was resolved.

Boundary relationships are useful for many tools, but not necessary for rendering purposes, which is why boundary lines should be tagged to allow for the renderer to use them again.

Old direction dependent tags like name:left=*/name:right=* can be removed.

Relation tags

Key Value Discussion
type boundary type=multipolygon is also used, but deprecated for boundary relations (see software implementation notes)
boundary administrative for a real boundary (sometimes in the middle of a river or 12 Miles away from coastline)
land_area administrative for coastline and real boundaries on land
name a name
admin_level the admin level

If you have a land-locked administrative area in the region you should set both: boundary=administrative and land_area=administrative. If the land_area is not the same as the boundary, make two relations, one with land_area=administrative and one with boundary=administrative.

Relation members

Element Role Occurrence Discussion
Way outer one or more The multiple ways that form the closed border
Way inner zero or more Enclaves of this border - the multiple ways that form the closed inner borders
Relation subarea zero or more Refer to relations of sublevel boundaries inside this administrative level.
Note: Optional, disputed and redundant (references to sub levels may also be found with spatial queries). Also referencing other relations makes editing more complicated in some cases.
Node admin_centre zero or one Node representing the administrative centre (a capital, county seat etc.), usually a town, city or village (depending of the boundary level, see place=*).
Node label zero or one Node representing where to draw the label. (This is currently not supported by Mapnik rendering)
Way (blank) - Old, use outer instead
Way enclave - Old, use inner instead
Way exclave - Old, use outer instead

Note: The ways don't have to be closed, But all ways together should form closed rings making the border. For not closed, linear border, see Proposal:Relation boundary segment.

Examples

Baarle Nassau is a good use case for this relation. It has exclaves in enclaves. The exclaves in the enclaves of Belgium would just be added as exclaves to the relation of the Netherlands, the dutch province Noord-Brabant and the village border.

Tagging examples
C is A's enclave and B's exclave:
<relation id="1">
  <tag k="type" v="boundary" />
  <tag k="boundary" v="administrative" />
  <tag k="land_area" v="administrative" />
  <tag k="admin_level" v="2" />
  <tag k="name" v="light green country" />
  <member type="way" id="AB" role="outer" />
  <member type="way" id="AC" role="inner" />
</relation>
<relation id="2">
  <tag k="type" v="boundary" />
  <tag k="boundary" v="administrative" />
  <tag k="land_area" v="administrative" />
  <tag k="admin_level" v="2" />
  <tag k="name" v="dark green country" />
  <member type="way" id="AB" role="outer" />
  <member type="way" id="AC" role="outer" />
</relation>
C is A's enclave and B's exclave.
D is an exclave of B, but not an enclave of A since it also shares a border with C:
<relation id="1">
  <tag k="type" v="boundary" />
  <tag k="boundary" v="administrative" />
  <tag k="land_area" v="administrative" />
  <tag k="admin_level" v="2" />
  <tag k="name" v="light green country" />
  <member type="way" id="AB" role="outer" />
  <member type="way" id="AC1" role="outer" />
  <member type="way" id="AC2" role="outer" />
  <member type="way" id="AD" role="outer" />
</relation>
<relation id="2">
  <tag k="type" v="boundary" />
  <tag k="boundary" v="administrative" />
  <tag k="land_area" v="administrative" />
  <tag k="admin_level" v="2" />
  <tag k="name" v="dark green country" />
  <member type="way" id="AB" role="outer" />
  <member type="way" id="BC" role="outer" />
  <member type="way" id="AD" role="outer" />
  <member type="way" id="CD" role="outer" />
</relation>
<relation id="3">
  <tag k="type" v="boundary" />
  <tag k="boundary" v="administrative" />
  <tag k="land_area" v="administrative" />
  <tag k="admin_level" v="2" />
  <tag k="name" v="purple country" />
  <member type="way" id="AC1" role="outer" />
  <member type="way" id="AC2" role="outer" />
  <member type="way" id="CD" role="outer" />
  <member type="way" id="BC" role="outer" />
</relation>
D is an exclave of B, but not an enclave of A since it also shares a border with C.

There are more examples!

Software implementation

Software should support all deprecated types until they disappear in database:

  • type=multipolygon as well as type=boundary (An administrative boundary can be definitively recognised through the existing boundary=* tag)
  • role=(blank) for role=outer (note blank role is obsolete for multipolygons as well, but usually defaults to outer)

Tools

Downloads