Professional Documents
Culture Documents
A Two-Dimensional Interpolation For Irregularly-Spaced Data Function
A Two-Dimensional Interpolation For Irregularly-Spaced Data Function
Harvard College
Cambridge, Massachusetts
INTRODUCTION
In many fields using empirical areal data there arises
a need for interpolating from irregularly-spaced data
to produce a continuous surface. These irregularlyspaced locations, hence referred to as " d a t a points,"
may have diverse meanings: in meterology, weather
observation stations; in geography, surveyed locations;
in city and regional planning, centers of data-collection
zones; in biology, observation locations. It is assumed
that a unique number (such as rainfall in meteorology,
or altitude in geography) is associated with each data
point.
In order to display these data in some type of contour map or perspective view, to compare them with
data for the same region based on other data points,
or to analyze them for extremes, gradients, or other
purposes, it is extremely useful, if not essential, to
define a continuous function fitting the given values
exactly. Interpolated values over a fine grid may then
be evaluated. In using such a function it is assumed
that the original data are without error, or that compensation for error will be made after interpolation.
In essence, an operational solution to the problem
of two-dimensional interpolation from irregularly-spaced
data points is desired. It is assumed that a finite
number N of triplets (xi, Yi, gi) a r e given, where xi,
Yi are the locational coordinates of the data point D;,
and zi is the corresponding data value. Data point
locations may not be coincident. An interpolation
function z=f(x,y) to assign a value to any location
P(x,y) in the plane is sought. This two-dimensional
interpolation function is to be " s m o o t h " (continuous
and once differentiable), to pass through the specified
points, (i.e., f(xi,Yi)=Zi), and to meet the user's intuitive expectations about the phenomenon under investigation. Furthermore, the function should be suitable
for computer application at reasonable cost.
EXISTING APPROACHES
Although many solutions to related problems in twodimensional interpolation have been in long use, inter-
polation functions making an exact fit for irregularlyspaced data are rare. When the data points already
form a regular lattice, many solutions are possible.
Among the most significant solutions for a rectangular
grid are fitting a hyperbolic paraboioid to each four data
points by double linear interpolation x, fitting a polynomial to the surrounding 4, 9, 16 or 25 points using
Newton's divided differences formyla (discussed in 2
and3), or employing bicubic spline interpolation. 4 For
a triangular lattice, fitting a plane to each three points
is easy and effective. Downing ,has developed a computer contouring program which interpolates intervening points from a square lattice, making possible planar
interpolation over a triangular grid. 5 If irregular datapoint locations are allowed and continuity is not required, algorithms such as Tobler's double quadratic
surface interpolation 6 are possible. Finally, if the interpolation function need not fit the given values exactly,
trend surface fitting 7 may be appropriate to reduce
distortion from possible data error.
Even within the stipulations of continuity and exact
fit, some of the preceding methods for regular data
locations may be extended to irregularly-spaced data,
but they tend to be cumbersome or unduly arbitrary.
One solution is to connect pairs of data points until the
section of the plane containing the data points has
been partitioned into triangles; or a mixture of quadrilaterals and triangles. Nordbeck and Bengtsson used
triangles, fitting a plane to the three triplets defining
each triangle, s Fisher used quadrilaterals in the interior
of the region and triangles at the boundary? He employed double linear interpolation over the quadrilaterals and planar interpolation over the triangles. These
two solutions are attractive since both are computationally simple once the requisite subdivision of the domain
has been carried out. They involve fitting a collection
of local, easily-evaluated functions to the original data.
A serious drawback is the necessity of forming a network among the points to determine how the domain
for interpolation is to be partitioned. The resulting
interpolation is sensitive to this partition, but no adequate means of establishing it is available. The suggestion (mentioned in 8) that the network be chosen to
minimize the sum of the perimeters of the three-and
four-sided sub-domains, has been too complex 1o follow
517
518
f~(p) =
[~:,
,(di)-Uzil /[
i=1
(u>o)
p-.~D i
function fj(P)is continuous.
Choice of Exponent
Using coordinates P(x,y) and Di(xi,yi),
ferentiation yields:
partial dif-
f,.,.(x,y) =
I E (di)-l:
i=l
3)
4)
Cne = { Dii,Di2 . . . .
Finally, let
C'e =
[i
Ce
re
ifO <n(Ce)<4
/f4<n(Ce)<_10
if 10<n(Cj,)
i ' (Ce)
andr'e =
7./-r 2
7 6).
To select and weigh interpolating data points, a collection C' of data points near P and final search radius
(#'/ AT),
Din }
and
519
if n(C)<4
if 4 < n ( C ) < 10.
Lr,(C]. )
if
10<n(C)
ifo<d<_3
71
d
1.2
r'
if'~ <d<r'
if r' <d
t-0
/
f2(P) = I.Zi
''" '
Disc
,,
,o, a,, o,
520
Including Direction
E Wj (Zi--Zi) (X--Xi)
DjEC~'
(d[Dj, Di])2
,i :
il-<os<
'Po-')i]lr
'
wizi] //! O i C ,
wj (zTzD (yj- YD
DisC:'
B i ~.
Cbi.--{Di}.
Then
(dIDj, Di]) 2
DisC;' wj
DeterminingSlope
Despite the foregoing modifications to the weighting
function, it should be recalled that for P sufficiently
near some data point D i ( d i is small), si will equal di-~
and wi will vary a s d / 2 as in the original interpolation
function. As before, the interpolated surface will still
have zero gradient at every D~. To correct this undesirable property, increments were added to the function
values at nearby data points so that the interpolated
surface would achieve desired partial derivatives at D~.
First, constants A i and B i a r e determined for each
data point Di representing the desired slope in the x
and y directions at Di. Ai and Bi are weighted averages of divided differences of z about Di. Let Ci" =
and
X ,s,]
lz,~,~C
DisC;' J
JILDj~C J .
f3(e) =
Ai
3x
= Ai
(Azi)
and
.~(Azi)
= B i.
X=X i
x~-xi
y=Yi
Y=Yi
f4(e) =
s o m e DisC'
P-"Di
avoided by establishing some e, depending on the computer's precision, and defining f(P)=zi within an ~neighborhood of D i. If several data points occur within
an ~-neighborhood Ne(P) of P, then their values are
averaged.
Although the interpolation function is technically discontinuous, the discontinuity is of the same order as
machine error times the magnitude of the gradient.
Error created by this e - n e i g h b o r h o o d is no greater
than that caused elsewhere by machine imprecision. In
practice the problem is insignificant because the function is evaluated at discrete points only. The final
interpolation function is thus given by:
II ~
DisC'
f(P) =
[ ~_,
zi] ,/ [ ~,
A] if di<e for
Di~N~.(P)
DicN~(P)
some Di
521
Properties of f(P)
The interpolation function f(P) defined above meets
all the explicit requirements initially postulated. The
surface defined by f(P) is continuously differentiable
everywhere except at barriers where discontinuities are
deliberately specified. The surface assumes the required
value at all data points. On a digital computer the
evaluation of interpolated values is reasonably straightforward. Partial deprivatives at data points are based
on a notion of what they " s h o u l d " be, an average
of first divided differences from nearby known values.
The final interpolation function may have extrema
anywhere, not just at data points. The range of the
interpolation function is up to 10% greater at either
end than the range of the initial values zi. The inter~
polation function is defined at every point in.the plane.
It thus has the ability to extrapolate naturally outside
the smallest polygon whose closure contains all the
data points. At large distances from this polygon the
interpolated value will be approximately the average
of the values at the four nearest data points.
APPLICATIONS
The principal application to date of the foregoing
interpolation function has been its programming in
F O R T R A N IV and its incorporation into a mapping
program, SYMAP Versions IV and VJ Following is
an example of a contour map produced on the IBM
7094 in 0.2 minutes using SYMAP Version V. Four
data points were specified with the coordinates and
values below. The range of the original data point
values has been divided into five equal levels, and
the lowest and highest levels extended to include all
interpolated values. The special symbols were produced
on a high-speed printer by superimposing standard alphanumeric characters.
522
Proceedings--1968
ACM
LEVLL
National Conference
****o****
....
l ....
++++f+
+++++++*
++++2++++
.....0...
++++H+++
.........
+++++++++
oo.oo.ooo
SYMBOLS
* ....
7-
+"-~
I ....
4 - - - - - 2. . . .
----3
I ~+++~+++++++++++++
I ++++++++++++
I
++++~++
I+~+++++++H++++++
~++~ ++ +++++~+++++++
....
ooooooooo
000000000
000030000
000000000
000000000
+....
+++++++
I **++++++++++
6-
O l I N
@ @ M ~
IlIIIIIII
~ @ ~
IIII~IIII
@@@~d~@
IIIIlIIII
. . . . ~ . ~ ..... I I I I
eeeeeeeee
+. . . .
5....
6....
+. . . .
~+ ++~
"" :'"'"'"
+++++++++++
I ++
+++
+++++
+ +++
1 ++
+
++++++++~
~ +
++++~+
?. . . .
eeeeeeel
eeee eeeI
I
+++
.....
oeeeooe
"'.'"."
oomeooeoeooooeoo
.oooeoeo
eeoc
"'"'"..I
ooeooooI
,ooeoeoooeeoooooeoeeoeeo
oooI
++
~++
eoe eoooeoe
oooeeeeoeo
oeooeooo
eooo
oeo I
ooosoeeo
ooooooooooooooooooeo~o
ooo].
eeoeoeoe
eeeeooeoeooeooooeeoeeoeoeI
I++++++*+++*++Z+++++++++++++++++
o . . o o . . o o . o o o o . o o e o e . . . o e . . . o . * I
I
oeoeooooooeoeoooooooooooooo
I +
++ ++++
+
+
ooooooooeoooooooo
I
+4"4"4"4"++++++++4"+++++4"4"
+4"+++++4"++++++++++
4-+++
*************************************************
5-
+....
eooooooeooooooeoo..oeooooooooeeoeI
++++++
~+~
~. . . .
eee.eeeeee
e.eee.eeeeeeeeeeeee
eeeeeeeeee
eee eeeeeeeeeeeeeeee
oooeoooooeeooeeoooeoooeooeooooooeeooeee
i+.++.+.+++++++++++++++++
~
+++I
. . o o . . .
I*+++*++++++++
++++++++++++*+++++++++++*++++++++++++++++
++*++++++++*+
I ++++ ++ ++*++++++++++++H++++++++++++*+++++++++H++++
I ++ + ++ ++++++++++++++++++++++++++++
++++++++++++++++++++++++++
2++++++++++++*++++*++++++++++++++++++++++++++++++++++++++++++++++
I+++++++
++ ++++++++++++++++++++++
++++++++++++++++++++++++++
I
I
I
2
01
000000 I
O000000000000I
I++++++++++++++++++++~-+++++++++++++++++++++
00000000000000000000001
~ - ~ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ++
0000000000000000000000000000000
I+*+*+++++++++++++++++++++++++++++
OOODJOOOOOOOOOOOOOODOOO000000OOOO00
I
I
+ + + + + + + + +++* ++ + + + + + + + + + +
O0000UOOOGOOOOOOOOOOOOOOOOU000
@@I
4 - IO00
+++++++++++++
O00OOOUOUOOuOOOODOGOOUOOOO0000
@@8888@88@81
iOuuOOUOO00
ObOOOOC OOUUOUOOUOOOOOOOOOOOOOGO
8@@@@~@e@@@@@@@
I
3000~UuuOuUUUOuJUdUOOOOOOOUUUOuOOUuUOOOOOOOOOUOO00000
@@8888@V~@8@@888888883
IO U O C O O O O O U U O U U U U U O O O O U U u O O u O O O O O b D O 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8@@@@8@@~@@@e@@@@e@@@@
I
~OOUCOOUUO~ODOOOOOOOWOOOOOOOOUOOOOOOOUOOUO000000
@@@@@@@@@@@@@@@@@@@@@e@@@
I
I U~OUUOUdOuUOUOOOOOUDOOOOGOOdOUUO0000000000000
~@~w@~e@~@@~e@ee
I
io o o u u u o u u o o o o o o o o o o o u u u o o o o o o o o o o o u o o o o o o o o o
e@ee@~B@@Be@ee@@
IIIllllllll i
UUOUUO0,.,00dUU00WUUU0J0000U0000UO00OU0000000
@~e@@@B@eeeo@
IIIIIIIIIIIII
3- I J O O O u 0 u O U O U U U U U J b 0 d U O U U 0 0 O U O U O 0 0 0 0 0 0 G 0 0 0 0
@~@@@@~@@@U
IlllllllllllllI
IUOO0~0UU0~JdUd00000OOJ000C~O0000OUO0000000
~@@e@@@ee@
l l l I i I I l l I I
iOOOdOOOUOOJOOOuOOOUOdOUOOOOOOdJOO00000
@~@@@@@~er~@@~@ l l l l l l l l l l l l I ~ @ I I
L 0 u U U u d 0 ~ 0 duo 0uUu00u0dU0000U0~UUU0,U0 U00 ~ @ @ @ ~ @ @ ~ @
IIIIIIIIIIIII~IIIII
I
~+UOU~0U~0u000GOu00000UOOCu0U00000000G0
~8@@@~@@@@~
UUlI~IIIIIIIIIIII~
IOo0uOu0uuou0~Ou00uoo~o0OOuo00Ou000000
@@e~@@@@~@~@@ I I I I l l I I I I I I I
IOUOUOOUOOUduUOOOO.2UdOOOO6OOOOOOOUOUO ~
~
@
IIIIIIIImnnIIIIISUUIIII
I0000U00O00uuO00UUUU0u0000000000U0000
~ @ @ ~ @ @
IIIIIIIIIIIIIIIIIIIIIII
2- 1 0 u 0 0 0 U 0 d U d J 0 ~ U 0 d 0 0 0 U 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
@@@@~@@@
IIIIIIIIIIIIIIIIIIIIIIII
+O00UOUUU00UOUU0OOOO000000000000UU00
@@~@@@@~@
~IIIIIIIIIIIIIIIIIIIIII4
10000uU0U0JUd000OOOUUUU0OOU0000000
@@@@e@Q~@@~
IIIII@IiIII@III
IO00000000000000000U0UU000000000UOU
~@@~@@@@@@@@@@ iiiiiiiiiIiIiiiiiiIIIi
IG,,O0600000000uUOOUUOOOOOOOOOUOOO
@@~@@M@8B@
IIIIIIIIIIIIIIIIIIIIIIIIII
1000uOUUUO00000OOU00000OUUU0000000
6 ~ @ ~ @ @
IIIIIIIIIIIIIIIIIIIIIiIiIi
~00O0000000UU00000000OU0000000U000
~@@~88@@@
elIIIIIIIIIIImllll
5
IOOuOOO3OOOOOOoOOOOJOOOOO000000OO
@,~@@@@@@~@,~@ llllIIIIIIIllllI
l- I O b O O O O u U u o u O d U O O U U O O J U U O O U O 0 0 0 0 0
@,~@@@*~T~@@@@@~@ I ~ I I I I i I I i i ~ i i I I i i i I I
10bocoo00uuoou000oo0ooooooooooo00
@ 8 @ @ ~ @ ~ @
IIIIIIIIIIIIIIllIIIIIIIIII
IOC0d0JJ00b00U0d00OOOOOOU0000000O
@ @ @ @ ~ @ ~ @
IIIUUIII@II@IIIIIIIIII
+O00L, d 0 u ~ O O J 0 0 0 0 0 0 U 0 0 0 0 U 0 0 0 0 0 0 0 0
@ @ ~ ~ @
II~Il~IIIIIIIIIiIiiiii4
LOUU0UOOJ0uO0O0000000u00d~U00OU0
~ @ @ ~ @ ~ ~
HIIIIIIIIHIIIIIII
IU U O O O u O O d O U O O O O O d O O u d O 0 0 0 0 0 0 0 0 0
@@@,~@@@@@@@
I~IIII~IIIIIIIIII@III
Id0000U0dUU0O~O000000U~0000uOUO0
~@@~@@8@~@@~
@IIIIIIIIIIIIIIIIIIIIiii
1000000000b'UU0u~00C000~0JU00000
8 @ @ @ ~ ~ ~
IIIII~IIIII@IIIIIIIIII
{ + + + +++ ++ ++++++++++++++++++++++++++++++++++++++++++++
I +++++++++++*++++++++++++++++++++++++++++++++++++++
....
4"----
I ....
+-----2
....
~HON~TRAIION
UF
+ ....
3....
+ ....
4-----+--~5
....
+ ....
6--'-+
....
SYMAP
DATA
POINIS
CU~TDU~
I N T E R P O L A T I O N FROM FOUR
NUMB~hS
HAP PRODUCED
dY
SHOW
SYMAP,
DATA P O I N T S
VERSION
IRREGULARLY~SPACED
LOCATIONS AND L E V E L S
AT HARVARD
UNIVERS'ITY.
7 ....
locational
coordinates
xi
Yi
data
value
z i
level
6.00
6.75
0.0
6.80
2.25
5.0
0.80
1.13
2.5
1.90
6.00
1.5
range
[--0.5, 1.0)
[l.0, 2.0)
[2.0, 3.0)
[3.0, 4.0)
[4.0, 5.5]
523
REFERENCES
P SWITZER C M MOHR R E HEITMAN
Statistical analyses of ocean terrain and contour plotting
procedures
Project Trident Report 1440464 Arthur D Little Inc
April 1964
J F STEFFENSEN
Interpolation
Williams and Wilkins
Baltimore
1927 Chap 19
I S BEREZIN N P ZHIDKOV
Computing methods
Addison-Wesley Publishing Company Inc
Mass 1965 Vol I Chap 2
Reading
C deBOOR
Bicubic spline interpolation
J Math and Phys 41 212-218 1962
J A DOWNING
The automatic construction of contour plots with
applications to numerical analysis research
Defense Documentation Center Report AD 649811
January 1966
W R TOBLER
An interpolation algorithm for geographical data
University of Michigan undated
524
7 W C KRUMBEIN
Trend surface analysis of contour-type
irregular control point spacing
J Geophys Re 64 823-834 1959
maps with
8 B E BENGTSSON S NORDBECK
Construction of isarithms and isarithmic maps by
computers
University of Lund Sweden BIT 4 87-105 1964
9 A H SCHMIDT
SYMAP A user's manual
Tri-County Regional Planning Commission
Michigan May 1966
10
Lansing