Template:CoordDec: Difference between revisions
meta>MaxSem default type to nothing |
m 12 revisions imported |
||
(One intermediate revision by one other user not shown) | |||
Line 1: | Line 1: | ||
<includeonly>{{#invoke:coordinates|coord|{{{1|}}}|{{{2|}}}|{{#invoke: | <includeonly>{{#invoke:coordinates|coord|{{{1|}}}|{{{2|}}}|{{#invoke:String|join|_|{{#if:{{{dim|}}}|dim:{{{dim}}}}}|{{#if:{{{globe|}}}|globe:{{{globe}}}}}|{{#if:{{{scale|}}}|scale:{{{scale}}}}}|{{#if:{{{region|}}}|region:{{{region}}}}}|{{#if:{{{source|}}}|source:{{{source}}}}}|{{#if:{{{type|}}}|type:{{{type}}}}}}}| format={{{format|}}}| display={{{display|}}} | name={{{name|}}} }}<!-- | ||
-->{{#coordinates:{{{1|}}}|{{{2|}}}|dim={{{dim|}}}|globe={{{globe|}}}|scale={{{scale|}}}|region={{{region|}}}|type={{{type|}}} | -->{{#coordinates:{{{1|}}}|{{{2|}}}|dim={{{dim|}}}|globe={{{globe|}}}|scale={{{scale|}}}|region={{{region|}}}|type={{{type|}}} | ||
|{{#switch:{{{display|}}} | |{{#switch:{{{display|}}} |
Latest revision as of 12:59, 3 September 2020
This template uses Lua: |
A version of the {{Coord}} template where the latitude and longitude are specified by signed decimal numbers. It has been designed to work well with the Visual Editor/TemplateData system.
Usage
{{CoordDec| ''decimal latitude'' | ''decimal longitude'' | display=inline,title}}
- Example
{{CoordDec| -41.289 | 174.777 | display=inline}}
gives Lua error: callParserFunction: function "#coordinates" was not found.{{#coordinates: -41.289 | 174.777 |dim=|globe=|scale=|region=|type=
|
|name=
}}
No alternate set of parameter are available for this template. See {{CoordDMS}} for angles specified in degrees minutes and seconds, and {{CoordDM}} for when just degrees and minutes are specified.
These coordinates are in degrees and minutes.
- Map datum must be WGS84 (except for off-earth bodies).
- Avoid excessive precision (0.0001° is <11 m, 1″ is <31 m).
- Latitude (N/S) must appear before longitude (E/W).
Optional parameters are all named parameters in the form name=value
- display
|display=inline
(the default) to display in the body of the article only,|display=title
to display at the top of the article only, or|display=inline,title
to display in both places.
- name
|name=X
to label the place on maps (default is PAGENAME)
- notes
|notes=
text displayed immediately following the coordinates,
- format How the coordinates are displayed
|format=dec
decimal format|format=dms
degrees minutes and seconds format
Optional geodata coordinates parameters, the old geohack format with colon and underscore is not supported
- dim: approximate size of the object, used to scale the map to fit.
- scale: Scale of map display for this object, e.g. scale of 300 is 1:300. Gets converted into dim internally using formula dim = scale / 10. If both scale and dim are set, dim has precedence.
- globe: earth by default, can be one of earth, mercury, venus, moon, mars, phobos, deimos, ganymede, callisto, io, europa, mimas, enceladus, tethys, dione, rhea, titan, hyperion, iapetus, phoebe, miranda, ariel, umbriel, titania, oberon, triton and pluto
- name: name of this point, up to 255 bytes (UTF-8).
- region: ISO 3166-1 alpha-2 country code (e.g. US or RU) or an ISO 3166-2 region code (e.g. US-FL or RU-MOS). This parameter is always capitalised internally.
- type: type of object with these coordinates, can be one of the following: country, satellite, state, adm1st, adm2nd, adm3rd, city, isle, mountain, river, waterbody, event, forest, glacier, airport, railwaystation, edu, pass, camera, landmark.
Thus: {{CoordDec | -41.289 | 174.777 | dim=30 | region=US-WI | type=event | display=inline,title | name=accident site}}
Use |display=title
(or |display=inline,title
) once per article, for the subject of the article, where appropriate.
Per WP:ORDER, the template is placed in articles after any navigation templates, but before any Defaultsort templates, or Categories.
- For full details, refer to Template:Coord/doc.
- Additional guidance is available: obtaining coordinates, converting coordinates
Template Data
Encodes the latitude and longitude coordinates of a location specified in degrees and minutes, provides a link to map of the location.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Latitude | 1 | The latitude in decimal format with negative for south eg -79.38. Avoid excessive precision, 0.01° is approximately 1k m and 0.0001° is approximately 10 m | Number | required |
Longitude | 2 | The longitude in decimal format, negative for west eg -79.38. Avoid excessive precision, 0.01° is approximately 1k m and 0.0001° is approximately 10 m | Number | required |
Display | display | Where it is displayed. Can be one of: 'inline' in the body of the article (default), 'title' at the top of the article or 'inline,title' both | String | optional |
Name | name | a label to place on maps (default is PAGENAME) | String | optional |
Notes | notes | text displayed immediately following the coordinates | String | optional |
Format | format | How the coordinates are displayed, either 'dec' or 'dms' | String | optional |
Dim | dim | approximate size of the object, used to scale the map to fit. | String | optional |
Scale | scale | Scale of map display for this object, e.g. scale of 300 is 1:300. Gets converted into ''dim'' internally using formula ''dim = scale / 10''. If both scale and dim are set, dim has precedence. | String | optional |
Globe | globe | earth by default, can be one of earth, mercury, venus, moon, mars, phobos, deimos, ganymede, callisto, io, europa, mimas, enceladus, tethys, dione, rhea, titan, hyperion, iapetus, phoebe, miranda, ariel, umbriel, titania, oberon, triton and pluto | String | optional |
Region | region | [[ISO 3166-1 alpha-2]] country code (e.g. ''US'' or ''RU'') or an [[ISO 3166-2]] region code (e.g. ''US-FL'' or ''RU-MOS''). This parameter is always capitalised internally. | String | optional |
Type | type | type of object with these coordinates, can be one of the following: country, satellite, state, adm1st, adm2nd, adm3rd, city, isle, mountain, river, waterbody, event, forest, glacier, airport, railwaystation, edu, pass, camera, landmark. | String | optional |