Template:Inline coordinates/doc

From Infogalactic: the planetary knowledge core
Jump to: navigation, search

<templatestyles src="Module:Hatnote/styles.css"></templatestyles>

Purpose

{{Inline coordinates}} provides a standard notation for encoding locations by their latitude and longitude coordinates. It is primarily for specifying the WGS84 geographic coordinates of locations on Earth. However, it can also encode locations on natural satellites, dwarf planets, and planets other than Earth.

Features

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 format= parameter can be used to force display in a particular format.

The template displays the formatted coordinates with a hyperlink to GeoHack. GeoHack displays information customized to the location, including links to external mapping services.

For terrestrial locations (and locations on moon, mercury, venus, mars, and io), a blue globe (Erioll world.svg) appears to the left of the hyperlink. Clicking on the globe activates the WikiMiniAtlas (requires JavaScript).

By default, coordinates appear "in line" with the adjacent text. Use {{location}} for other work.

The template outputs coordinates in three formats:

  • Degree/minutes/seconds ("DMS", precision is degrees, or degrees/minutes, or degrees/minutes/seconds, based on input precision).
  • Decimal degrees (varying the number of decimal places based on input precision)
  • Geo microformat.

Usage

{{inline coordinates|latitude|longitude|coordinate parameters|template parameters}}
{{inline coordinates|dd|N/S|dd|E/W|coordinate parameters|template parameters}}
{{inline coordinates|dd|mm|N/S|dd|mm|E/W|coordinate parameters|template parameters}}
{{inline coordinates|dd|mm|ss|N/S|dd|mm|ss|E/W|coordinate parameters|template parameters}}

There are two kinds of parameters, all optional:

  • Coordinate parameters are parameters that {{Inline coordinates}} passes to the map server. These have the format parameter:value and are separated from each other by the underscore character ( _ ). The supported coordinate parameters are dim:, globe:, region:, scale:, source:, and type:. See coordinate parameters for details and examples.
  • Template parameters are parameters used by the {{Inline coordinates}} template. These have format parameter=value and are separated from each other by the pipe character ( | ). The supported template parameters are format=, name=, and notes=.
  • format= can be used to force dec or dms coordinate display.
  • format=dec reformats the coordinates to decimal degrees format.
  • format=dms reformats the coordinates to degrees | minutes | seconds format.
  • name= can be used to annotate inline coordinates for display in map services such as the WikiMiniAtlas. If omitted, the article title (PAGENAME) is assumed.
Note: a name= parameter causes {{Inline coordinates}} 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.
  • label= specifies text for the link to be alternatively displayed instead of the coordinates. Do not use together with name!
  • notes= specifies text to be displayed immediately following the coordinates. This is primarily intended for adding footnotes to title coordinates.

Examples

{{Inline coordinates|43.651234|-79.383333}} [http:Lua error in package.lua at line 80: module 'strict' not found.43.651234_N_-79.383333_E_ 43°39′04″N 79°23′00″W / 43.651234°N 79.383333°W / 43.651234; -79.383333] Toronto – Fully decimal – N & W
{{Inline coordinates|43.65|-79.38}} [http:Lua error in package.lua at line 80: module 'strict' not found.43.65_N_-79.38_E_ 43°39′N 79°23′W / 43.65°N 79.38°W / 43.65; -79.38] Toronto – less precise
{{Inline coordinates|43.6500|-79.3800}} [http:Lua error in package.lua at line 80: module 'strict' not found.43.6500_N_-79.3800_E_ 43°39′00″N 79°22′48″W / 43.6500°N 79.3800°W / 43.6500; -79.3800] Toronto – medium precision with trailing zeroes
{{Inline coordinates|43.651234|N|79.383333|W}} [http:Lua error in package.lua at line 80: module 'strict' not found.43.651234_N_79.383333_W_ 43°39′04″N 79°23′00″W / 43.651234°N 79.383333°W / 43.651234; -79.383333] extra parameters (d format) in {{Coord}} Toronto – decimal with Northing & Westing
{{Inline coordinates|43|29|N|79|23|W}} [http:Lua error in package.lua at line 80: module 'strict' not found.43_29_N_79_23_W_ 43°29′N 79°23′W / 43.483°N 79.383°W / 43.483; -79.383] extra parameters (dm format) in {{Coord}} Toronto – degrees & minutes
{{Inline coordinates|43|29|4|N|79|23|0|W}} [http:Lua error in package.lua at line 80: module 'strict' not found.43_29_4_N_79_23_0_W_ 43°29′4″N 79°23′0″W / 43.48444°N 79.383333°W / 43.48444; -79.383333] Toronto – degrees, minutes & seconds
{{Inline coordinates|43|29|4.5|N|79|23|0.5|W}} [http:Lua error in package.lua at line 80: module 'strict' not found.43_29_4.5_N_79_23_0.5_W_ 43°29′4.5″N 79°23′0.5″W / 43.484583°N 79.383472°W / 43.484583; -79.383472] Toronto – degrees, minutes, seconds & fractions of seconds
{{Inline coordinates|55.752222|N|37.615556|E}} [http:Lua error in package.lua at line 80: module 'strict' not found.55.752222_N_37.615556_E_ 55°45′08″N 37°36′56″E / 55.752222°N 37.615556°E / 55.752222; 37.615556] extra parameters (d format) in {{Coord}} Moscow – N & E
{{Inline coordinates|55.752222|N|37.615556|E|format=dms}} [http:Lua error in package.lua at line 80: module 'strict' not found.55.752222_N_37.615556_E_ 55°45′08″N 37°36′56″E / 55.752222°N 37.615556°E / 55.752222; 37.615556] extra parameters (d format) in {{Coord}} Convert to dms format
{{Inline coordinates|39.098095|-94.587307|format=dms}} [http:Lua error in package.lua at line 80: module 'strict' not found.39.098095_N_-94.587307_E_ 39°05′53″N 94°35′14″W / 39.098095°N 94.587307°W / 39.098095; -94.587307] Decimal conversion without N/S/E/W
{{Inline coordinates|55.752222|N|37.615556|E|format=dec|name=Moscow}} [http:Lua error in package.lua at line 80: module 'strict' not found.55.752222_N_37.615556_E_&title=Moscow 55°45′08″N 37°36′56″E / 55.752222°N 37.615556°E / 55.752222; 37.615556 (Moscow)] extra parameters (d format) in {{Coord}} Convert to decimal and label on some maps
{{Inline coordinates|33|55|S|18|25|E}} [http:Lua error in package.lua at line 80: module 'strict' not found.33_55_S_18_25_E_ 33°55′S 18°25′E / 33.917°S 18.417°E / -33.917; 18.417] extra parameters (dm format) in {{Coord}} Cape Town – S & E
{{Inline coordinates|35|00|N|105|00|E}} [http:Lua error in package.lua at line 80: module 'strict' not found.35_00_N_105_00_E_ 35°00′N 105°00′E / 35°N 105°E / 35; 105] extra parameters (dm format) in {{Coord}} People's Republic of China
{{Inline coordinates|22|54|30|S|43|14|37|W}} [http:Lua error in package.lua at line 80: module 'strict' not found.22_54_30_S_43_14_37_W_ 22°54′30″S 43°14′37″W / 22.90833°S 43.24361°W / -22.90833; -43.24361] Rio – S & W
{{Inline coordinates|22|S|43|W}} [http:Lua error in package.lua at line 80: module 'strict' not found.22_S_43_W_ 22°S 43°W / 22°S 43°W / -22; -43] extra parameters (d format) in {{Coord}} A degree confluence
{{Inline coordinates|52.516389|13.377778|label=Berlin, Brandenburg Gate}} [http:Lua error in package.lua at line 80: module 'strict' not found.52.516389_N_13.377778_E_ 52°30′59″N 13°22′40″E / 52.516389°N 13.377778°E / 52.516389; 13.377778] another link text instead of coordinates for Brandenburg Gate;
first version decimal, second version dms
{{Inline coordinates|52|30|59|N|13|22|40|E|label=Brandenburg Gate in Berlin}} [http:Lua error in package.lua at line 80: module 'strict' not found.52_30_59_N_13_22_40_E_ 52°30′59″N 13°22′40″E / 52.51639°N 13.37778°E / 52.51639; 13.37778]

References

Coordinate parameters

The first unnamed parameter following the longitude is an optional string of coordinate parameters, separated by underscores. These parameters help GeoHack select suitable map resources, and they will become more important when Wikimaps becomes fully functional.

type:T

{{Wikipedia:WikiProject Geographical coordinates/type:}}

scale:N

{{Wikipedia:WikiProject Geographical coordinates/scale:}}

dim:D

The dim: parameter defines the diameter of a viewing circle centered on the coordinate. While the default unit of measurement is metres, the km suffix may be appended to indicate kilometres.

GeoHack uses dim: to select a map scale such that the viewing circle appears roughly 10 centimetres (4 in) in diameter on a 72 dpi computer monitor. If no dim:, type:, or scale: parameters are provided, GeoHack uses its default viewing circle of 30 kilometres (19 mi).

Samples
Subject View diameter Markup Result
Western Hemisphere 10,000 kilometres (6,200 mi) {{coord|0|N|90|W|dim:10000km}} Lua error in package.lua at line 80: module 'strict' not found.
Ohio 400 kilometres (250 mi) {{coord|40.5|-82.5|dim:400km}} Lua error in package.lua at line 80: module 'strict' not found.
Dresden 20,000 metres (12 mi) {{coord|51.033|13.73|dim:20000}} Lua error in package.lua at line 80: module 'strict' not found.
Statue of Liberty 100 metres (330 ft) {{coord|40.6892|-74.0445|dim:100}} Lua error in package.lua at line 80: module 'strict' not found.
region:R

{{Wikipedia:WikiProject Geographical coordinates/region:}}

globe:G

{{Wikipedia:WikiProject Geographical coordinates/globe:}}

source:S
  1. REDIRECT Wikipedia:WikiProject Geographical coordinates/source:

Per-user display customization

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

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

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

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

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

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

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].)

To disable display of the blue globe adjacent to coordinates, add this to your common.js:

var wma_settings = {enabled:false}

Note that this will disable WikiMiniAtlas.

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

Incorrect uses and maintenance category

The template has some input checks built in. Most errors display a bold, red message inline and categorize the article in the hidden maintenance category Coord template needing repair. There is/are currently 0 page(s) in that category. See the category description for further instructions.

A daily report of coordinates needing repair is at tools:~dispenser/view/File viewer#log:coord-commonswiki.log.

See also: en:WT:GEO#To do

Internals

See Template:Coord/doc/internals and Category:Coord template.

Class names

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