PanGazer – coordinate formats
Latitude and longitude coordinates can be displayed in many different formats, including pure degrees, degrees and minutes, and degrees with minutes and seconds. All of these may be signed (+ or −) or may have their direction indicated by North or South of the equator (for latitude) or East or West of the Greenwich meridian (for longitude). PanGazer uses the 1984 World Geodetic System » (WGS84) coordinate system for latitudes and longitudes.
PanGazer can also display and accept location coordinates in the UTM (Universal Transverse Mercator) system.
You can select the format that PanGazer uses for displaying coordinates using the Settings → Coordinate formats menu items, which lets you choose between:
PanGazer accepts all the formats above when parsing entered coordinates in the Image → Image geography dialog (available from menus, or press the ‘g’ key).
For ‘Degrees’ formats it also accepts a number of variations, including:
For the ‘UTM’ format, PanGazer similarly accepts variations, notably allowing fractions of metres in the easting and northing values.
Here are some examples:
A more formal description of what is accepted is below.
Input Degrees formats definition
A Degrees location is described by a text string that contains two coordinates: a latitude and a longitude (in that order) in a variety of formats.
The overall Degrees format is (square brackets indicate optional parts):
[whitespace] latitude separation longitude [whitespace]
where whitespace is one or more tabs and spaces (or CRs and LFs) in any combination. separation is optional whitespace then an optional comma followed by more optional whitespace, but must include at least one tab, space, CR, LF, or comma.
latitude and longitude are of the form:
[sign] amount [sign]
where sign for latitude is one of ‘Nn+’ for a latitude north of or including the equator and is one of ‘Ss−’ for a latitude south of or including the equator; similarly, the sign for longitude is one of ‘Ee+’ for a longitude east of or including the Greenwich meridian and is one of ‘Ww−’ for a a longitude west of or including the Greenwich meridian. In both cases, only one sign (before or after the amount) is allowed, and the default sign is ‘+’.
amount is of the form:
number [degchar [number [minchar [number [secchar]]]]]
where each number is an unsigned decimal number which must start with a digit. Only the final number included in the coordinate may include an embedded decimal point and following decimal digits (fractional part). The three numbers are valued as degrees, minutes, and seconds respectively.
The first number must be in the range 0 through 90 (for latitude) or 0 through 180 (for longitude). The other two numbers may be 0 up to (but not including) 60. Extra leading zeros are permitted for all numbers.
The accepted separator characters are:
degchar: ':', 'o', or degree symbols ('\xb0', '\xba', '\xf8')
For example, the following strings are accepted:
Note that latitude and longitude are not required to use the same notations.
Input UTM format definition
A UTM location is described by a text string that contains three or four words: a zoneband word or two words, an easting word, and a northing word (in that order). If the input string does not have three or four words (or it contains a comma, e.g., “43 , -4”) then it will be parsed as a Degrees format, as described above.
The overall UTM format is (square brackets indicate optional parts):
[whitespace] zoneband whitespace easting whitespace northing [whitespace]
where whitespace is one or more tabs, CRs, LFs, and spaces in any combination.
zoneband is a one or two words:
zone [whitespace] band
where zone is an integer in the range 1 through 60 and band is an uppercase character in the range ‘C’ through ‘X’ excluding the characters ‘I’ and ‘O’.
easting and northing are both numbers, quantifying UTM easting and northing, measured in metres.
Here is a sample, valid, UTM coordinate string:
30T 358634 4808781
which converts to the latitude and longitude:
The UTM location is only accepted as valid if the result of the conversion to latitude and longitude is within the valid ranges for UTM coordinates (−180 through +180 degrees for longitude; −80 throught +84 degrees for latitude).
Note that northing is checked for consistency with band, but there are ambiguous cases (most northings can be in one of two bands).
|PanGazer and these web pages were written by Mike Cowlishaw; Please send me any corrections, suggestions, etc.|
All content Copyright © Mike Cowlishaw,
2014–2022, except where marked otherwise. All rights reserved.
The pages here, and the PanGazer program, are for non-commercial
This page was last updated on 2022-02-22 by mfc.