9942914 Noyo River Bridge on OpenStreetMap
Use this template for consistent linking to OpenStreetMap elements, particularly for OSM relations that represent a route or place. The basic form of the link it produces is…
…with the element's numeric id shown first—linked to itself on OpenStreetMap—followed by the title of the wiki page it appears on (or, optionally, some other text) and then a link to the OpenStreetMap entry on Wikipedia.
All data present in OpenStreetMap consists of three types of core data elements:
Each element is also assigned a numeric id (a signed 64-bit integer, specifically) which is unique only within its element type (i.e. there is both a node and a way with numeric id 100 and they are completely unrelated). They can be found either by using Nominatim or the standard OSM in-browser map interface (known as "iD").
Nominatim is the official debugging interface for the search engine used on the OpenStreetMap website. There you can search for the map element you wish to link to by name and upon locating it, click the Details… link to display tabular data which will list its ID number.
iD is the name of the in-browser map interface available on the OSM home page. You can learn the numeric id of an element there by zooming in sufficiently that it fills the majority of your browser screen and then activating the 'Query features' mode by clicking the button on the right edge of the map and then clicking on the map element you wish to identify. The frame on the left will load a list of the data elements near where you clicked, and will highlight each one on the map as you hover over it with the pointer. Once you've identified the element you want, click it to load its details; the new boldface text at the top of the left frame will show the element's numeric ID (highlighted in the example below) enclosed in parentheses, following its type and name, in the format:
The standard use of this template uses two or three unnamed (positional) parameters, in the form of:
{{OSM|type|numeric ID|name (optional)}}
You must specify both an element's type and numeric ID as parameters to the template. The type must be specified first, using the first letter of its English name (node: n
, way: w
, relation: r
), and the numeric ID must follow it as the second. Lastly, if you wish to use something other than the title of the transcluding page as the text that follows the link (such as a local name for the element), it may be supplied as a third parameter. Examples are provided below.
If your optional name text includes an equality symbol (=
), it must be defined instead as the value to the named |3=name
parameter. The other required parameters may likewise be assigned to |1=type
and |2=numeric ID
, though this is rarely necessary.
Links to OpenStreetMap relation elements are handled differently than the other two data types, as they (typically) represent larger amounts of more varied information. The default output for a relation entity will include four additional links—each consisting of a single letter—following the linked numeric ID and enclosed in parentheses as
. They are shortcuts, respectively, to:If a link created by this template to an OSM relation will be in a location where the additional links would not be helpful, their presence can be suppressed by passing a "falsy" Boolean value to the |tools=
parameter. This may be any case-insensitive form of:
false
off
no
n
0
Going one step further, relations also have a "bare" output format that can be invoked by supplying the relation's numeric ID as the value to a single, named |relation=numeric ID
parameter. This suppresses everything save the initial linked numeric value, relying on the editor to provide any additional context in situ.
Element type |
Wikitext | Output |
---|---|---|
Node | {{OSM|n|7530096619}}
|
7530096619 Glen Blair Junction on OpenStreetMap |
{{OSM|n|7530096619|Glen Blair}}
|
7530096619 Glen Blair on OpenStreetMap | |
Way | {{OSM|w|10273762}}
|
10273762 Fort Bragg-Sherwood Road on OpenStreetMap |
{{OSM|w|10273762|Sherwood Rd.}}
|
10273762 Sherwood Rd. on OpenStreetMap | |
Relation | {{OSM|r|9942914}}
|
9942914 Noyo River Bridge on OpenStreetMap |
{{OSM|r|9942914|Noyo Br.}}
|
9942914 Noyo Br. on OpenStreetMap | |
Alternative output formats (sans tools / bare) | ||
{{OSM|r|9942914|tools=off}}
|
9942914 Noyo River Bridge on OpenStreetMap | |
{{OSM|relation=9942914}}
|
9942914 | |
Any | With problematic custom name text | |
{{OSM|w|10273762|3=Sherwood Rd. (within city limits = E. Oak St.)}}
|
10273762 Sherwood Rd. (within city limits = E. Oak St.) on OpenStreetMap |
TemplateData for OSM
Display an external link to a specific data element on OpenStreetMap suitable for inline display
Parameter | Description | Type | Status | |
---|---|---|---|---|
Element type | 1 | Which of the three core OSM data element types you wish to link to
| Line | suggested |
Numeric ID | 2 | The element's numeric ID on OpenStreetMap
| Number | suggested |
Link text | 3 | The text you wish to be linked to the element on OpenStreetMaps
| Line | optional |
Suppress tool links | tools | Suppresses the four extra links to external tools shown by default for OSM relation entities when assigned a "falsy" value
| Boolean | optional |
OSM Relation ID | relation | The numeric id of the relation you wish to link to, producing a bare output format consisting of only the linked numeric ID; overrides all other parameters.
| Number | optional |