forsyth20121205-174063a80cc13 years agoHistory
146 lines · 4.0 KB · Text
RawDownload
.TH GEODESY 2.SH NAMEgeodesy \- Geodesy module.SH SYNOPSIS.EXinclude "geodesy.m";geodesy := load Geodesy Geodesy->PATH; # easting, northingEano: adt{	e: real;	n: real;}; # latitude, longitude in radiansLalo: adt{	la: real;	lo: real;}; OSGB36, Ireland65, ED50, WGS84, ITRS2000, ETRS89: con iota; Natgrid, IrishNatgrid, UTMEur, UTM: con iota; init: fn(d: int, t: int, z: int);format: fn(d: int, t: int, z: int);os2en: fn(s: string): (int, Eano);en2os: fn(en: Eano): string;str2lalo: fn(s: string): (int, Lalo);lalo2str: fn(lalo: Lalo): string;str2en: fn(s: string): (int, Eano);en2lalo: fn(en: Eano): Lalo;lalo2en: fn(lalo: Lalo): Eano;datum2datum: fn(lalo: Lalo, f: int, t: int): Lalo;.EE.SH DESCRIPTION.B Geodesyprovides routines to deal with (some) terrestrial coordinate systems..PPEastings and northings are defined by the.B Eanoadt and are measured in metres and latitude and longitude (which should be in radians) by the.B Laloadt. Latitude is in the range -π/2 to π/2 radians and longitude in the range -π to π radians..PP.B OSGB36(Ordnance Survey Great Britain 1936),.B Ireland65(Ireland 1965),.B ED50(European Datum 1950),.B WGS84(World Geodetic System 1984),.B ITRS2000(International Terrestrial Reference System 2000), and.B ETRS89(European Terrestrial Reference System 1989) are the current datums defined. Helmert transformations are usedto convert between them. Note that.B Ireland65and.B ED50are currently not supported and .B WGS84and .B ITRS2000are considered equivalent..PP.B Natgrid(National Grid),.B IrishNatgrid(Irish National Grid),.B UTMEur(European Universal Transverse Mercator), and.B UTM(Universal Transverse Mercator) are the current transverse Mercator projections supported..PPThe following functions are provided.TP.B initThe module should always be initialized first. The parameters arethe required datum (default WGS84), transverse Mercator projection (default Natgrid) and UTM zone (default 30) if appropriate. Negative values or out of range values areignored..TP.B formatParameters as above. Alters the current settings at any time though caremust be taken to ensure existing coordinates are still treated as in theiroriginal form..TP.B os2enConverts an Ordnance Survey National Grid reference to an easting, northing.The formats XYen, XYeenn, XYeeennn, XYeeeennnn, XYeeeeennnnn, eenn,eeennn, eeeennnn, eeeeennnnn and eeeeeennnnnn are allowed. Here X andY are upper case letters, e is an easting digit and n is a northing digit. Thereference can therefore be rounded to the nearest decakilometre, kilometre,hectometre, decametre or metre. The first element of the returned tuple is zeroif the string has an incorrect format..TP.B en2osConverts an easting, northing to an OS reference in the form XYeeeeennnnnas  above..TP.B str2laloConverts a latitude/longitude string to a latitude, longitude. The stringmay have the formats deg[N|S], deg:min[N|S] or deg:min:sec[N|S] forlatitude, deg[E|W], deg:min[E|W] or deg:min:sec[E|W] for longitude. Thelatitude must come first, then optional white space, then the longitude.Degrees, minutes and seconds may be integer or real. Format errorsare indicated as in.B os2en..TP.B lalo2strConverts a latitude, longitude to string format as above. Seconds are givento two decimal places..TP.B str2enConverts a string in OS or latitude/longitude format as above to an easting, northing.Format errors indicated as in.B os2en..TP.B en2laloConverts an easting, northing to latitude, longitude using the current transverseMercator projection.If the latter is.B UTMor.B UTMEurthe current zone setting will be used..TP.B lalo2enConverts latitude, longitude to an easting, northing using the current transverseMercator projection..TPdatum2datumApproximate (Helmert) transformation of a latitude, longitude between any of.B OSGB36,.B WGS84,.B ITRS2000or.B ETRS89.The `from' datum appears first in the parameter list..SH SOURCE.B /module/math/geodesy.m.br.B /appl/math/geodesy.b.SH BUGSThe module is heavily biased towards Great Britain.