Help:Administrative boundaries

From OpenGeofiction
Jump to navigation Jump to search
Achtung.svg Recommended for advanced users only - users must have experience in creating relations before attempting administrative boundaries. Making a mistake can easily flood a continent.

Your country has a boundary with the tags (boundary = administrative) and (admin_level = 2). If you want to define lesser units such as provinces or states, counties or municipalities, feel free to draw those boundaries yourself. However be sure to tag your boundaries with the appropriate "admin_level" and include them in appropriate relations.

Before you start

Achtung.svg Before drawing administrative boundaries, remember that:
  • boundaries often follow natural features such as rivers and mountain ranges; and
  • high-density areas often have smaller administrative divisions, and low-density areas often have larger administrative divisions.

So in order to create realistic boundaries, it's usually a good idea to plan the overall layout of your country first (possibly using our country planning tutorial) so that you know where the high-density and low-density areas will be, as well as the location of major rivers and mountain ranges that would likely form many of the boundaries.

In other words, it's much easier to plan your country's natural layout and population pattern first, and then draw boundaries in logical places; as opposed to drawing boundaries first, and then trying to figure out a natural layout and population pattern that make sense given those boundaries.

Drawing boundaries

Administrative boundaries are drawn as ways and tagged as:

  • boundary = administrative
  • admin_level = x (= 2, 4, 6 or 8)

Which admin_level to use

See also: Help:Tagging_and_rendering/admin_level for a country-by-country breakdown of the admin_level usages by country in OGF.

Since each country has its own hierarchy of administrative divisions, the "admin_level" numbers must be adapted to fit each national system.

The general pattern is: low number = large unit, high number = small unit.

admin_level Unit Notes
country independent country / "Staat"
(semi independent unit) (e.g. united kingdoms)
state, province first level under country / "Land"
county level under state / "Kreis"
municipality cities**, towns, villages, other municipal units / "Stadtteil, Gemeinde"
neighborhood, ward smallest possible administrative units - often encompass one village, one small town, or a small part of a city / "Stadtbezirk"
*The admin_levels 3, 5 and 7 are reserved for special cases (semi-independent areas, etc.) and may not be displayed on the map. For more information see OSM wiki for usage of the admin_level tag in real world countries.
**Some cities may qualify for other levels. For example Washington DC is the equivalent of a state, so its level is 4. Baltimore is a county equivalent, so its level is 6.

Boundaries for different Units

For boundary ways serving multiple units with different admin_levels, the lowest admin_level number should be used. For example, if a boundary way forms part of a national boundary and a provincial boundary, then its admin_level should be 2. In this case only draw one line as boundary for the country and state or state and county - or country, state and county. Never draw several boundaries via the same way with the same nodes (a mistake always leads to problems).

That means:

  • a new state boundary running the same way as the existing country boundary use the way of the existing country boundary
  • a new county boundary running the same way as the existing state boundary use the way of the existing state boundary
  • a new county boundary running the same way as the existing country and state boundary us the way of the older boundaries
  • and so on

Generally for later changings of boundaries it is for beginner the better practice, to draw a boundary as seperate way and not joined with the outer line of a wood or other landuse. A boundary in the middle of the river should have an own line and not the same line as the river line. Then you have it easyer later to add relations for new boundaries to the existing boundary-way.

Advanced mappers may put boundaries and other mapping into one line. Do so only, if you know, what you do.

Boundary intersections

Boundary intersection

If three (or more) boundaries meet at a point, then each way must end there. If not, you will get a problem later on with the relations of your areas. If a newly drawn boundary meets an existing boundary way, then the existing boundary way must be divided into two segments (use the scissor-tool) splitting the way at the point of intersection.

If the existing boundary way was already included in relations, the editor automatically adds both new segments to all their existing relations — therefore you do not need to do anything. The relations are updated automatically.

Grouping boundaries into relations

In some cases, boundaries may appear correct on the map even if they are not included in a relation. However every boundary should be included in the appropriate relations. Relations group the boundaries together and tell us which areas they are enclosing. Correct relations for an area are also important to ensure that the name of the area is shown on the map.

Normally a boundary way is part of two relations, one on each side of the boundary. (Boundaries bordering the open sea may have only one relation, since there is no country on the other side of the boundary.) Often a boundary way is part of many more relations, at different admin_levels. For example if a way is part of a state boundary and also a county boundary, then it is included in 4 relations (State A and State B, County C and County D). If it is part of national, state and county boundaries, then it is included in 6 relations (Country 1 and Country 2, State A and State B, County C and County D).

Each relation normally contains 6 tags:

  • type = boundary
  • boundary = administrative
  • admin_level = x (= 2, 4, 6 or 8)
  • place = state (for level 4), county (for level 6) or city/town/suburb/etc. (for level 8)
  • ref = the short reference (standard abbreviation, usually 2 or 3 capital letters)*
  • name = the name of your administrative unit

*The "ref" tag is especially useful for states/provinces, because at a lower zoom level (zoom level 4) the OGF map will display the reference instead of the full name of the state/province. In other cases it is useful to define the relation. The reference normally is two or three capital letters, such as MA for "Montes Azul" or MYP for "My province" or "XX_01" (where XX means the country and the number the province), but this depends on the country.

Relations and boundaries

Add all segments (ways) of the boundary of an area to the relation, making sure to label each one as "outer." It is important that all the boundary ways around the administrative unit are included in the same one relation, so that the members of the relation form a fully enclosed polygon around the administrative unit.

To create a relation in iD 1.3.6

Select a boundary way, click the "+" button beneath "All relations" and select "New Relation..." to create a new relation. Then click the "Boundary" button, enter the name of the administrative unit under "Name," select "administrative" for Type, and enter the admin_level and other tags as appropriate. Once the relation is created, you can add other boundary ways to the relation by selecting them, clicking the "+" button beneath "All relations" and simply selecting the relation from the list.

To create a relation in JOSM

Select a boundary way, click the "Create a new relation" button File:Josm new button.png in the "Relations" panel, add tags as appropriate under "Key" and "Value" (type=boundary, boundary=administrative, admin_level=x, etc.) then move the way from the "Selection" panel to the "Members" list by using one of the arrow buttons. Under "Role," type "outer" and then click OK to save changes. To add another boundary way to the relation, simply select the boundary way and the appropriate relation in the "Relations" panel, then click the "Call relation editor for selected relation" button File:Josm edit button.png. Then move the way from "Selection" to "Members" list, using an arrow button as before, and again typing "outer" under "Role" and click OK to close.

Naming the administrative unit

In order for the name of your administrative unit to appear on the map in different map styles, you must also create a place (with a simple place node) for the name. Please tag this place as:

  • place = state (level 4), county (level 6) or city/town/suburb/etc. (level 8)
  • ref = the "ref" tag for this area (if it refers to a relation with a "ref" tag)
  • name = the name of the relation for this area

And congratulations, you're done!

Finding the area on the area table

If your relations are correct, the area table will tell you the area of each one in km² — for all areas, at all admin_levels.

You can also use the Relation Area Calculator to search for your relations and compute their area instantly.

If a relation is not correct, however, both the list and the calculator will show the area as being "0" km².

There are different reasons why this may have happened:

  • The relation may have a gap, where one piece of boundary is not included in the relation. If you click the relation's number in the id column of the area table, you will see a gap in the red line on the map. You can fix the problem by including the missing segment in the relation.
  • The relation may include a piece of boundary which is not part of the area (usually this is caused by forgetting to cut a boundary at a three-way intersection).
  • A boundary way may be duplicated (this usually isn't very easy to find - move one node in the boundary, and you may see the other).
  • A boundary way may not have been declared as having the role outer, or inner for boundaries of a potential enclave inside the relation.
  • The boundary ways may not fully meet at an intersection (you may not spot this unless you zoom in to the 20m level or so).
  • Instead of one relation, the area may be enclosed by two or more relations, each forming only part of the perimeter.

The JOSM relation editor can help you in finding most of these errors.

(Bear in mind that the area table is only updated once every month. If you are using the JOSM editor, you can also find areas using the measurement plugin.)

Which units are visible at different zoom levels?

When looking at the map on the OGF website, the "layers" button on the right hand side allows you to view the map in different styles. These styles show the names and boundaries of administrative units differently at various zoom levels. For example, although "county" boundaries can be seen at various zoom levels, "county" names will not appear in the Standard map style or in the TopoMap style, but can be seen in the "Histor"-style.

Unit admin_
map style
Country name 2 displayed at zoom 3 - 5 not displayed displayed at zoom 2 - 6 (in ALL CAPS)
Country boundary 2 displayed at zoom 4 and higher displayed at zoom 6 and higher displayed at zoom 4 and higher
State reference (abbreviation) 4 displayed at zoom 4 not displayed displayed at zoom 4
State name 4 displayed at zoom 5 - 8 not displayed displayed at zoom 5 - 8
State boundary 4 displayed at zoom 4 and higher displayed at zoom 6 and higher displayed at zoom 4 and higher
County name 6 not displayed not displayed displayed at zoom 9 and higher
County boundary 6 displayed at zoom 11 and higher displayed at zoom 10 and higher displayed at zoom 9 and higher
special unit - boundary 7 displayed at zoom 12 and higher not displayed displayed at zoom 10 and higher
Municipality name 8 displayed at zoom 12 and higher displayed at zoom 13 and higher displayed at zoom 12 and higher
Municipality boundary 8 displayed at zoom 12 and higher not displayed displayed at zoom 12 and higher

If there are more questions, please ask on the Discussion page of this article.