Extension:Maps/Coordinates

From semantic-mediawiki.org
Jump to: navigation, search
MapsExtension:Maps/Coordinates

Maps supports several coordinate notations which you can use in all the functionality added by it, and it's extensions.

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.3472' N, 37° 37.0580' W
  • Non-directional: 55° 45.3472', -37° 37.0580'

Degrees Minutes Seconds

Parameter value: dms

  • Directional: 55° 45' 20.83" N, 37° 37' 3.48" W
  • Non-directional: 55° 45' 20.83", -37° 37' 3.48"


Formatting coordinates

{{#coordinates:<your coordinates>|format=<your format>|directional=<yes/no>}}

Parameters

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.

Formatting 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' 20.83" N, 37° 37' 3.48" 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' 20.83" N, 37° 37' 3.48" W

Use of the coordinates tag extension.

<coordinates format="dms">55.7557860, -37.6176330</coordinates>

Results into: 55° 45' 20.83" N, 37° 37' 3.48" W

<coordinates format="dd" directional="no">55.7557860, -37.6176330</coordinates>

Results into: 55.755786°, -37.617633°


See also

  • Maps/Geodistance – A parser hook for finding the distance between two locations.
  • Maps/Finddestination – A parser hook for finding a location giving a starting point, an initial bearing, and a distance.