1. Home
  2. GBGRIDCONVERSION procedure

GBGRIDCONVERSION procedure

Converts GB grid references to or from latitudes and longitudes or to or from UTM coordinates (R.W. Payne).

Options

INPUT SOURCE = string token Which of the coordinate systems if acting as input for conversion to either of the other two systems (gridreferencegeographicalutm); default geog
GRIDREFERENCES = scalars or variates Grid references
LATITUDES = scalars or variates Latitudes
LONGITUDES = scalars or variates Longitudes
EASTINGS = scalars or variates UTM easting references
NORTHINGS = scalars or variates UTM northing references
GRIDACCURACY = string token
The accuracy for saving grid references (kilometreshectometresdekametresmetres); default hect

No parameters

Description

GBGRIDCONVERSION can convert between three coordinate systems: firstly British grid references, secondly geographical latitude and longitude coordinates, and thirdly eastings and northings in the Universal Transverse Mercator (UTM) coordinate system; see UTMCONVERSION procedure for details. The grid references are supplied or saved, in a text, by the GRIDREFERENCES option. The other coordinates are supplied or saved by the LATITUDESLONGITUDESEASTINGS and NORTHINGS options. These can be scalars for a single location, or variates for several.

The INPUTSOURCE option specifies which of these is to provide the input for conversion to the other two, with settings:

gridreferences for GRIDREFERENCES,
geographical for LATITUDES and LONGITUDES, and
utm for EASTINGS and NORTHINGS.

The GRIDACCURACY option controls the accuracy of the grid references that are formed i.e. how may digits are used. The available settings are:

kilometres saves references with two letters and four digits, giving accuracy to the nearest kilometre;
hectmetres saves references with two letters and six digits, giving accuracy to the nearest hectometre (i.e. 100 metres);
dekametres saves references with two letters and eight digits, giving accuracy to the nearest dekametre (i.e. 10 metres);
metres saves references with two letters and ten digits, giving accuracy to the nearest metre. The default is hectmetres, giving the most common style, e.g. TL059066. 

The default is hectmetres, giving the most common style, e.g. TL059066. A space is inserted in the middle of the references with eight and ten digits, e.g. TL05921 06642.

Options: INPUTSOURCE, GRIDREFERENCES, LATITUDES, LONGITUDES, EASTINGS, NORTHINGS, GRIDACCURACY.
Parameters: none.

Method

UKGRIDCONVERSION uses UTMCONVERSION to convert latitudes and longitudes to or from eastings and northings. The eastings and northings are converted to or from grid references using the standard Genstat manipulation commands.

Action with RESTRICT

If any of the options GRIDREFERENCES, LATITUDES, LONGITUDES, EASTINGS or NORTHINGS is restricted, only the units not excluded by the restriction will be analysed.

See also

Procedure: UTMCONVERSION.

Example

CAPTION          'GBGRIDCONVERSION example'; STYLE=meta
GBGRIDCONVERSION [GRIDREFERENCE=ROGgridref; LATITUDE=51.476852;\
                 LONGITUDE=-0.000500]
PRINT            [IPRINT=*]\
                 'Grid reference for Royal Observatory Greenwich:',ROGgridref
GBGRIDCONVERSION [INPUTSOURCE=gridreference; GRIDREFERENCE='TL059066';\
                 LATITUDE=Amblat; LONGITUDE=Amblong]
PRINT            [IPRINT=*]\
                 'Latitude and longitude for Amberside, Hemel Hempstead:',\
                 Amblat,'&',Amblong; FIELD=1; DECIMALS=4
Updated on September 12, 2019

Was this article helpful?