Relation

From OpenStreetMap Wiki
Jump to: navigation, search
Help
Available languages
Deutsch English Español Français Italiano 日本語 Polski Русский Svenska Українська

A relation is a Data Primitive that consists of one or more Tags and also an ordered list of one or more Nodes and/or Ways as members which is used to define logical or geographic relationships between other elements. A member of a relation can optionally have a Role which describe the part that a particular feature plays within a relation.

Contents

Usage

Relations are use to model logical (and usually local) or geographic relationships between objects. They are not designed to hold loosely associated but widely spread items. It would be inappropriate, for instance, to use a relationship to group together 'All footpaths in East Anglia'.

Roles

A Role is an optional textual field describing the role of a member of a relation. For example, in the multipolygon relation, role=inner and role=outer are used to specify whether a way forms the inner or outer part of that polygon.

Types of relation Mf Relation.svg

Main article: Types of relation

There are many Types of relation including.

Examples

Bus route

A bus route might have a relation with type=route, route=bus and ref and operator tags. The ways over which the bus travels would be members, along with bus stop nodes. The ways would have forward or backward roles, depending on whether the buses operate in the direction of the way, or the opposite way (or the role might be blank, meaning the bus route uses the way in both directions).

Multi-polygon

In the multipolygon relation, role=inner and role=outer are used to specify whether a way forms the inner or outer part of that polygon.

See also

Data Primitives
NodeWayRelationTag
Personal tools
Namespaces
Variants
Actions
site
Toolbox