Pillars of Eternity Wiki
Advertisement
Pillars of Eternity Wiki
Template-info.png Template documentation

Formats and validates a latitude (bottom to top / Y) and longitude (left to right / X), each a degree of rotation around the Earth from the equator and prime meridian respectively. The latitude ranges from -90 to 90, while longitude is from -180 to 180.

  • DMS: Degrees/minutes/seconds system - Where the decimal point is represented as minutes (') which are 1/60th of a degree, and seconds (") which are 1/60th of a minute. All values are absolute non-negative numbers, and each coordinate has a cardinal direction to indicate the direction of travel. For latitude, positive is "N" towards the north pole, and negative is "S" towards the south pole. For longitude, positive is "E" east of the prime meridian, and negative is "W" west of the prime meridian. Depending on the requirement, seconds are often left out.
  • DD/DEC: Decimal degrees system - Where the latitude and longitude are represented as decimal values and can be negative or positive.

In Deadfire, the X and Y/Z coordinates are represented in the DMS system, with seconds left out (also called a DM system). The bottom left of the map is lat -40 lng 30, and the top right is lat 10 lng 70. This range is not validated in the template

Validation

Coordinates may be passed in either form, e.g.:

  • Degrees-minutes-seconds (DMS) or degrees-minutes (DM) system
    • {{coord|1|23|45|N|67|8|9|E}}
    • {{coord|1|23|N|4|56|E}}
  • Decimal degrees system (DEC)
    • {{coord|12.34|-56.78}}
    • {{coord|12.34|N|56.78|W}}

The module "guesses" the input coordinate system based on the amount of numbers and strings passed as unnamed parameters. It assumes that:

  • Decimal degree system - If 2 numbers are passed, and optionally 2 strings
  • Degrees minutes system - If 4 numbers are passed, and optionally 2 strings
  • Degrees minutes seconds system - If 6 numbers are passed, and optionally 2 strings

If any other combination is passed, or if the amount of parameters is uneven (not balanced on both sides), the input system is considered invalid.

Cardinal/hemisphere indicators are optional for all systems, and must be 'N' or 'S' for the latitude, and 'E' or 'W' for the longitude (case insensitive). If cardinal indicators are passed, the lat/lng values must not be negative.

Range for all degree values must be 0 to 90 (or -90 to 90 if a indicator is NOT passed) for the latitude, and 0 to 180 (or -180 to 180 if an indicator NOT is passed) for the longitude, all values inclusive.

The range for a minutes and seconds in degrees-minutes-seconds or degrees-minutes system must be 0 (inclusive) to 60 (exclusive). These values can never be negative.

In DMS and DM systems, only the least significant value may be a decimal value (e.g. 123.45), while all others must be integers. Although fractionals are technically correct, they can be confusing.

Parameters

1-8
As above, a mix of values forming the latitude longitude coordinate.
format
An output format, one of:
  • dec - Outputs in DEC format, trimmed to the shortest representation in decimal places - e.g. 123.45° N, 12.34° W
  • dms - Outputs in DMS format, seconds are always present - e.g. 123° 4′ 56″ N, 78° 9′ 10″ W
  • dm (default) - Outputs in DM format, minutes are always present - 123° 04′ N, 78° 09′ W

Examples

System Example Output
Decimal
degrees
{{coord|43.651234|-79.383333|format=dec}} 43.6512° N, 79.3833° W
{{coord|43.651234|79.383333|format=dm}} 43° 39.074′ N, 79° 23′ W
{{coord|43.651234|N|79.383333|W|format=dms}} 43° 39′ 4″ N, 79° 22′ 59″ W
Degrees
& minutes
{{coord|43|29|N|79|23|W|format=dec}} 43.4833° N, 79.3833° W
{{coord|43|29.0|N|79|23.2|W|format=dm}} 43° 29′ N, 79° 23.2′ W
{{coord|43|29|-79|23|format=dms}} 43° 29′ 0″ N, 79° 23′ 0″ W
Degrees,
minutes,
& seconds
{{coord|43|29|13|N|79|23|02|W|format=dec}} 43.4869° N, 79.3839° W
{{coord|43|29|13|N|79|23|02|W|format=dm}} 43° 29.2167′ N, 79° 23.0333′ W
{{coord|43|29|13|-79|23|02|format=dms}}} 43° 29′ 13″ N, 79° 23′ 2″ W

Errors

Problem Example Output
Unbalanced coordinates {{coord|43|29|13|N|79|23|W}} Lua error in Module:Coord at line 268: Odd number of arguments specified, both sides must be balanced.
Unknown format {{coord|43|32|13|S}} Lua error in Module:Coord at line 268: Unknown coordinate format, refer to documentation for valid formats.
Invalid indicator {{coord|43|P|13|W}} Lua error in Module:Coord at line 268: Invalid cardinal indicator for latitude, must be 'N' or 'S'.
Conflicting indicator {{coord|-43|29|N|79|23|W}} Lua error in Module:Coord at line 268: All values must be positive when a cardinal indicator is used!.
Out of range
(latitude)
{{coord|91|29|N|79|23|W}} Lua error in Module:Coord at line 268: Latitude coordinates with a cardinal indicator must be in the range 0 to 90 inclusive.
Out of range
(longitude)
{{coord|43|29|-181|23}} Lua error in Module:Coord at line 268: Longitude coordinates without a cardinal indicator must be in the range -180 to 180 inclusive.
Out of range
(min/sec)
{{coord|43|65|79|23}} Lua error in Module:Coord at line 268: Minutes and seconds values must be in the range 0 to 60.
Fractional used in significant value {{coord|43|29.243|14|79|23|35}} Lua error in Module:Coord at line 268: Only the least significant value present may be a decimal value.
Unknown output format {{coord|43|29|79|23|format=abc}} Lua error in Module:Coord at line 268: Unknown output format. Must be one of 'dec', 'dms', 'dm'.
Advertisement