Help:Coordinates
|
Coordinates |
Maps supports several coordinate notations which you can use in all the functionality added by it, and it's extensions.
Contents |
Supported formats
All underneath formats are supported in both directional and non-directional notation. Directional notation uses letters such as N, E, S and W to indicate the 'direction' of a value, where non-directional notation uses positive and negative values.
Floats
Parameter value: float
- Directional: 55.7557860 N, 37.6176330 W
- Non-directional: 55.7557860, -37.6176330
Decimal Degrees
Parameter value: dd
- Directional: 55.7557860° N, 37.6176330° W
- Non-directional: 55.7557860°, -37.6176330°
Decimal Minutes
Parameter value: dm
- Directional: 55° 45.347' N, 37° 37.058' E
- Non-directional: 55° 45.347', 37° 37.058'
Degrees Minutes Seconds
Parameter value: dms
- Directional: 55° 45' 21" N, 37° 37' 3" W
- Non-directional: 55° 45' 21", -37° 37' 3"
Formatting coordinates
You can format coordinates using the #coordinates parser hook.
Syntax
{{#coordinates:{your coordinates}|format={your format}|directional={yes/no}}}
Parameters
This parser function supports use of so called 'default parameters'. This allows you to simply pass along values, without writing the parameter name= part. You can mix this notation together with using named parameters, but must at all times keep the default ones in the correct order. This order is location, format and directional.
| Parameter | Aliases | Default | Usage |
|---|---|---|---|
| location | - | required | The coordinates you want to format. |
| format | notation | configurable | The target format for the coordinates. |
| directional | - | configurable | Indicates if the coordinates should be outputted directional or not. Must be either yes or no. |
Examples
Coordinates in directional decimal degrees to the default target format.
{{#coordinates:55.7557860° N, 37.6176330° W}}
{{#coordinates:location=55.7557860° N, 37.6176330° W}}
All result into: 55° 45' 21" N, 37° 37' 3" W
Coordinates in non-directional floats to directional DMS.
{{#coordinates:55.7557860, -37.6176330|format=dms|directional=yes}}
{{#coordinates:55.7557860, -37.6176330|dms|yes}}
{{#coordinates:55.7557860, -37.6176330|directional=yes|dms}}
All result into: 55° 45' 21" N, 37° 37' 3" W
Use of the coordinates tag extension.
<coordinates format="dms">55.7557860, -37.6176330</coordinates>
Results into: 55° 45' 21" N, 37° 37' 3" W
<coordinates format="dd" directional="no">55.7557860, -37.6176330</coordinates>
Results into: 55.755786°, -37.617633°
See also
- Geodistance - A parser hook for finding the distance between two locations.
- Finddestination - A parser hook for finding a location giving a starting point, an initial bearing, and a distance.
