Transcript Chapter 2

Chapter 6
Part B: Surface analysis – gridding and
interpolation
www.spatialanalysisonline.com
Surface analysis - Gridding & Interpolation
 Gridding (a form of systematic interpolation):
 to convert a sample of data points to a complete coverage
(set of values) for the study region
 to convert from one level of data resolution or orientation
to another (resampling)
 to convert from one representation of a continuous surface
to another, e.g. TIN to grid or contour to grid
 Quality of process:
 Input data quality/accuracy
 Data density
 Data distribution
 Spatial variability of data
 Model applied – typically weighted average:
n
zj 
 z
i i
i 1
3rd edition
www.spatialanalysisonline.com
2
Surface analysis - Gridding & Interpolation
Some other key issues:
Validity of continuity assumption/handling of
breaklines/stratifications and missing data
Validity of weighted average model
How to choose weights?
How many points to include in summation?
Shape and size of neighbourhood region
Selection of model and parameters
Evaluation of quality
Availability of related datasets
3rd edition
www.spatialanalysisonline.com
3
Surface analysis - Gridding & Interpolation
 Comparison of interpolation methods
Method
Speed
Type
Inverse distance weighting (IDW)
Fast
Exact, unless smoothing factor specified
Natural neighbour
Fast
Exact
Nearest-neighbour
Fast
Exact
Kriging -Geostatistical models (stochastic)
Slow/Medium
Exact if no nugget (assumed measurement error)
Conditional simulation
Slow
Exact
Radial basis
Slow/Medium
Exact if no smoothing value specified
Modified Shepard
Fast
Exact, unless smoothing factor specified
Triangulation with linear interpolation
Fast
Exact
Triangulation with spline interpolation
Fast
Exact
Profiling
Fast
Exact
Minimum curvature
Medium
Exact/Smoothing
Spline functions
Fast
Exact (smoothing possible)
Local polynomial
Fast
Smoothing
Polynomial regression
Fast
Smoothing
Moving average
Fast
Smoothing
Topogrid/Topo to Raster
Slow/Medium
Not specified
3rd edition
www.spatialanalysisonline.com
4
Surface analysis - Gridding & Interpolation
Contour generation from grids
Simple linear interpolation
Smoothing – splines or iterative thresholding
3rd edition
www.spatialanalysisonline.com
5
Surface analysis - Gridding & Interpolation
Deterministic interpolation
3rd edition
www.spatialanalysisonline.com
6
Surface analysis - Gridding & Interpolation
Deterministic interpolation: IDW
General model:
IDW version:
n
zj 
n
 z , 
i i
i 1
zj 
i
1
i 1
1/ dij
  z ,   1/d 
i i
i
ij
i
i
 The values are computed for all or selected i (e.g. 12)
 The value for alpha is typically 1 or 2
 The division by the sum of weighted distances
ensures that the weights add up to 1
3rd edition
www.spatialanalysisonline.com
7
Surface analysis - Gridding & Interpolation
Deterministic interpolation: IDW
Simple IDW calculations for point 5,5
% each
data point
contributes
Grid
point
(5,5)
Calculation of weights using alpha=1 and alpha=2
3rd edition
www.spatialanalysisonline.com
8
Surface analysis - Gridding & Interpolation
Sample data for main examples (x,y,z)
316467
316139
319451
317374
319128
316684
314144
315284
313741
314441
310382
310987
311728
311608
310713
309731
3rd edition
650940
652115
653028
653494
655535
654997
655537
659375
658288
657566
651060
654741
656272
657781
658370
652685
294
237
287
279
298
285
535
479
517
537
358
534
464
478
562
448
309724
309012
308632
307917
306469
307272
306512
305480
306083
303423
301975
301388
318247
319469
318800
319382
653873
655066
651036
652199
651249
653817
653133
653039
654457
655030
650487
651527
649157
648372
647423
645231
465
518
326
407
445
434
448
415
417
336
297
296
357
479
445
476
318555
313677
313344
312471
315503
318573
317466
316285
313444
312553
310398
308987
307987
306795
307082
306179
644731
646485
647439
645750
644081
643128
640234
642153
641290
641625
643270
646909
645958
646096
648950
648702
www.spatialanalysisonline.com
465
309
310
307
376
395
456
365
536
557
347
438
516
388
400
297
304905
303036
300638
300158
302636
308279
309067
308526
306512
305435
305290
304370
302488
302066
647876
648380
649904
648596
645845
640150
641210
642825
641175
640415
641442
642830
642215
641652
293
248
294
294
264
355
344
426
303
359
284
308
307
294
9
Surface analysis - Gridding & Interpolation
Deterministic interpolation: IDW
Source data
3rd edition
IDW grid: alpha=2, no smoothing
www.spatialanalysisonline.com
10
Surface analysis - Gridding & Interpolation
 IDW:
All grid points in rectangle are assigned a value
Sample points are exactly fitted
Surface looks rather peaky with odd ‘hollows’/bull’s eye’s affected by point locations, alpha and grid resolution
How do we know what values to choose - number of
neighbours, alpha, grid res., break lines?
Can we judge the ‘goodness of fit’ of the resultant surface?
 Generally no, but could test the fit by (a) additional sampling;
(b) comparison with other sources of data (e.g. aerial
photographs); (c) computational procedures
3rd edition
www.spatialanalysisonline.com
11
Surface analysis - Gridding & Interpolation
 Deterministic interpolation: Nearest neighbour
Simple assignment on nearest neighbour basis
Uniform within zones, stepped between zones
3rd edition
www.spatialanalysisonline.com
12
Surface analysis - Gridding & Interpolation
 Deterministic interpolation: Natural neighbour
Assumes each existing point, i, has a “natural” sphere
of influence – its Voronoi polygon with area Ai
Assumes a newly added point, p, (e.g. grid point)
captures part of these natural areas for itself. These
captured parts have areas Aip
Weights are based on initial and captured Voronoi
regions
Aip
i 
k
A
ip
i 1
3rd edition
www.spatialanalysisonline.com
13
Surface analysis - Gridding & Interpolation
 Deterministic interpolation: Natural neighbour
Source data
3rd edition
Nat N grid: extent limited to convex hull
www.spatialanalysisonline.com
14
Surface analysis - Gridding & Interpolation
 Deterministic interpolation: Radial basis/splines
A large family of interpolation functions
Exact (or smoothing)
Exhibit well-defined characteristics – e.g. properties of
smoothness and fit
Thin plate splines widely used in Earth Sciences
Core model is a form of weighted transformed distances:
‘bias’ or offset value
n
zp 
z-value at
point p
3rd edition
 w (r )  m
i
i
i 1
Weight for ith point
Radial basis function, for
radius ri
www.spatialanalysisonline.com
15
Surface analysis - Gridding & Interpolation
 Deterministic interpolation: Radial basis/splines
 Computation:
 Compute matrix D of all interpoint distances
 Apply radial basis function to all elements of D
 For grid point p, compute distance to all data points, as a vector r
 Apply radial basis function to all elements of r
 Form augmented matrix equation shown and solve by inversion
Φ 1  λ  φ 
1' 0  m   1 

   
3rd edition
www.spatialanalysisonline.com
16
Surface analysis - Gridding & Interpolation
 Deterministic interpolation: Thin Plate Spline
(r)  (c 2  r 2 )ln(c 2  r 2 )
Using 12 point neighbourhoods
Using all 62 data points
3rd edition
www.spatialanalysisonline.com
17
Surface analysis - Gridding & Interpolation
 Deterministic interpolation: Modified Shepard
Hybrid IDW-like system
Typically uses local IDW or quadratic fit plus longer
range IDW with separate parameter
Example using 8 local
points for quadratic fit
and 16 for longer range
IDW
3rd edition
www.spatialanalysisonline.com
18
Surface analysis - Gridding & Interpolation
 Deterministic interpolation:
 Triangulation with linear interpolation (i.e. 2D linear model)
Source data
3rd edition
Linear grid: extent limited to convex hull
www.spatialanalysisonline.com
19
Surface analysis - Gridding & Interpolation
 Deterministic interpolation: Minimum curvature
Seeks smoothed ‘elastic membrane’ fit to surface
Fit to residuals after linear regression of original dataset
Linear component then added back
3rd edition
www.spatialanalysisonline.com
20
Surface analysis - Gridding & Interpolation
 Deterministic interpolation: Local polynomial
Fits a local polynomial (e.g. quadratic) to each grid
point, using window (e.g. circle) of given size or number
of points
Smoothing
Example: local
quadratic distanceweighted OLS, with
12 points per fit
3rd edition
www.spatialanalysisonline.com
21
Surface analysis - Gridding & Interpolation
 Deterministic interpolation – some other methods:
 Triangulation with non-linear interpolation - Clough-Tocher: bicubic patches fitted to every triangle, such that edge and vertex
joins are smooth
 Bi-linear: suitable for dense uniform datasets, e.g. grids with
some missing cell values – simple weighted averaging of
directly or indirectly neighbouring cells/points
 Profiling: input dataset is contour vectors. Typically interpolation
is linear between closest pair of contours (8-point)
 Moving average – uses a moving circular or elliptical window
(similar to time series analysis) to obtain simple local average
 Topogrid – conversion of contour vectors to hydrologically
consistent DEM. Includes enforcement of local drainage, lake
boundaries, ridges and stream lines
3rd edition
www.spatialanalysisonline.com
22
Surface analysis - Gridding & Interpolation
Geostatistical interpolation
3rd edition
www.spatialanalysisonline.com
23
Surface analysis - Gridding & Interpolation
Geostatistical interpolation: Core concepts
Geostatistics definition:
“…models and methods for data observed at a
discrete set of locations, such that the observed
value, zi, is either a direct measurement of, or is
statistically related to, the value of an underlying
continuous spatial phenomenon, F(x,y), at the
corresponding sampled location (xi,yi) within
some spatial region A.” (Diggle et al)
3rd edition
www.spatialanalysisonline.com
24
Surface analysis - Gridding & Interpolation
Geostatistical interpolation: Core concepts
Addresses questions such as:
how many points are needed to compute the local
average?
what size, orientation and shape of neighbourhood
should be chosen?
what model and weights should be used to compute
the local average?
what errors (uncertainties) are associated with
interpolated values?
3rd edition
www.spatialanalysisonline.com
25
Surface analysis - Gridding & Interpolation
Geostatistical interpolation: Variograms
Analyse the observed variation in data values by
distance bands using a spatial autocorrelationlike measure, 
Typically, analyse all pairs of observations that lie
within specific distance bands
Compute the average values of  for each band
Plot these averages against distance
Fit an experimental curve to the observed pattern
3rd edition
www.spatialanalysisonline.com
26
Surface analysis - Gridding & Interpolation
Geostatistical interpolation: Variograms
Analyse the observed variation in data values by
distance bands using a spatial autocorrelationlike measure,  :
Semivariance measure is most often used:
dij h  /2
ˆ(h) 
1
2N(h) d

(zi  z j )2
ij  h  /2
Bands have width . N(h) is the number of pairs in the
band with mid-point distance h
3rd edition
www.spatialanalysisonline.com
27
Surface analysis - Gridding &
Interpolation
 Geostatistical interpolation: Zinc data (x,y,z)
Burrough & McDonnell (1998) App.3 98 soil samples (z=zinc ppm)
x
1637
1894
2110
2356
1755
1503
1665
1373
1226
1500
1961
1851
1087
1692
1249
1302
1507
1004
1192
1810
1683
1042
1862
926
1573
3rd edition
y
2651
2630
2630
2618
2599
2597
2597
2555
2517
2513
2493
2475
2461
2457
2442
2413
2401
2359
2335
2331
2314
2255
2247
2236
2223
z
812
298
321
213
746
1548
832
1839
1528
1571
167
176
933
746
703
550
262
1190
432
258
464
253
142
907
210
x
1179
1682
1562
1878
895
1044
1429
1670
1747
1867
889
1599
924
1535
1719
814
1851
1117
959
846
1562
734
1317
874
655
y
2219
2161
2137
2122
2070
2030
2020
2007
2000
1994
1933
1891
1865
1852
1840
1794
1773
1741
1723
1722
1687
1666
1625
1604
1564
z
139
365
210
119
761
203
198
282
152
133
659
375
232
222
176
643
117
166
317
191
136
801
141
241
784
x
1131
1222
1467
611
1601
1728
1057
870
1391
476
1676
540
1092
381
1174
1281
422
528
465
1514
1252
693
312
1380
862
www.spatialanalysisonline.com
y
1545
1542
1485
1475
1460
1458
1450
1425
1369
1305
1263
1255
1233
1224
1221
1212
1173
1167
1164
1103
1101
1097
1079
1073
1066
z
128
158
143
765
126
113
140
1060
129
1161
130
703
119
1383
221
240
545
676
793
192
778
186
1136
203
226
x
510
353
407
580
210
432
495
520
805
434
101
1182
275
458
1018
485
5
606
429
866
1721
1551
203
y
1058
1042
1027
1010
966
945
936
878
867
861
857
840
816
810
758
733
706
698
694
681
666
653
649
z
593
505
685
198
560
549
680
206
180
451
577
157
420
539
199
296
553
187
400
162
722
1672
332
28
Surface analysis - Gridding & Interpolation
Geostatistical interpolation: Variograms
Smallest observed
separation
Fitted curve
sill
Average semivariance for
band 4
C1=C0+C
(structural
variance)
Range, A0
model
3rd edition
C0 “Nugget”
Lag (distance band)
www.spatialanalysisonline.com
29
Surface analysis - Gridding & Interpolation
 Geostatistical interpolation: Variogram models
Model
Nugget effect
Formula
Notes
 (0)  C 0
Simple constant. May be added to all
models. Models with a nugget will not be
exact
Linear
 (h)  C1 h 
Exponential
Exp()
 (h)  C 1  e 
Spherical
Sph()
 (h)  C1 
3rd edition
1
No sill. Often used in combination with other
functions. May be used as a ramp, with a
constant sill value set at a range, a
kh
k is a constant, often k=1 or k=3. Useful
when there is a larger nugget and slow rise
to the sill
Useful when the nugget effect is important
 3h 1 3 
 h , h  1 but small. Given as the default model in
 2 2 
some packages.
 (h)  C1, h  1
www.spatialanalysisonline.com
30
Surface analysis - Gridding & Interpolation
Geostatistical interpolation: Core concepts
Geostatistical methods assume a general form
of model which is a mix of:
(a) a deterministic model m(x,y)
(b) a regionalised statistical variation from m(x,y)
(c) a random noise (Normal error) component
(actually two components which we cannot
generally separate)
(b) is chosen by analysing the semivariance, 
3rd edition
www.spatialanalysisonline.com
31
Surface analysis - Gridding & Interpolation
 Geostatistical interpolation: Further key concepts
Sample size
Support
Declustering
Thresholding
Stationarity
Transformation
Anisotropy
Madograms and Rodograms
Periodograms and Fourier analysis
3rd edition
www.spatialanalysisonline.com
32
Surface analysis - Gridding & Interpolation
 Geostatistical interpolation: Kriging
 Examine the data (z values) for spatial trends and Normality
and transform variables if necessary, e.g. loge(z) or loge(z+1)
 Compute the experimental variogram and fit a suitable model
IFF the pattern warrants this (i.e. the data is not just noise)
 Check the model by cross validation and examine size of mean
squared deviation
 Decide on method to use – Kriging or Conditional simulation
 Generate a grid from the selected model and plot
 Compare the results to (a) the input data points and (b) other
sources of data/information
3rd edition
www.spatialanalysisonline.com
33
Surface analysis - Gridding & Interpolation
 Geostatistical interpolation: Kriging
 Ordinary Kriging – basic procedure is exactly the same as for
radial basis functions, but with function applied being the
modelled variogram
Φ 1  λ  φ 
1' 0  m   1 

   
 Computation:
 Compute matrix D of all interpoint distances
 Apply variogram function to all elements of D
 For grid point p, compute distance to all data points, as a
vector r
 Apply variogram function to all elements of r
 Form augmented matrix equation shown and solve by
inversion
3rd edition
www.spatialanalysisonline.com
34
Surface analysis - Gridding & Interpolation
 Geostatistical interpolation: Ordinary Kriging (OK)
n
Estimated value at p is then:
zp 
Estimated variance at p is:
ˆ p2
 z
i i
i 1
n

 c
i i
m
i 1
where m is the Lagrangian multiplier and the c i are the modelled semivariance values (the 
values)
3rd edition
www.spatialanalysisonline.com
35
Surface analysis - Gridding &
Interpolation
 Geostatistical interpolation: Ordinary Kriging
Zinc data: Predicted values
3rd edition
Zinc data: Estimated standard deviation
www.spatialanalysisonline.com
36
Surface analysis - Gridding & Interpolation
Geostatistical interpolation: Kriging
Goodness of fit methods:
Residual plots, standard deviation plots
Examination for artefacts
Simple cross-validation
Jack-knifing
Re-sampling
Examination of independent datasets
Stratification
3rd edition
www.spatialanalysisonline.com
37
Surface analysis - Gridding & Interpolation
Geostatistical interpolation: Kriging – other
models
Universal Kriging – Kriging with a trend
Indicator Kriging – thresholding
Stratified Kriging – regionalised approach
Co-Kriging – use of associated data
3rd edition
www.spatialanalysisonline.com
38
Surface analysis - Gridding & Interpolation
 Geostatistical interpolation: Conditional
simulation (Gaussian sequential method)
Similar to OK approach. 3 core steps:
1. Analyse the data/transform as necessary, fit model
variogram, define grid to use (possibly multi-level)
2. Randomly select a grid node to visit (e.g. apply a
random walk process) as execute step 3
3. Apply OK estimation at node based on local observed
data points. Take estimated value and apply Normal
random process with mean as estimate and variance as
estimated variance. Return to step 2
This process is then repeated until all nodes have been
visited. Then iterated M times
3rd edition
www.spatialanalysisonline.com
39
Surface analysis - Gridding &
Interpolation
 Geostatistical interpolation: Conditional
simulation, M=100 iterations
Zinc data: Predicted values
3rd edition
Zinc data: Estimated standard deviation
www.spatialanalysisonline.com
40