Template:Coord

From Linguistic Team International Wiki
Revision as of 16:41, 10 August 2015 by Ray (talk | contribs) (Created page with "includeonly{{Coord/display/{{{display|inline}}}|1={{Coord/input/{{#ifeq:{{{4|}}}||dec|{{#if:{{#switch:{{{4}}}{{{8}}}|NE|NW|SE|SW=y}}|dms|{{#if:{{#switch:{{{3}}}{{{6}}}|NE|NW|S...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

includeonlyTemplate:Coord/display/inline!--

--!-- 
--!-- 
--!-- 
--/includeonlynoinclude
[edit] Template-info.svg Template documentation

table class=shortcutbox noprint style=float: right; border: 1px solid #aaa; background: #fff; margin: .3em .3em .3em 1em; padding: 3px; text-align: center;trth style=border: none; background: transparent;!-- Putting anchors on page: --span id=WP:COORD/span!-- Adding the shortcut links: --smallShortcut: br WP:COORD/small/table!-- Reporting if the first parameter is not a valid non-bracketed shortcut name: --noinclude Template loop detected: Template:Documentation !-- Add categories and interwikis to the /doc subpage, not here! -- /noinclude

noinclude

Template loop detected: Template:Documentation !-- Add cats and interwikis to the /doc subpage, not here! -- /noinclude

Quick guide

Template:Coord how-to

Purpose

This template, {{coord}}, produces a link to a list of map sources, based on the geographical coordinates and other parameters, and provides a standardized notation for the coordinates.

The template is for WGS84 geographical coordinates (latitude;longitude) on Earth, which can be entered in either decimal notation, or degrees/minutes/seconds parameters, with the appropriate precision.

It links to http://stable.toolserver.org/geohack/geohack.php?pagename=Template:Coordparams=noinclude Template loop detected: Template:Documentation !-- Add cats and interwikis to the /doc subpage, not here! -- /noinclude, then displays the coordinates. Clicking the blue globe Erioll world.svg activates the WikiMiniAtlas (needs Javascript).

The template outputs data in:

  • Degree/minutes/seconds (DMS, precision is degrees, or degrees/minutes, or degrees/minutes/seconds, based on input). Some conversions from decimal degrees to dms need fixing (see talk)
  • Decimal (precision by number of decimal places, based on input)
  • Geo microformat.

{{coord}} is used by tools which parse the raw Wikipedia database dumps, such as Google Earth. To ensure that the coordinates are parsed correctly display=title must be used. See How do I get my Wikipedia article to show up in the Google Earth Geographic Web layer?. The template must not be modified without prior discussion.

For articles which have no coordinates, but need them, use {{coord missing}}.

See also Wikipedia:WikiProject Geographical coordinates.

Superseded templates

This single template supersedes {{coor d}}, {{coor dm}}, {{coor dms}}, {{coor at d}}, {{coor at dm}}, {{coor at dms}}, {{coor title d}}, {{coor title dm}}, {{coor title dms}}, and the Geolinks and Mapit templates. All parameters can be used as before - see Usage.

Examples: table class=wikitable trtd#123;{coord|12|N|45|W|display=title}#125;/tdtdReplaces #123;{coor title d|12|N|45|W}#125;/tdtd/td/tr

trtd#123;{coord|12|34|N|45|33|W|display=title}#125;/tdtdReplaces #123;{coor title dm|12|34|N|45|33|W}#125;/tdtd/td/tr

trtd#123;{coord|12|34|56|N|45|33|22|W|display=title}#125;/tdtdReplaces #123;{coor title dms|12|34|56|N|45|33|8|W}#125;/tdtd/td/tr

trtd#123;{coord|12|34|12|N|45|33|45|W|display=inline,title}#125;/tdtdReplaces #123;{coor at dms|12|34|12|N|45|33|45|W}#125;/tdtdYes check.svgspan style=display:noneY/spannoinclude Template loop detected: Template:Documentation /noinclude Donenoinclude Template loop detected: Template:Documentation /noinclude/td/tr

trtd#123;{coord|10.2|-20.3|display=inline}#125; or #123;{coord|10.2|-20.3}#125;/tdtdReplaces #123;{coor d|10.2|N|-20.3|E}#125;/tdtd/td/tr

trtd#123;{coord|44.4|-111.1|type:city_region:US|display=inline,title}#125;/tdtdReplaces #123;{Geolinks-US-cityscale|44.4|-111.1}#125;/tdtd/td/tr

trtd#123;{coord|51.01234|-1.56789|type:landmark_region:GB|display=inline,title}#125;/tdtdReplaces #123;{Geolinks-UK-buildingscale|51.01234|-1.56789}#125;/tdtd/td/tr

trtd#123;{coord|-35.5|150.1|type:landmark_region:AU|display=inline,title}#125;/tdtdReplaces #123;{Mapit-AUS-suburbscale|lat=-35.5|long=150.1}#125;/tdtd/td/tr

trtd#123;{coord|12|34|12|N|45|33|45|W|display=title}#125;/tdtdReplaces #123;{CoorHeader|12|34|12|N|45|33|45|W}#125;/tdtdYes check.svgspan style=display:noneY/spannoinclude Template loop detected: Template:Documentation /noinclude Donenoinclude Template loop detected: Template:Documentation /noinclude/td/tr

/table

Usage

#123;{coord|latitude|longitude|coordinate parameters|template parameters}#125;
#123;{coord|dd|N/S|dd|E/W|coordinate parameters|template parameters}#125;
#123;{coord|dd|mm|N/S|dd|mm|E/W|coordinate parameters|template parameters}#125;
#123;{coord|dd|mm|ss|N/S|dd|mm|ss|E/W|coordinate parameters|template parameters}#125;

There are two kinds of parameters, all optional:

  • span id=1Coordinate parameters/span: Recognised by the map server, given in the format parameter:value and separated from each other with the underscore character '_'. Common coordinate parameters include type, region, and scale. See coordinate parameters for a comprehensive list.
  • span id=2Template parameters/span: Used by the template itself, given in the format parameter=value and separated from each other with the pipe character '|'. The supported template parameters are display, name and format.
    • display can be one of the following:
      • codedisplay=inline/code - Display the coordinate inline (default)
      • codedisplay=title/code - Display the coordinate by the article title (replaces {{coor title dms}} family), shortcut: codedisplay=t/code
      • codedisplay=inline,title/code - Display the coordinate both inline and at title (replaces {{coor at dms}} family) br Note: using the codetitle/code attribute indicates that the coordinates apply to the article, and not just one of (perhaps many) places mentioned in it mdash; so it should only be omitted in the latter case. codedisplay=title,inline/code works also. Shortcut: codedisplay=it/code
    • format can be used to force dec or dms coordinate display for all readers
    • name can be used to annotate inline coordinates for display in map services and other external use. It should not be used with coordinates in the article title or within an infobox, as in those cases the name is implicit from the article title.

Examples

codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Toronto - Fully decimal - N W
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Toronto - less precise
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Toronto - medium precision with trailing zeroes
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Toronto - decimal with Northing Westing
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Toronto - degrees minutes
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Toronto - degrees, minutes seconds
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Toronto - degrees, minutes, seconds fractions of seconds
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Moscow - N E
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Convert to dms format
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Decimal conversion without N/S/E/W
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Convert to decimal and label on some maps
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Cape Town - S E
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
China, People's Republic of
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Rio - S W
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
A degree confluence
codenowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki/code
includeonlyTemplate:Coord/display/inline,title!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude
Birmingham - with display and parameter settings; note display also in title of this page.

Coordinate parameters

Following the geographical coordinate, further parameters can optionally be supplied, separated by underscores. This will help in finding suitable map resources, and will become more important when the Wikimaps become fully functional.

type:T

Template:Coord-doc-type

scale:N

Template:Coord-doc-scale

region:R

Template:Coord-doc-region

globe:G

Template:Coord-doc-globe

source:S

Template:Coord-doc-source

Display

By default coordinates are displayed in the format in which they are specified.

To always display coordinates as DMS values, add this to your monobook.css:

code.geo-default { display: inline }br /.geo-nondefault { display: inline }br /.geo-dec { display: none }br /.geo-dms { display: inline }/code

To always display coordinates as decimal values, add this to your monobook.css:

code.geo-default { display: inline }br /.geo-nondefault { display: inline }br /.geo-dec { display: inline }br /.geo-dms { display: none }/code

To display coordinates in both formats, add this to your monobook.css:

code.geo-default { display: inline }br /.geo-nondefault { display: inline }br /.geo-dec { display: inline }br /.geo-dms { display: inline }br /.geo-multi-punct { display: inline }/code

If CSS is disabled, or you have an old copy of MediaWiki:Common.css cached, you will see both formats. (You can either clear your cache or manually refresh this URL: [1].)

See also Wikipedia:Manual of Style (dates and numbers)#Geographical coordinates. noinclude /noinclude

Name

If an article contains several display=inline coordinates, each of these may be supplied with a unique name. This name will be used to display the coordinate on the WikiMiniAtlas, and will cause the template 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.

Incorrect uses and maintenance category

The template has a few input checks built in. Basic errors display the message on Coord/input/ERROR (see Special:WhatLinksHere/Template:Coord/input/ERROR for pages to fix)

A series of other input errors categorize the pages in the maintenance category Coord template needing repair. See the category description for more details. There are currently 0 pages in that category.

Subtemplates

See Category:Coord template

name function
Coord/input/d converts coordinates from input in degrees format nowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki
Coord/input/dm converts coordinates from input in degrees/minutes format nowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki
Coord/input/dms converts coordinates from input in degrees/minutes/seconds format nowikiincludeonlyTemplate:Coord/display/inline!--
--!-- 
--!-- 
--!-- 
--/includeonlynoincludeTemplate loop detected: Template:Template doc/noinclude/nowiki
Coord/display/inline creates output to display coordinates inline
Coord/display/title creates output to display above the article (generally to the right of the article's title)
Coord/display/inline,title creates output to display coordinates inline and above the article

Class names

The class names geo, latitude and longitude are used to generate the microformat and MUST NOT be changed.

External links

includeonly !-- ADD CATEGORIES BELOW THIS LINE -- !-- ADD INTERWIKIS BELOW THIS LINE -- af:Sjabloon:Coord ca:Template:Coord es:Plantilla:Coord eo:Ŝablono:Koord fr:Modèle:Coord fur:Model:Coord hsb:Předłoha:Koord ia:Patrono:Coord it:Template:Coord ja:Template:Coord no:Mal:Koordinater pl:Szablon:Koordynaty pt:Predefinição:Coord ro:Format:Coord ru:Template:Coord simple:Template:Coord sl:Predloga:Koord sv:Mall:Coord uk:Шаблон:Координати vo:Samafomot:Coord zh:Template:Coord /includeonly

/noinclude