Template:Location/doc: Difference between revisions
More actions
No edit summary |
m Reverted edits by Guledwarsame1 (talk) to last revision by Achim55 |
||
| (99 intermediate revisions by 39 users not shown) | |||
| Line 1: | Line 1: | ||
{{#ifeq:{{BASEPAGENAME}}|Location|{{Redirects|Camera location<!-- |Koordynaty -->}}}} {{Lua|Module:Coordinates}} | |||
= Syntax #1: decimal degrees = | |||
{{TemplateBox | {{TemplateBox | ||
|1=1 | |1=1 | ||
|1d= Degrees of Latitude | |1d-td-en= Degrees of Latitude. The sign indicates hemisphere: +(North) and -(South). DMS format is also allowed, for example <code>50° 37′ 50.63″ N</code>. | ||
|1label-en=Latitude | |||
|1type=string | |||
|1def= | |||
|1stat=optional | |||
|2=2 | |||
|2d-td-en=Degrees of Longitude. The sign indicates hemisphere: +(East) and -(West). DMS format is also allowed, for example <code>6° 01′ 57.61″ E</code>. | |||
|2label-en=Longitude | |||
|2type=string | |||
|2def= | |||
|2stat=optional | |||
|3=3 | |||
|3aliases=attributes | |||
|3d={{Location/attribute documentation}} | |||
|3label-en=attributes | |||
|3type=string | |||
|3def= | |||
|3stat=optional | |||
|4=wikidata | |||
|4d=Wikidata Q-code of an item with [[d:Property:P625|coordinate location (P625)]]. Alternative to latitude and longitude. | |||
|4aliases = Wikidata | |||
|4label-en=wikidata | |||
|4type=string | |||
|4def= | |||
|4stat=optional- | |||
|5=bare | |||
|5d="bare=1" will show only field value without field's name ("Object location") | |||
|5label-en=bare | |||
|5def= | |||
|5stat=optional- | |||
|6=secondary | |||
|6d=''secondary=1'' will tag this set of coordinates as ''secondary''. This template calls {{[[mw:Extension:GeoData|#coordinates:]]}} [[meta:Manual:Parser functions|parser function]], one of the parameters of which is '''primary''' vs. '''secondary''' label. Primary coordinates define file's camera location and are the default, but each file can only have single ''primary'' location tag. | |||
|6label-en=secondary | |||
|6def= | |||
|6stat=optional- | |||
|7=prec | |||
|7d=By default the georeference precision is about 0.3 meters or 1/100 of a second on the equator. To show less digits add parameter "prec" with a measurement precisions expressed in meters. For example 40 meter uncertainty would be expressed as "prec=40". At the moment this parameter only affects the display of the coordinates. | |||
|7label-en=precision | |||
|7type=number | |||
|7def=0.3 | |||
|7stat=optional- | |||
|8=lang | |||
|8d=language code (only needs to be provided if the language shall be fixed and independent from the user's preferences) | |||
|8label-en=language | |||
|8type=string | |||
|8def=language code of the user language (<nowiki>{{int:Lang}}</nowiki>) | |||
|8stat=optional- | |||
|name={{BASEPAGENAME}} | |||
|desc-en= Template used for geocoding Commons images, providing camera location using decimal or degrees/minutes/seconds (DMS) syntax. See [[Commons:Geocoding]] for more information. | |||
{{tl|Location}} = {{tl|Camera location}} is the main template of the {{tl|Object location}} and {{tl|Globe location}} family and is supposed to be used to define the coordinates and {{F|Compass Card B+W.svg|heading of the location}} of the camera. | |||
|desc-de= Die Vorlage wird für die Geocodierung von Commons-Bildern verwendet, welche die Kameraposition mittels Dezimal- oder Grad / Minuten / Sekunden (DMS) Syntax bereitstellt. Siehe [[Commons: Geocoding]] für weitere Informationen. | |||
{{tl|Location}} ist die Hauptvorlage für die {{tl|Object location}} und {{tl|Globe location}} -Gruppe und soll verwendet werden, um die Koordinaten und den Blickwinkel der Position der Kamera zu definieren. | |||
|namespace=file | |||
|usergroup=all | |||
|placement= | |||
|usage-notes=Should be placed directly above or below {{tl|Information}}, {{tl|Artwork}} or other similar template.<br /><small>Note: some users prefer to include location template(s) into the "Description" field of {{tl|Information}} template to group all location information – objections contend that graphic design is not ideally adjusted for such use. See [[Template talk:Information/Archive 2#Location template|this]] and [[Template talk:Information/Archive 2#Suggestions|this]] discussion.</small> | |||
|type=infobox | |||
|example= | |||
|i18n-method=- | |||
|i18n-desc= | |||
|seealso= | |||
|setscats= Depending on namespace: | |||
*[[:Category:Media with locations]] (for files) | |||
*[[:Category:Galleries with coordinates]] (for galleries) | |||
*[[:Category:Categories with coordinates]] (for categories) | |||
In case of errors: | |||
*[[:Category:Media with default locations]] (set by the template in case of lat=0 and lon=0 coordinates) | |||
*[[:Category:Media with erroneous locations]] (set by the template for other issues) | |||
*[[:Category:Pages with malformed coordinate tags]] (set by {{[[mw:Extension:GeoData|#coordinates:]]}}) | |||
Wikidata related: | |||
*[[:Category:Pages with local object coordinates and matching Wikidata coordinates]] | |||
*[[:Category:Pages with local coordinates and similar Wikidata coordinates]] | |||
*[[:Category:Pages with local object coordinates and missing Wikidata coordinates]] | |||
*[[:Category:Pages with local object coordinates and mismatching Wikidata coordinates]] | |||
|lines=one | |||
|shorthand= | |||
|relieson= | |||
}} | |||
= Syntax #2: Degrees/Minutes/Seconds (DMS) = | |||
{{TemplateBox | |||
|1=1 | |||
|1d-td-en= Degrees of Latitude | |||
|1label-en=latitude degrees | |||
|1type=number | |||
|1def= | |1def= | ||
|1stat=required | |1stat=required | ||
|2=2 | |2=2 | ||
|2d=Minutes of Latitude | |2d-td-en=Minutes of Latitude | ||
|2label-en=latitude minutes | |||
|2type=number | |||
|2def= | |2def= | ||
|2stat=required | |2stat=required | ||
|3=3 | |3=3 | ||
|3d=Seconds of Latitude | |3d-td-en=Seconds of Latitude | ||
|3label-en=latitude seconds | |||
|3type=number | |||
|3def= | |3def= | ||
|3stat=required | |3stat=required | ||
|4=4 | |4=4 | ||
|4d= Latitude Direction (N or S) | |4d-td-en= Latitude Direction or North/South hemisphere (N or S) | ||
|4label-en=North/South hemisphere | |||
|4type=string | |||
|4def= | |4def= | ||
|4stat=required | |4stat=required | ||
|5=5 | |5=5 | ||
|5d=Degrees of Longitude | |5d-td-en=Degrees of Longitude | ||
|5label-en=longitude degrees | |||
|5type=number | |||
|5def= | |5def= | ||
|5stat=required | |5stat=required | ||
|6=6 | |6=6 | ||
|6d=Minutes of Longitude | |6d-td-en=Minutes of Longitude | ||
|6label-en=longitude minutes | |||
|6type=number | |||
|6def= | |6def= | ||
|6stat=required | |6stat=required | ||
|7=7 | |7=7 | ||
|7d=Seconds of Longitude | |7d-td-en=Seconds of Longitude | ||
|7label-en=longitude seconds | |||
|7type=number | |||
|7def= | |7def= | ||
|7stat=required | |7stat=required | ||
|8=8 | |8=8 | ||
|8d=Longitude Direction (W or E) | |8d-td-en=Longitude Direction or East/West Hemisphere (W or E) | ||
|8label-en=East/West hemisphere | |||
|8type=string | |||
|8def= | |8def= | ||
|8stat=required | |8stat=required | ||
|9=9 | |9=9 | ||
|9d={{Location/attribute documentation}} | |9aliases=attributes | ||
|9d-en={{Location/attribute documentation}} | |||
|9label-en=attributes | |||
|9type=string | |||
|9def= | |9def= | ||
|9stat=optional | |9stat=optional | ||
|10= | |10=bare | ||
|10d= | |10d="bare=1" will show only field value without field's name ("Camera location") | ||
|10label-en=bare | |||
|10def= | |10def= | ||
|10stat=optional- | |10stat=optional- | ||
| | |11=prec | ||
| | |11d=By default the georeference precision is about 0.3 meters or 1/100 of a second on the equator. To show less digits add parameter "prec" with a measurement precisions expressed in meters. For example 40 meter uncertainty would be expressed as "prec=40". At the moment this parameter only affects the display of the coordinates. | ||
|11label-en=precision | |||
|11type=number | |||
|11def=0.3 | |||
|11stat=optional- | |||
|12=lang | |||
|namespace= | |12d=language code (only needs to be provided if the language shall be fixed and independent from the user's preferences) | ||
|12label-en=language | |||
|12type=string | |||
|12def=language code of the user language (<nowiki>{{int:Lang}}</nowiki>) | |||
|12stat=optional- | |||
|name={{BASEPAGENAME}} | |||
|desc=Alternative DMS syntax. | |||
|namespace=contents | |||
|usergroup=all | |usergroup=all | ||
|placement= | |placement= | ||
|usage-notes= | |usage-notes= | ||
|type=infobox | |type=infobox | ||
|example= | |example= | ||
|i18n-method= | |i18n-method= | ||
|i18n-desc= | |i18n-desc=All translations at [[Module:I18n/coordinates]] | ||
|seealso= | |seealso= | ||
*Other templates from the family: | *Other templates from the family: | ||
:*{{ | :*{{tl|Location}} – used to provide camera location using | ||
:*{{ | :*{{tl|Object location}} – used to provide object location using | ||
:*{{tl|Globe location}} – used to provide object location on other globes, like Moon, Mars, etc. | |||
:*{{ | |||
*Related templates | *Related templates | ||
:*{{tl|Location-Panorama}} | :*{{tl|Location-Panorama}} | ||
| Line 75: | Line 200: | ||
:*{{tl|Location possible}}, mark pictures without defined location | :*{{tl|Location possible}}, mark pictures without defined location | ||
:*{{tl|Location required}} | :*{{tl|Location required}} | ||
:*{{tl|GPS EXIF}} | |||
:*{{tl|Location withheld}} | |||
:*{{tl|Location estimated}} | |||
:*{{tl|Location rounded}} | |||
*[[Template:Location/general documentation|old documentation]] | *[[Template:Location/general documentation|old documentation]] | ||
|setscats= | |setscats= | ||
|lines=one | |lines=one | ||
|shorthand= | |shorthand= | ||
|relieson= | |relieson=[[Module:Coordinates]] | ||
}} | }} | ||
= Syntax #2a: Degrees/Minutes/Seconds (DMS) symbols = | |||
It is possible to use the output format (of e.g. {{T0|Location}}, or {{W|Wikimapia}}) as the input for {{T0|Location}}:<br /> | |||
The DMS data string can be converted from the ''symbol format'' | |||
e.g. {{Tle|T={{BASEPAGENAME}} |p1=1|34°01′27.37″N 116°09′29.88″W |...}}<br /> | |||
to the above DMS format; all the other parameters also like above. | |||
Additional spaces or commas won't matter. | |||
= Examples = | = Examples = | ||
{{#ifeq:{{BASEPAGENAME}}|Globe location| | |||
<!-- ========================================================================= globe --> | |||
<table class="wikitable" style="width:100%;"> | |||
<caption>Syntax #1</caption> | |||
<caption>{{Tl|Globe location}} example</caption> | |||
</tr> | |||
<th>Code</th> | |||
<td><code>{{Tlx|Globe location|34.02427|-116.15830<nowiki>|globe=moon</nowiki>}}</code></td> | |||
</tr><tr> | |||
<th>Produces</th> | |||
<td>{{{{<noinclude>BASE</noinclude>PAGENAME}}|34.02427|-116.15830|globe=moon}}</td> | |||
</table> | |||
<table class="wikitable" style="width:100%;"> | |||
<caption>Syntax #2</caption> | |||
</tr> | |||
<th>Code</th> | |||
<td><code>{{Tlx|Globe location|34|1|27.37|N|116|9<nowiki>|29.88|W|globe=mars</nowiki>}}</code></td> | |||
</tr><tr> | |||
<th>Produces</th> | |||
<td>{{{{<noinclude>BASE</noinclude>PAGENAME}}|34|1|27.375|N|116|9|29.88|W|globe=mars}}</td> | |||
</tr> | |||
</table> | |||
<!-- ?? | |||
<table class="wikitable" style="width:100%;"> | <table class="wikitable" style="width:100%;"> | ||
<caption>Main syntax</caption> | <caption>Main syntax</caption> | ||
| Line 90: | Line 249: | ||
</tr><tr> | </tr><tr> | ||
<th>Produces</th> | <th>Produces</th> | ||
<td>{{ | <td>{{{{<noinclude>BASE</noinclude>PAGENAME}}|34|1|27.37|N|116|9|29.88|W|region:DE-NI_scale:10000_heading:SW}}</td> | ||
</tr> | |||
</table> --> | |||
<!-- ========================================================================= globe --> | |||
| | |||
<!-- ========================================================================= earth --> | |||
<table class="wikitable" style="width:100%;"> | |||
<caption>Syntax #1 — 2 location values</caption> | |||
</tr> | |||
<th>Code</th> | |||
<td> | |||
<code>{{Tlx|{{BASEPAGENAME}}|34.02427|-116.15830|region:DE-NI_scale:5000}}</code> | |||
</td> | |||
</tr><tr> | |||
<th>Produces</th> | |||
<td>{{{{<noinclude>BASE</noinclude>PAGENAME}}|34.02427|-116.15830|region:DE-NI_scale:5000}}</td> | |||
</tr> | |||
</table> | |||
<table class="wikitable" style="width:100%;"> | |||
<caption>Syntax #2 — 8 location values</caption> | |||
</tr> | |||
<th>Code</th> | |||
<td> | |||
<code>{{Tlx|{{BASEPAGENAME}}|34|1|27.37|N|116|9|29.88|W|region:DE-NI_scale:6000}}</code> | |||
</td> | |||
</tr><tr> | |||
<th>Produces</th> | |||
<td>{{{{<noinclude>BASE</noinclude>PAGENAME}}|34|1|27.37|N|116|9|29.88|W|region:DE-NI_scale:10000_heading:SW}}</td> | |||
</tr> | </tr> | ||
</table> | </table> | ||
<table class="wikitable" style="width:100%;"> | |||
<caption>Syntax #2a — 1 parameter</caption> | |||
</tr> | |||
<th>Code</th> | |||
<td><code>{{Tlx|{{BASEPAGENAME}}|34° 01′ 27.37″ N, 116° 09′ 29.88″ W|region:DE-NI_scale:10000_heading:SW}}</code></td> | |||
</tr><tr> | |||
<th>Produces</th> | |||
<td>{{{{<noinclude>BASE</noinclude>PAGENAME}}|34° 01′ 27.37″ N, 116° 09′ 29.88″ W|region:DE-NI_scale:10000_heading:SW}}</td> | |||
</tr> | |||
</table> | |||
<table class="wikitable" style="width:100%;"> | |||
<caption>Syntax #2b — 1 parameter</caption> | |||
</tr> | |||
<th>Code</th> | |||
<td><code>{{Tlx|Location|34 1 27.37 N 116 9 29.88 W|region:DE-NI_scale:10000_heading:SW}}</code></td> | |||
</tr><tr> | |||
<th>Produces</th> | |||
<td>{{{{<noinclude>BASE</noinclude>PAGENAME}}|34 1 27.37 N 116 9 29.88 W |region:DE-NI_scale:10000_heading:SW}}</td> | |||
</tr> | |||
<!-- | |||
</tr> | |||
<th>Code</th> | |||
<td><code>{{Tlx|Location|34/1/27.37/N/116/9/29.88/W|region:DE-NI_scale:10000_heading:SW}}</code></td> | |||
</tr><tr> | |||
<th>Produces</th> | |||
<td>{{{{<noinclude>BASE</noinclude>PAGENAME}}|34/1/27.37/N/116/9/29.88/W|region:DE-NI_scale:10000_heading:SW}}</td> | |||
</tr> --> | |||
</table> | |||
}} | |||
<includeonly> | <includeonly> | ||
[[Category:Lua-based templates|{{PAGENAME}}]] | |||
[[Category:Geocoding templates|{{PAGENAME}}]] | [[Category:Geocoding templates|{{PAGENAME}}]] | ||
</includeonly> | </includeonly> | ||
<templatedata> | |||
{ | |||
"params": { | |||
"lat": {}, | |||
"lon": {} | |||
}, | |||
"description": "Template used for geocoding Commons images, providing camera location using decimal or degrees/minutes/seconds (DMS) syntax." | |||
} | |||
</templatedata> | |||
Latest revision as of 20:46, 12 March 2026
Syntax #1: decimal degrees
Template used for geocoding Commons images, providing camera location using decimal or degrees/minutes/seconds (DMS) syntax. See Commons:Geocoding for more information.
{{Location}} = {{Camera location}} is the main template of the {{Object location}} and {{Globe location}} family and is supposed to be used to define the coordinates and heading of the location of the camera.
The template automatically sets the following categories: Depending on namespace:
- Category:Media with locations (for files)
- Category:Galleries with coordinates (for galleries)
- Category:Categories with coordinates (for categories)
In case of errors:
- Category:Media with default locations (set by the template in case of lat=0 and lon=0 coordinates)
- Category:Media with erroneous locations (set by the template for other issues)
- Category:Pages with malformed coordinate tags (set by {{#coordinates:}})
Wikidata related:
- Category:Pages with local object coordinates and matching Wikidata coordinates
- Category:Pages with local coordinates and similar Wikidata coordinates
- Category:Pages with local object coordinates and missing Wikidata coordinates
- Category:Pages with local object coordinates and mismatching Wikidata coordinates
Usage
{{Location |1= |2= |3= }}
Should be placed directly above or below {{Information}}, {{Artwork}} or other similar template.
Note: some users prefer to include location template(s) into the "Description" field of {{Information}} template to group all location information – objections contend that graphic design is not ideally adjusted for such use. See this and this discussion.
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | Latitude | Degrees of Latitude. The sign indicates hemisphere: +(North) and -(South). DMS format is also allowed, for example 50° 37′ 50.63″ N. | empty | optional |
2 | Longitude | Degrees of Longitude. The sign indicates hemisphere: +(East) and -(West). DMS format is also allowed, for example 6° 01′ 57.61″ E. | empty | optional |
3attributes | attributes | Information attributes - used to pass to GeoHack server metadata about the coordinates. Apart from heading, this information is not used by {{Location/doc}} template. Attributes have to be in the format field1:value1_field2:value2_field3:value3, etc. The following fields are supported:
| empty | optional |
wikidataWikidata | wikidata | Wikidata Q-code of an item with coordinate location (P625). Alternative to latitude and longitude. | empty | optional |
bare | bare | "bare=1" will show only field value without field's name ("Object location") | empty | optional |
secondary | secondary | secondary=1 will tag this set of coordinates as secondary. This template calls {{#coordinates:}} parser function, one of the parameters of which is primary vs. secondary label. Primary coordinates define file's camera location and are the default, but each file can only have single primary location tag. | empty | optional |
prec | precision | By default the georeference precision is about 0.3 meters or 1/100 of a second on the equator. To show less digits add parameter "prec" with a measurement precisions expressed in meters. For example 40 meter uncertainty would be expressed as "prec=40". At the moment this parameter only affects the display of the coordinates. | 0.3 | optional |
lang | language | language code (only needs to be provided if the language shall be fixed and independent from the user's preferences) | language code of the user language ({{int:Lang}}) | optional |
Additional information
The template is intended to be used in the following namespaces: the File namespace
The template is intended to be used by the following user groups: all users
Localization
This template is not intended to be localized.
Syntax #2: Degrees/Minutes/Seconds (DMS)
Alternative DMS syntax.
Usage
{{Location |1= |2= |3= |4= |5= |6= |7= |8= |9= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | latitude degrees | Degrees of Latitude | empty | required |
2 | latitude minutes | Minutes of Latitude | empty | required |
3 | latitude seconds | Seconds of Latitude | empty | required |
4 | North/South hemisphere | Latitude Direction or North/South hemisphere (N or S) | empty | required |
5 | longitude degrees | Degrees of Longitude | empty | required |
6 | longitude minutes | Minutes of Longitude | empty | required |
7 | longitude seconds | Seconds of Longitude | empty | required |
8 | East/West hemisphere | Longitude Direction or East/West Hemisphere (W or E) | empty | required |
9attributes | attributes | Information attributes - used to pass to GeoHack server metadata about the coordinates. Apart from heading, this information is not used by {{Location/doc}} template. Attributes have to be in the format field1:value1_field2:value2_field3:value3, etc. The following fields are supported:
| empty | optional |
bare | bare | "bare=1" will show only field value without field's name ("Camera location") | empty | optional |
prec | precision | By default the georeference precision is about 0.3 meters or 1/100 of a second on the equator. To show less digits add parameter "prec" with a measurement precisions expressed in meters. For example 40 meter uncertainty would be expressed as "prec=40". At the moment this parameter only affects the display of the coordinates. | 0.3 | optional |
lang | language | language code (only needs to be provided if the language shall be fixed and independent from the user's preferences) | language code of the user language ({{int:Lang}}) | optional |
Additional information
The template is intended to be used in the following namespaces: all content namespaces
The template is intended to be used by the following user groups: all users
Relies on:
Module:Coordinates
See also
- Other templates from the family:
- {{Location}} – used to provide camera location using
- {{Object location}} – used to provide object location using
- {{Globe location}} – used to provide object location on other globes, like Moon, Mars, etc.
- Related templates
- {{Location-Panorama}}
- {{Location map notice}}
- {{Location possible}}, mark pictures without defined location
- {{Location required}}
- {{GPS EXIF}}
- {{Location withheld}}
- {{Location estimated}}
- {{Location rounded}}
== Localization ==
All translations at Module:I18n/coordinates
Syntax #2a: Degrees/Minutes/Seconds (DMS) symbols
It is possible to use the output format (of e.g. Location, or Wikimapia) as the input for Location:
The DMS data string can be converted from the symbol format
e.g. {{ Location | 1 = 34°01′27.37″N 116°09′29.88″W | ... }}
to the above DMS format; all the other parameters also like above.
Additional spaces or commas won't matter.
Examples
| Code |
|
|---|---|
| Produces | 34.0243° N 116.1583° W |
| Code |
|
|---|---|
| Produces | 34.0243° N 116.1583° W |
| Code | {{Location|34° 01′ 27.37″ N, 116° 09′ 29.88″ W|region:DE-NI_scale:10000_heading:SW}} |
|---|---|
| Produces | Error: Invalid parameters! (coordinates are missing or not numeric) |
| Code | {{Location|34 1 27.37 N 116 9 29.88 W|region:DE-NI_scale:10000_heading:SW}} |
|---|---|
| Produces | Error: Invalid parameters! (coordinates are missing or not numeric) |
Template used for geocoding Commons images, providing camera location using decimal or degrees/minutes/seconds (DMS) syntax.
| Parameter | Description | Type | Status | |
|---|---|---|---|---|
| lat | lat | no description | Unknown | optional |
| lon | lon | no description | Unknown | optional |