[FWTools] Compressing geoid model?

Charles Karney charles.karney at sri.com
Wed Jun 8 07:04:23 EST 2011


On 06/08/11 05:49, Mikael Rittri wrote:
 > I've now experimented with using lower vertical resolution.
 > In the original egm2008-5.pgm, the vertical resolution is 3 mm
 > (there is also an offset, to make the most of the UInt16 range).
 >
 > When I added
 >
 >      -ot Int16 -scale 0 65000 -10800 8700
 >
 > to the gdal_translate command, converting to 1 cm resolution
 > (and no offset), the resulting file is 6484 KB (64 percent less
 > than original).
 >
 > And when I instead used
 >
 >      -ot Int16 -scale 0 65000 -1080 870
 >
 > converting to 1 dm resolution, the resulting file is 2600 KB
 > (86 percent less than original).
 >
 > This is of course lossy compression, and probably not in the
 > spirit of GeographicLib, but at least I know how much accuracy
 > that can be lost.

The file you started with, egm2008-5.pgm, is already "lossy", since the
heights are quantized to 3mm.

I think an interesting question to ask is "what is the most compact
respresentation of the data if I am willing to tolerate an error of up
to X mm?"  The knobs you have at your disposal are:

(1) the grid spacing
(2) the quantization
(3) the compression method
(4) the interpolation method

You might be able to use a 1-byte reprensentation of the heights if you
subtract off some low order spherical harmonic components.  There's no
reason not to experiment with lossy file compression (e.g., JPEG)
providing the resulting errors are quantified.

http://geographiclib.sourceforge.net/html/geoid.html#testgeoid

has test data for you to use.  egm2008 might be too bumpy to be reliably
represented on a 5' grid (cubic interpolation results in a 0.3m max
error and higher order interpolation will probably not help).

Has anyone got the NGA synthesis program

   hsynth_WGS84.f

running under Linux?  I get NaNs when running the unoptimized version
(compiled with gfortran 4.4.4) and a Bus error with the optimized
version.  This may be a program with the code, but I wonder about the
compiler too.

-- 
Charles Karney <charles.karney at sri.com>
SRI International, Princeton, NJ 08543-5300
Tel: +1 609 734 2312


More information about the FWTools mailing list