Template:Location/doc: Difference between revisions
More actions
update |
|||
| Line 1: | Line 1: | ||
=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). | ||
|1label-en=Latitude | |||
|1type=number | |||
|1def= | |1def= | ||
|1stat=required | |1stat=required | ||
|2=2 | |2=2 | ||
|2d= | |2d-td-en=Degrees of Longitude. The sign indicates hemisphere: + (East) and - (West). | ||
|2label-en=Longitude | |||
|2type=number | |||
|2def= | |2def= | ||
|2stat=required | |2stat=required | ||
|3=3 | |3=3 | ||
|3d=Seconds of Latitude | |3d={{Location/attribute documentation}} | ||
*<code>'''class:object'''</code> is hard-coded value which will be added automatically to all images to tag this location as the ""object'' location | |||
|3label-en=attributes | |||
|3type=string | |||
|3def= | |||
|3stat=optional | |||
|4=bare | |||
|4d="bare=1" will show only field value without field's name ("Object location") | |||
|4def= | |||
|4stat=optional- | |||
|5=secondary | |||
|5d=''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. | |||
|5def= | |||
|5stat=optional- | |||
|name=Location | |||
|desc= 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}} is the main template of the {{Tl|Location}}, {{Tl|Object location}} and {{Tl|Globe location}} family and is suppose to be used to define the coordinates and heading of the location of the camera. | |||
|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 in order to group all location information together – objections are in point of graphic design not ideal 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 location]] (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:]]}}) | |||
|lines=one | |||
|shorthand= | |||
|relieson= | |||
}} | |||
=Syntax #2: Degrees/Minures/Seconds (DMS)= | |||
{{TemplateBox | |||
|1=1 | |||
|1d-td-en= Degrees of Latitude | |||
|1type=number | |||
|1def= | |||
|1stat=required | |||
|2=2 | |||
|2d-td-en=Minutes of Latitude | |||
|2type=number | |||
|2def= | |||
|2stat=required | |||
|3=3 | |||
|3d-td-en=Seconds of Latitude | |||
|3type=number | |||
|3def= | |3def= | ||
|3stat=required | |3stat=required | ||
|4=4 | |4=4 | ||
|4d= Latitude Direction (N or S) | |4d-td-en= Latitude Direction (N or S) | ||
|4type=string | |||
|4def= | |4def= | ||
|4stat=required | |4stat=required | ||
|5=5 | |5=5 | ||
|5d=Degrees of Longitude | |5d-td-en=Degrees of Longitude | ||
|5type=number | |||
|5def= | |5def= | ||
|5stat=required | |5stat=required | ||
|6=6 | |6=6 | ||
|6d=Minutes of Longitude | |6d-td-en=Minutes of Longitude | ||
|6type=number | |||
|6def= | |6def= | ||
|6stat=required | |6stat=required | ||
|7=7 | |7=7 | ||
|7d=Seconds of Longitude | |7d-td-en=Seconds of Longitude | ||
|7type=number | |||
|7def= | |7def= | ||
|7stat=required | |7stat=required | ||
|8=8 | |8=8 | ||
|8d=Longitude Direction (W or E) | |8d-td-en=Longitude Direction (W or E) | ||
|8type=string | |||
|8def= | |8def= | ||
|8stat=required | |8stat=required | ||
|9=9 | |9=9 | ||
|9d= | |9d-en=See parameter #3 in the decimal degrees syntax | ||
|9type=string | |||
|9def= | |9def= | ||
|9stat=optional | |9stat=optional | ||
|10= | |10=bare | ||
|10d= | |10d="bare=1" will show only field value without field's name ("Object location") | ||
|10def= | |10def= | ||
|10stat=optional- | |10stat=optional- | ||
|name= | |name=Object location | ||
|desc= | |desc=Alternative DMS syntax. | ||
|namespace=contents | |||
|namespace= | |||
|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}} | :*{{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. | |||
:*{{Tl|Object location | |||
:*{{Tl|Globe location}} | |||
*Related templates | *Related templates | ||
:*{{tl|Location-Panorama}} | :*{{tl|Location-Panorama}} | ||
| Line 76: | Line 142: | ||
:*{{tl|Location required}} | :*{{tl|Location required}} | ||
*[[Template:Location/general documentation|old documentation]] | *[[Template:Location/general documentation|old documentation]] | ||
|setscats= | |setscats= | ||
|lines=one | |lines=one | ||
|shorthand= | |shorthand= | ||
|relieson= | |relieson=[[Module:Coordinates]] | ||
}} | }} | ||
= Examples = | |||
<table class="wikitable" style="width:100%;"> | |||
<caption>Syntax #1</caption> | |||
<th>Code</th> | |||
<td><code>{{Tlx|Location|34.02427|-116.15830|region:DE-NI_scale:10000}}</td> | |||
</tr><tr> | |||
<th>Produces</th> | |||
<td>{{Location|34.02427|-116.15830|region:DE-NI_scale:10000}}</td> | |||
</tr> | |||
</table> | |||
<table class="wikitable" style="width:100%;"> | |||
<caption>Syntax #2</caption> | |||
<th>Code</th> | |||
<td><code>{{Tlx|Location|34|1|27.37|N|116|9|29.88|W|region:DE-NI_scale:10000_heading:SW}}</td> | |||
</tr><tr> | |||
<th>Produces</th> | |||
<td>{{Location|34|1|27.37|N|116|9|29.88|W|region:DE-NI_scale:10000_heading:SW}}</td> | |||
</tr> | |||
</table> | |||
<table class="wikitable" style="width:100%;"> | <table class="wikitable" style="width:100%;"> | ||
<caption>Main syntax</caption> | <caption>Main syntax</caption> | ||
Revision as of 15:17, 23 January 2014
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}} is the main template of the {{Location}}, {{Object location}} and {{Globe location}} family and is suppose 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 location (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:}})
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 in order to group all location information together – objections are in point of graphic design not ideal 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). | empty | required |
2 | Longitude | Degrees of Longitude. The sign indicates hemisphere: + (East) and - (West). | empty | required |
3 | 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=1" will show only field value without field's name ("Object location") | empty | optional | |
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 | |
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
Syntax #2: Degrees/Minures/Seconds (DMS)
Alternative DMS syntax.
Usage
{{Object location |1= |2= |3= |4= |5= |6= |7= |8= |9= }}
Template parameters
| Parameter | Description | Default | Status | |
|---|---|---|---|---|
1 | Degrees of Latitude | empty | required | |
2 | Minutes of Latitude | empty | required | |
3 | Seconds of Latitude | empty | required | |
4 | Latitude Direction (N or S) | empty | required | |
5 | Degrees of Longitude | empty | required | |
6 | Minutes of Longitude | empty | required | |
7 | Seconds of Longitude | empty | required | |
8 | Longitude Direction (W or E) | empty | required | |
9 | See parameter #3 in the decimal degrees syntax | empty | optional | |
bare | "bare=1" will show only field value without field's name ("Object location") | empty | 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}}
== Localization ==
All translations at Module:I18n/coordinates
Examples
| Code | {{Location|34.02427|-116.15830|region:DE-NI_scale:10000}} |
|---|---|
| Produces | 34.0243° N 116.1583° W |
| Code | {{Location|34|1|27.37|N|116|9|29.88|W|...}} |
|---|---|
| Produces | 34.0243° N 116.1583° W |
| Code | {{Location|34|1|27.37|N|116|9|29.88|W|...}} |
|---|---|
| Produces | 34.0243° N 116.1583° W |