-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathgap-filling
More file actions
51 lines (41 loc) · 1.7 KB
/
gap-filling
File metadata and controls
51 lines (41 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
var someData = ee.Image("NASA/JPL/global_forest_canopy_height_2005");
var geometry = ee.Geometry.Point([10.44104168672001, 45.596877548727065]);
Map.centerObject(geometry,10)
var oeel=require('users/OEEL/lib:loadAll')
// options to gap-fill a raster (single band, single image)
var im=someData.selfMask().rename('test');
var col=ee.ImageCollection([im]);
Map.addLayer(im,{min:1, max:73},'gap with data',false)
/************* interp inv *****************/
var interpolated=oeel.Image.inverseDistanceInterpolation({
radius:10,
power:2,
useConvolution:true,
image:im
});
Map.addLayer(interpolated,{min:1, max:73},'inverse interp driect',false);
// OR
var interffunc=oeel.Image.inverseDistanceInterpolation({
radius:10,
power:2,
useConvolution:true,
});
var interpolated2=interffunc(im)
Map.addLayer(interpolated2,{min:1, max:73},'inverse interp function call',false);
// for an image collection
var interpCol=col.map(interffunc);
Map.addLayer(interpCol,{min:1, max:73},'inverse interp collection',false);
/************* Kriging *****************/
var krig1=oeel.Image.kriging({
covFun:function(dist){return dist.multiply(-0.1).exp().multiply(140);}, // expodential covariance
image:im
});
Map.addLayer(krig1,{min:1, max:73, bands:['estimate']},'kriging driect',false);
// OR
var functionKrig=oeel.Image.kriging(function(dist){return dist.multiply(-0.1).exp().multiply(140);})
var krig2=functionKrig(im);
Map.addLayer(krig2,{min:1, max:73, bands:['estimate']},'kriging function call',false);
// for an image collection
var krigCol=col.map(functionKrig);
Map.addLayer(krigCol,{min:1, max:73, bands:['estimate']},'kriging collection',false);
print('list of functions used',oeel.refs())