I have made some modifications to the original source as I
was trying to get Channel Islands grid references working.
As a result CI and XD prefixed squares now work, and there
is an additional cigrtoll for WV and WA references, which
may or may not work as expected. -- Chris
Programs for conversion of latitude and longitude to national
grids of Great Britain and Ireland, and vice versa
K.D. Bennett
Department of Plant Sciences
University of Cambridge
This package consists of four utility programs to make
conversions from latitude and longitude to national grid co-
ordinates for Great Britain and Ireland. They are not finely
polished programs, but working utilities that do a job. There is
a limited amount of checking on the input, for example, but
bizarre input may produce bizarre results.
The programs are:
lltogbgr Converts latitude and longitude to
co-ordinates of the Great Britain grid
lltoirgr Converts latitude and longitude to
co-ordinates of the Ireland grid
gbgrtoll Converts co-ordinates of the Great
Briatin grid to latitude and longitude
irgrtoll Converts co-ordinates of the Ireland
grid to latitude and longitude
Each program can be run with no options, in which case it will
prompt for input.
Input grid values should be in the form "TL933937" (for Great
Britain) and "C367821" (for Ireland): note that there are no
spaces.
Input latitude and longitude values on the command line take the
form "1 34 56 55 32 10", where the first three values are
degrees, minutes and seconds for longitude, and the second three
values are degrees, minutes and seconds for latitude. All six
values must be present, but decimals are allowed, and values can
be zero: "1 30 30 55 30 0" is equivalent to "1 30.5 0 55.5 0 0".
For longitudes WEST of Greenwich, the degree value should be
entered as negative.
If the lltoxxgr programs are run without options, they prompt for
each of the six input values in turn.
Conversion from longitude and latitude is by exact calculation
using formulae and constants from the publications of the
Ordnance Surveys of the two areas (see below). The reverse
calculation is by successive approximation (make a guess, see how
close it is, make a better guess, etc), and thus takes a little
longer.
Output has been tested against examples given by the Ordnance
Surveys and against values from maps. I use these programs, and I
have put some effort into checking their accuracy. But I cannot
accept responsibility for any errors or problems caused by use of
these programs.
If you use the programs and find them useful, please let me know.
If you use them and find them in error, I would also be
interested to know.
The programs are available by anonymous ftp to
ftp-palecol.plantsci.cam.ac.uk, in directory pub/ll-to-gr.
There is zipped package of the four MS-DOS executables, together
with a copy of this README (ll-to-gr.zip), and a gzipped archive
file (ll-to-gr.tar.gzip) of the source code, a makefile, and a
copy of this README. The source code is ANSI C, with no frills,
and should compile on any ANSI C compiler.
References
Ordnance Survey 1995. The ellipsoid and the Transverse Mercator
Projection. Geodetic Information Paper No 1. Ordnance Survey,
Southampton.
Ordnance Survey 1950. Constants, formulae and methods used in
Transverse Mercator Projection. HMSO, London.
Ordnance Survey 1967. The history of the retriangulation of Great
Britain 1935-1962. HMSO, London.
Ordnance Survey 1953. Tables for the Transverse Mercator
Projection of Ireland. Ordnance Survey Office, Dublin.
Disclaimer
Copyright (C) 1994 by K.D. Bennett. No portion of these programs
may be reproduced for use by a commercial facility without
express written consent of the author. This work is supported in
part by the University of Cambridge. Neither the author, nor this
institution, nor any of its employees, makes any warranty,
express or implied, or assumes any legal liability or
responsibility for the usefulness of any portion of this program.
This copyright message and disclaimer must accompany any
reproduced portion of this program.
|