|For grouping boundaries and marking enclaves/exclaves.|
|Status: de facto|
|Tools for this tag|
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.
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.
|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.|
|admin_level||The administrative 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.
|outer||1+||The multiple ways that form the closed border|
|inner||0+||Enclaves of this border - the multiple ways that form the closed inner borders|
||0+||Deprecated, don't use. Use outer or inner instead. Some tools may treat it only as outer, others will attempt to guess it using complex geometry inference.|
|admin_centre||0–1||Node representing the administrative centre (a capital, county seat etc.), usually a town, city or village (depending of the boundary level, see place=*).|
|label||0–1||Node representing where to draw the label. (osm-carto does not render labels for a relation itself, but adding a respective node (e.g. place=*) helps; adding that one to the relation as label is optional). May be useful when there's an enclave or the boundary has a large concavity, and the default placement of the label in the center of the bounding box would fall completely outside the boundary area.|
|subarea||0+|| 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, provided that there's no overlap between similar subdivisions). Also referencing other relations makes editing more complicated in some cases.
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.
- 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.
- There are more examples!
Software should support all deprecated types until they disappear in database: