File geodat.icn |
########################################################################### File: geodat.icn Subject: Procedures for geodetic datum conversion Authors: William S. Evans and Gregg M. Townsend Date: July 31, 2000 ########################################################################### This file is in the public domain. ########################################################################### These procedures provide "projections" that convert among geodetic datums, which relate locations on the earth's surface to longitude and latitude coordinates. As measurement techniques improve, newer datums typically give slightly different values from older ones. The values returned here are used with the project() procedure of cartog.icn. geodat(s1, s2) defines a geodetic datum conversion. molodensky() performs an algorithmic datum conversion. nadcon(s1, s2) uses data files for more precise conversion. ellipsoid(s) return the parameters of the named ellipsoid. ########################################################################### geodat(f, t) returns a projection from longitude and latitude in datum f to longitude and latitude in datum t. f and t are strings. If f and t equal "NAD83", "NAD27", "HARN", or "HPGN", geodat returns a nadcon projection. Failing that, geodat returns a molodensky projection. The input to the projection is a list of signed numeric values, angles measured in degrees, with each pair representing one location; longitude precedes latitude. The output is a list with the same form and length as the input list. ########################################################################### nadcon(f, t) returns a projection from longitude and latitude in datum f to longitude and latitude in datum t. The strings f and t must each be one of "NAD83", "NAD27", "HARN", or "HPGN". The projection uses our implementation of the National Oceanic and Atmospheric Administration's (NOAA's) North American Datum Conversion Utility (NADCON); for more information, see http://www.ngs.noaa.gov/TOOLS/Nadcon/Nadcon.html nadcon() requires data grid (.loa and .laa) files, which must be found in the current directory or along the space-separated path given by the environment variable DPATH. These files can be downloaded from: http://www.cs.arizona.edu/icon/ftp/data/nadcon/ ftp://ftp.cs.arizona.edu/icon/data/nadcon/ The projection's input and output are lists of signed numbers. Output is properly rounded and so may not agree exactly with the equivalent NOAA programs. ########################################################################### molodensky(dx, dy, dz, ain, fin, aout, fout) returns a projection from input longitude and latitude to output longitude and latitude. The projection uses the standard Molodensky transformation. The input datum is specified by an ellipsoid with parameters ain, the equatorial radius in metres, and fin, the flattening; and by three shift values dx, dy, and dz. The output datum is specified by an ellipsoid with parameters aout and fout. If dz is null, then dx and dy are interpreted as the names of an input and output datum. The names are the ID codes specified in NIMA TR 8350.2. The projection's input and output are lists of signed numbers. ########################################################################### ellipsoid(s) return a list [a, 1/f] containing the defining parameters of the standard ellipsoid model named s; a is the equatorial radius and 1/f is the flattening factor. Names are listed in the code; the default is "WGS84". ########################################################################### Ellipsoid and datum parameters are from: Department of Defense World Geodetic System 1984 National Imagery and Mapping Agency Technical Report TR8350.2 Third Edition, Amendment 1 (3 January 2000) ftp://ftp.nima.mil/pub/gg/tr8350.2/ ########################################################################### Links: cartog, io ###########################################################################
This file is part of the (main) package.
Source code.Details |
Procedures: |
: return [a, 1/f] for named ellipsoid
gdt_nadcon_bckPoint(p, a, xpt, ypt)
gdt_nadcon_box(f, g, xcol, yrow)
gdt_nadcon_findGrid(grids, xpt, ypt)
gdt_nadcon_fwdPoint(p, a, xpt, ypt)
: define geodetic conversion
molodensky(dx, dy, dz, ain, fin, aout, fout)
: define geodetic conversion
: define NAD data conversion
Records: |
gdt_datum_rec(region, name, area, eps, dx, dy, dz, ex, ey, ez)
region | major region of datum (e.g. "Africa")
|
name | datum code name
|
area | area of datum (e.g. "Cameroon")
|
eps | ellipsoid specification (e.g. "CD")
|
dx | |
dy | |
dz | x,y,z differences from WGS84
|
ex | |
ey | |
ez | x,y,z maximum error in converted point (unused)
|
gdt_molo(proj, inv, dx, dy, dz, ain, fin, aout, fout)
proj | projection procedure (always gdt_molo_proj)
|
inv | invert myself (always gdt_molo_inv)
|
dx | |
dy | |
dz | x,y,z differences (output - input)
|
ain | |
fin | input ellipsoid specs
|
aout | |
fout | output ellipsoid specs
|
################ Standard Molodensky Datum Transformation ################## See NIMA TR 8350.2 ************************ WARNING ****************************************** NIMA TR 8350.2 contains Molodensky parameters to convert from an arbitrary datum to WGS84. To convert from datum A to datum B, I call molodensky(Ax-Bx,Ay-By,Az-Bz,Aa,Af,Ba,Bf) where Ax,Ay,Az are the shift to convert A to WGS84; Bx,By,Bz are the shift to convert B to WGS84; Aa,Af,Ba,Bf are the ellipsoid parameters. ************************ WARNING ****************************************** TODO: 1) Add special conversion for North and South pole 2) Add Multiple Regression Equations 3) Add special WGS72 to WGS84 conversion
proj | projection procedure
|
inv | invert myself
|
grids | list of gdt_nadcon_grid records to search
|
nadcon conversion record
gdt_nadcon_grid(name, offset, termLen, nc, nr, nz, xmin, xmax, dx, ymin, ymax, dy, angle)
name | name of file
|
offset | offset in file to start of grid data
|
termLen | number of chars in line termination (1 or 2)
|
nc | |
nr | |
nz | number of rows, columns in file (nz = ??)
|
xmin | |
xmax | |
dx | dimension of coverage
|
ymin | |
ymax | |
dy | |
angle | ??
|
information about a .loa and .laa file
Global variables: |