Jump to content

Template:Coord/doc: Difference between revisions

m
Text replacement - "|" to "|"
(Remove test)
m (Text replacement - "|" to "|")
 
(33 intermediate revisions by 4 users not shown)
Line 8: Line 8:
== Purpose  ==
== Purpose  ==


{{Tl|Coord}} provides a standard notation for encoding locations by their {{Wpd|Latitude}} and {{Wpd|Longitude}} coordinates. It is primarily for specifying the {{Wpd|World Geodetic System|WGS84}} geographic coordinates of locations on {{Wpd|Earth}}. However, it can also encode locations on natural satellites, dwarf planets, and planets other than Earth.
{{Tl|Coord}} provides a standard notation for encoding locations by their {{Wpd|Latitude}} and {{Wpd|Longitude}} coordinates. It is primarily for specifying the {{Wpd|World Geodetic System|WGS84}} geographic coordinates of locations on {{Wpd|Earth}}. However, it can also encode locations on natural satellites, dwarf planets, and planets other than Earth. <!--
 
<!--
*To specify celestial coordinates, use {{tl|sky}} instead.  
*To specify celestial coordinates, use {{tl|sky}} instead.  
*Tag articles which lack coordinates (but need them) with {{tl|coord missing}}.  
*Tag articles which lack coordinates (but need them) with {{tl|coord missing}}.  
*If the subject's location is truly unknown or disputed, note this with {{tl|coord unknown}}.
*If the subject's location is truly unknown or disputed, note this with {{tl|coord unknown}}.


See also [[wikipedia:WikiProject Geographical coordinates|RTENOTITLE]].  
See also [[wikipedia:WikiProject Geographical coordinates]].
-->


== Features  ==
== Features  ==
Line 22: Line 19:
Latitude and longitude may be specified (with appropriate precision) either in decimal notation or as degrees/minutes/seconds. By default, coordinates appear in the format used to specify them. However, the <code>format=</code> parameter can be used to force display in a particular format.  
Latitude and longitude may be specified (with appropriate precision) either in decimal notation or as degrees/minutes/seconds. By default, coordinates appear in the format used to specify them. However, the <code>format=</code> parameter can be used to force display in a particular format.  


The template displays the formatted coordinates with a {{Wpd|Hyperlink}} to <!--[[Tswiki:GeoHack|GeoHack]] -->[http://wiki.toolserver.org/view/GeoHack GeoHack]. GeoHack displays information customized to the location, including links to external mapping services. <!-- NOT IMPLEMENTED -- For {{Wpd|Terrestrial}} locations, a blue globe ([[Image:Erioll world.svg|18px]]) appears to the left of the hyperlink. Clicking on the globe activates the [[:meta:WikiMiniAtlas|WikiMiniAtlas]] (requires {{Wpd|JavaScript}}).  
The template displays the formatted coordinates with a {{Wpd|Hyperlink}} to <!--[[Tswiki:GeoHack|GeoHack]] -->[http://wiki.toolserver.org/view/GeoHack GeoHack]. GeoHack displays information customized to the location, including links to external mapping services. <!-- NOT IMPLEMENTED -- For {{Wpd|Terrestrial}} locations, a blue globe ([[Image:Erioll world.png|18px]]) appears to the left of the hyperlink. Clicking on the globe activates the [[:meta:WikiMiniAtlas|WikiMiniAtlas]] (requires {{Wpd|JavaScript}}).  
-->By default, coordinates appear "in line" with the adjacent text. However, the <code>display=</code> parameter can be used to move the coordinates up near the page title—or display them in both places at once.  
-->By default, coordinates appear "in line" with the adjacent text. However, the <code>display=</code> parameter can be used to move the coordinates up near the page title—or display them in both places at once.  


Line 47: Line 44:
{| class="wikitable FCK__ShowTableBorders"
{| class="wikitable FCK__ShowTableBorders"
|-
|-
| {{coord&#124;10.2&#124;N&#124;-20.3&#124;E&#124;'''type:'''city}}  
| {{coord|10.2|N|-20.3|E|'''type:'''city}}  
| Replaces {{coor d&#124;10.2&#124;N&#124;-20.3&#124;E&#124;city}}
| Replaces {{coor d|10.2|N|-20.3|E|city}}
|-
|-
| {{coord&#124;44.4&#124;-111.1&#124;'''type:city_region:US'''&#124;display=inline,title}}  
| {{coord|44.4|-111.1|'''type:city_region:US'''|display=inline,title}}  
| Replaces {{Geolinks-'''US-cityscale'''&#124;44.4&#124;-111.1}}
| Replaces {{Geolinks-'''US-cityscale'''|44.4|-111.1}}
|-
|-
| {{coord&#124;51.01234&#124;-1.56789&#124;'''type:landmark_region:GB'''&#124;display=inline,title}}  
| {{coord|51.01234|-1.56789|'''type:landmark_region:GB'''|display=inline,title}}  
| Replaces {{Geolinks-'''UK-buildingscale'''&#124;51.01234&#124;-1.56789}}
| Replaces {{Geolinks-'''UK-buildingscale'''|51.01234|-1.56789}}
|-
|-
| {{coord&#124;-35.5&#124;150.1&#124;'''type:landmark_region:AU'''&#124;display=inline,title}}  
| {{coord|-35.5|150.1|'''type:landmark_region:AU'''|display=inline,title}}  
| Replaces {{Mapit-'''AUS-suburbscale'''&#124;lat=-35.5&#124;long=150.1}}
| Replaces {{Mapit-'''AUS-suburbscale'''|lat=-35.5|long=150.1}}
|-
|-
| {{coord&#124;12&#124;34&#124;12&#124;N&#124;45&#124;33&#124;45&#124;W&#124;'''display=title'''}}  
| {{coord|12|34|12|N|45|33|45|W|'''display=title'''}}  
| Replaces {{'''CoorHeader'''&#124;12&#124;34&#124;12&#124;N&#124;45&#124;33&#124;45&#124;W}}
| Replaces {{'''CoorHeader'''|12|34|12|N|45|33|45|W}}
|}
|}
-->
-->
Line 70: Line 67:
  '''&#123;{coord|'''''dd'''''|'''''mm'''''|'''''N/S'''''|'''''dd'''''|'''''mm'''''|'''''E/W'''''|'''''[[#1|coordinate parameters]]'''''|'''''[[#2|template parameters]]'''''}&#125;'''
  '''&#123;{coord|'''''dd'''''|'''''mm'''''|'''''N/S'''''|'''''dd'''''|'''''mm'''''|'''''E/W'''''|'''''[[#1|coordinate parameters]]'''''|'''''[[#2|template parameters]]'''''}&#125;'''
  '''&#123;{coord|'''''dd'''''|'''''mm'''''|'''''ss'''''|'''''N/S'''''|'''''dd'''''|'''''mm'''''|'''''ss'''''|'''''E/W'''''|'''''[[#1|coordinate parameters]]'''''|'''''[[#2|template parameters]]'''''}&#125;'''
  '''&#123;{coord|'''''dd'''''|'''''mm'''''|'''''ss'''''|'''''N/S'''''|'''''dd'''''|'''''mm'''''|'''''ss'''''|'''''E/W'''''|'''''[[#1|coordinate parameters]]'''''|'''''[[#2|template parameters]]'''''}&#125;'''


There are two kinds of parameters, all optional:  
There are two kinds of parameters, all optional:  
Line 79: Line 75:


:*'''display=''' can be one of the following:
:*'''display=''' can be one of the following:
::*<code>display=text</code> – Display the text inline (default) <!--
::*<code>display=inline</code> – Display the coordinate inline (default)  
::*<code>display=inline</code> – Display the coordinate inline (default)  
::*<code>display=title</code> – Display the coordinate near the article title (replaces {{tl|coor title dms}} family)  
::*<code>display=title</code> – Display the coordinate near the article title<!-- (replaces {{tl|coor title dms}} family)
::**shortcut: <code>display=t</code>
::**shortcut: <code>display=t</code> -->  
::*<code>display=inline,title</code> – Display the coordinate both inline and at title (replaces {{tl|coor at dms}} family)  
::*<code>display=inline,title</code> – Display the coordinate both inline and at title <!-- (replaces {{tl|coor at dms}} family)
::**shortcut: <code>display=it</code>
::**shortcut: <code>display=it</code> -->
::*<code>display=title,inline</code> has the same effect as <code>display=inline,title</code>
::*<code>display=title,inline</code> has the same effect as <code>display=inline,title</code>
::Note: the <code>title</code> attribute indicates that the coordinates apply to the entire article, and not just one of (perhaps many) places mentioned in it — so it should only be omitted in the latter case.
::Note: the <code>title</code> attribute indicates that the coordinates apply to the entire article, and not just one of (perhaps many) places mentioned in it — so it should only be omitted in the latter case.
-->
:*'''format=''' can be used to force ''dec'' or ''dms'' coordinate display.
:*'''format=''' can be used to force ''dec'' or ''dms'' coordinate display.
::*<code>format=dec</code> reformats the coordinates to <span style="text-decoration: underline">decimal degrees</span> format.  
::*<code>format=dec</code> reformats the coordinates to <span style="text-decoration: underline">decimal degrees</span> format.  
::*<code>format=dms</code> reformats the coordinates to <span style="text-decoration: underline">degrees | minutes | seconds</span> format.
::*<code>format=dms</code> reformats the coordinates to <span style="text-decoration: underline">degrees | minutes | seconds</span> format.
::*<code>format=text</code> display text instead of the coordinates using <code>pre-link-text</code>, <code>link-text</code>, and <code>post-link-text</code> parameters.
:*'''name=''' can be used to annotate inline coordinates for display in map services such as the [[:meta:WikiMiniAtlas|WikiMiniAtlas]]. If omitted, the article title (PAGENAME) is assumed.
:*'''name=''' can be used to annotate inline coordinates for display in map services such as the [[:meta:WikiMiniAtlas|WikiMiniAtlas]]. If omitted, the article title (PAGENAME) is assumed.
::Note: a ''name='' parameter causes {{tl|Coord}} to emit an [[HCard]] [[Microformat]] using that name, ''even if used within an existing hCard''. Do not use when the name is that of a person (e.g for a gravesite), as the generated hCard would be invalid. Also, do not use square brackets in names.
::Note: a ''name='' parameter causes {{tl|Coord}} to emit an [[HCard]] [[Microformat]] using that name, ''even if used within an existing hCard''. Do not use when the name is that of a person (e.g for a gravesite), as the generated hCard would be invalid. Also, do not use square brackets in names.
:*'''notes=''' specifies text to be displayed immediately following the coordinates. This is primarily intended for adding footnotes to title coordinates.  
:*'''notes=''' specifies text to be displayed immediately following the coordinates. This is primarily intended for adding footnotes to title coordinates.
:*'''text=''' specifies text to be displayed in place of the coordinates.
:The following are only used when <code>format=text</code> and for overriding the defaults. They allow specifying the text to be displayed in place of just the coordinates. Spaces at the beginning or end of the string requires a '&amp;nbsp;' instead of a plain space.:
:*'''pre-link-text=''' The default is no text.  
:*'''link-text=''' The default is 'Click here'
:*'''post-link-text=''' The default is '&amp;nbsp;to view information about this location'.


== Examples  ==
== Examples  ==


{| class="wikitable FCK__ShowTableBorders"
{| class="wikitable FCK__ShowTableBorders"
|-
|- valign="top"
| <code><nowiki>{{coord|43.651234|-79.383333}}</nowiki></code>  
| width="25%" | <code><nowiki>{{coord|43.651234|-79.383333}}</nowiki></code>  
| {{coord|43.651234|-79.383333|format=dec}}  
| width="25%" | {{coord|43.651234|-79.383333|format=dec}}  
| Toronto – Fully decimal – N &amp; W
| width="50%" | Toronto – Fully decimal – N &amp; W
|-
|- valign="top"
| <code><nowiki>{{coord|43.65|-79.38}}</nowiki></code>  
| <code><nowiki>{{coord|43.65|-79.38}}</nowiki></code>  
| {{coord|43.65|-79.38}}  
| {{coord|43.65|-79.38}}  
| Toronto – less precise
| Toronto – less precise
|-
|- valign="top"
| <code><nowiki>{{coord|43.6500|-79.3800}}</nowiki></code>  
| <code><nowiki>{{coord|43.6500|-79.3800}}</nowiki></code>  
| {{coord|43.6500|-79.3800}}  
| {{coord|43.6500|-79.3800}}  
| Toronto – medium precision with trailing zeroes
| Toronto – medium precision with trailing zeroes
|-
|- valign="top"
| <code><nowiki>{{coord|43.651234|N|79.383333|W}}</nowiki></code>  
| <code><nowiki>{{coord|43.651234|N|79.383333|W}}</nowiki></code>  
| {{coord|43.651234|N|79.383333|W}}  
| {{coord|43.651234|N|79.383333|W}}  
| Toronto – decimal with Northing &amp; Westing
| Toronto – decimal with Northing &amp; Westing
|-
|- valign="top"
| <code><nowiki>{{coord|43|29|N|79|23|W}}</nowiki></code>  
| <code><nowiki>{{coord|43|29|N|79|23|W}}</nowiki></code>  
| {{coord|43|29|N|79|23|W}}  
| {{coord|43|29|N|79|23|W}}  
| Toronto – degrees &amp; minutes
| Toronto – degrees &amp; minutes
|-
|- valign="top"
| <code><nowiki>{{coord|43|29|4|N|79|23|0|W}}</nowiki></code>  
| <code><nowiki>{{coord|43|29|4|N|79|23|0|W}}</nowiki></code>  
| {{coord|43|29|4|N|79|23|0|W}}  
| {{coord|43|29|4|N|79|23|0|W}}  
| Toronto – degrees, minutes &amp; seconds
| Toronto – degrees, minutes &amp; seconds
|-
|- valign="top"
| <code><nowiki>{{coord|43|29|4.5|N|79|23|0.5|W}}</nowiki></code>  
| <code><nowiki>{{coord|43|29|4.5|N|79|23|0.5|W}}</nowiki></code>  
| {{coord|43|29|4.5|N|79|23|0.5|W}}  
| {{coord|43|29|4.5|N|79|23|0.5|W}}  
| Toronto – degrees, minutes, seconds &amp; fractions of seconds
| Toronto – degrees, minutes, seconds &amp; fractions of seconds
|-
|- valign="top"
| <code><nowiki>{{coord|55.752222|N|37.615556|E}}</nowiki></code>  
| <code><nowiki>{{coord|55.752222|N|37.615556|E}}</nowiki></code>  
| {{coord|55.752222|N|37.615556|E}}  
| {{coord|55.752222|N|37.615556|E}}  
| Moscow – N &amp; E
| Moscow – N &amp; E
|-
|- valign="top"
| <code><nowiki>{{coord|55.752222|N|37.615556|E|format=dms}}</nowiki></code>  
| <code><nowiki>{{coord|55.752222|N|37.615556|E|format=dms}}</nowiki></code>  
| {{coord|55.752222|N|37.615556|E|format=dms}}  
| {{coord|55.752222|N|37.615556|E|format=dms}}  
| Convert to dms format
| Convert to dms format
|-
|- valign="top"
| <code><nowiki>{{coord|39.098095|-94.587307|format=dms}}</nowiki></code>  
| <code><nowiki>{{coord|39.098095|-94.587307|format=dms}}</nowiki></code>  
| {{coord|39.098095|-94.587307|format=dms}}  
| {{coord|39.098095|-94.587307|format=dms}}  
| Decimal conversion without N/S/E/W
| Decimal conversion without N/S/E/W
|-
|- valign="top"
| <code><nowiki>{{coord|55.752222|N|37.615556|E|format=dec|name=Moscow}}</nowiki></code>  
| <code><nowiki>{{coord|55.752222|N|37.615556|E|format=dec|name=Moscow}}</nowiki></code>  
| {{coord|55.752222|N|37.615556|E|format=dec|name=Moscow}}  
| {{coord|55.752222|N|37.615556|E|format=dec|name=Moscow}}  
| Convert to decimal and label on some maps
| Convert to decimal and label on some maps
|-
|- valign="top"
| <code><nowiki>{{coord|33|55|S|18|25|E}}</nowiki></code>  
| <code><nowiki>{{coord|33|55|S|18|25|E}}</nowiki></code>  
| {{coord|33|55|S|18|25|E}}  
| {{coord|33|55|S|18|25|E}}  
| Cape Town – S &amp; E
| Cape Town – S &amp; E
|-
|- valign="top"
| <code><nowiki>{{coord|35|00|N|105|00|E}}</nowiki></code>  
| <code><nowiki>{{coord|35|00|N|105|00|E}}</nowiki></code>  
| {{coord|35|00|N|105|00|E}}  
| {{coord|35|00|N|105|00|E}}  
| People's Republic of China
| People's Republic of China
|-
|- valign="top"
| <code><nowiki>{{coord|22|54|30|S|43|14|37|W}}</nowiki></code>  
| <code><nowiki>{{coord|22|54|30|S|43|14|37|W}}</nowiki></code>  
| {{coord|22|54|30|S|43|14|37|W}}  
| {{coord|22|54|30|S|43|14|37|W}}  
| Rio – S &amp; W
| Rio – S &amp; W
|-
|- valign="top"
| <code><nowiki>{{coord|22|S|43|W}}</nowiki></code>  
| <code><nowiki>{{coord|22|S|43|W}}</nowiki></code>  
| {{coord|22|S|43|W}}  
| {{coord|22|S|43|W}}  
| A {{Wpd|Degree Confluence Project|degree confluence}}.
| A {{Wpd|Degree Confluence Project|degree confluence}}.
|-
|- valign="top"
| <code><nowiki>{{coord|22|54|30|S|43|14|37|W|format=text}}</nowiki></code>
| {{coord|22|54|30|S|43|14|37|W|format=text}}
| Rio – S &amp; W in a text format instead of a coordinate format.
|}
 
{| class="wikitable FCK__ShowTableBorders"
|- valign="top"
| <code><nowiki>{{coord|52|28|N|1|55|W|notes=<ref>{{cite web|url=http://www.fallingrain.com/world/UK/0/Birmingham.html|title=Birmingham}}</ref>|display=inline,title|region:GB_type:city}}</nowiki></code>  
| <code><nowiki>{{coord|52|28|N|1|55|W|notes=<ref>{{cite web|url=http://www.fallingrain.com/world/UK/0/Birmingham.html|title=Birmingham}}</ref>|display=inline,title|region:GB_type:city}}</nowiki></code>  
| {{coord|52|28|N|1|55|W|notes=<REF>{{cite web|url=http://www.fallingrain.com/world/UK/0/Birmingham.html|title=Birmingham}}</REF>|display=inline,title|region:GB_type:city}}  
| {{coord|52|28|N|1|55|W|notes=<REF>{{cite web|url=http://www.fallingrain.com/world/UK/0/Birmingham.html|title=Birmingham}}</REF>|display=inline,title|region:GB_type:city}}  
| Birmingham – with display, notes, and parameter settings; note display also in title of this page.
| Birmingham – with display, notes, and parameter settings; note display also in title of this page. NOT FULLY IMPLEMENTED. Was second to last example.
|}
|}


Line 171: Line 176:
== Coordinate parameters  ==
== Coordinate parameters  ==


The first unnamed parameter following the longitude is an optional string of coordinate parameters, separated by underscores. These parameters help [[Tswiki:GeoHack|GeoHack]] select suitable map resources, and they will become more important when [[Meta:Wikimaps|Wikimaps]] becomes fully functional.  
The first unnamed parameter following the longitude is an optional string of coordinate parameters, separated by underscores. These parameters help [https://wiki.toolserver.org/view/GeoHack GeoHack] select suitable map resources, and they will become more important when [[Meta:Wikimaps|Wikimaps]] becomes fully functional.  


===== type:''T''  =====
===== type:''T''  =====
Line 183: Line 188:
===== dim:''D''  =====
===== dim:''D''  =====


{{Coord-doc-dim}}
Coord-doc-dim


===== region:''R''  =====
===== region:''R''  =====
Line 195: Line 200:
===== source:''S''  =====
===== source:''S''  =====


{{Coord-doc-source}}
Coord-doc-source


== Per-user display customization  ==
== Per-user display customization  ==


{{UF-coord-classes}}
UF-coord-classes


== Incorrect uses and maintenance category  ==
== Incorrect uses and maintenance category  ==