Area

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — Area
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 беларуская български қазақша македонски монгол русский тоҷикӣ українська Ελληνικά Հայերեն ქართული नेपाली मराठी हिन्दी অসমীয়া বাংলা ਪੰਜਾਬੀ ગુજરાતી ଓଡ଼ିଆ தமிழ் తెలుగు ಕನ್ನಡ മലയാളം සිංහල ไทย မြန်မာဘာသာ ລາວ ភាសាខ្មែរ ⵜⴰⵎⴰⵣⵉⵖⵜ አማርኛ 한국어 日本語 中文(简体)‎ 吴语 粵語 中文(繁體)‎ ייִדיש עברית اردو العربية پښتو سنڌي فارسی ދިވެހިބަސް
Showing a pedestrian area linked to the road network

An area (or filled polygon) can be defined as an enclosed filled area defined as a closed way with appropriate associated tags or using a multipolygon relation creating an area from one of more ways.

Note that areas are not distinct data primitives and some closed ways (for example landuse=*) are assumed to be areas, but others, such as highway=footway are not, being treated as linear features instead, except when there is also an area=yes tag.

How to Map

There are two ways to create an area:

  • For smaller areas is it often appropriate to create a single closed way with suitable tags and in some rare cases it is also necessary to add area=yes. See area=* for further details.
  • For larger areas and for ones which butt up to other areas or to ways is it often more appropriate to use a multipolygon, again tagged as required. See relation:multipolygon for more details.

Closed ways with some combinations of tags can create both a linear 'closed polygon' and also an area. For example a roundabout with a grass area in the middle might defined as a closed way tagged with highway=primary and also with landuse=grass. This would be interpreted as a circular cased road with a green areas in the middle.

When rendering ways with tags which can only be used with closed ways, ways that are not closed will often be 'closed' by joining their ends so that the area can then be filled.

In the past it was necessary to draw boundaries around areas in a particular direction (clockwise or anticlockwise) to ensure that the information was rendered properly - that is no longer necessary.

Presentation

When drawn, smaller areas are in general drawn 'on top' of larger areas which ensures that a small wood in a large park appears as an wood in a park.

However, in situations where there are actually holes in the larger feature, such as with a grass clearing in a wood, multipolygons should be used to explicitly specify e.g. the clearing in the wood and separately define the grass area in that clearing.

Examples

Simple area

In this example a lake is defined by a closed way where the last node equals the first of the way. The use of natural=water implies area=yes. Note that it is not possible to describe lake surfaces having islands or islets this way, as closed ways, by definition, cannot have holes.

  <way id="4876027" timestamp="2008-03-12T07:59:11Z" user="MichaelCollinson">
    <nd ref="31492372"/>
    <nd ref="31492338"/>
    <nd ref="31492370"/>
    <nd ref="31492371"/>
    <nd ref="31492372"/>
    <tag k="natural" v="water"/>
    <tag k="name" v="Spegeldammen"/>
  </way>

Multipolygon area

Multipolygon Illustration 2.svg
Multipolygon Illustration 1b.svg

Areas may also be defined with relation:multipolygon as a set of ways which define one or more outer boundaries, and optionally zero or more inner boundaries ('holes'). In the example below there is one outer boundary defined by a single way, and two ways as inner:

From the data fragment alone we cannot tell if these are

  • two holes (both ways are closed ways, upper picture to the right) or
  • one hole (both inner ways concatenated form a closed way, lower picture to the right)

This is resolved by looking at the data of #8125153 and #8125154 respectively.

  <relation id="12" timestamp="2008-12-21T19:31:43Z" user="kevjs1982" uid="84075">
    <member type="way" ref="2878061" role="outer"/> <!-- picture ref="1" -->
    <member type="way" ref="8125153" role="inner"/> <!-- picture ref="2" -->
    <member type="way" ref="8125154" role="inner"/> <!-- picture ref="3" -->

    <member type="way" ref="3811966" role=""/> <!-- empty role produces
        a warning; avoid this; most software works around it by computing
        a role, which is more expensive than having one set explicitly;
        not shown in the sample pictures to the right -->

    <tag k="type" v="multipolygon"/>
  </relation>

See also