Class: IDW

ol.source. IDW

Inverse distance weighting interpolated source - Shepard's method


new IDW( [options])

Parameters:
Name Type Argument Description
options * <optional>
Properties
Name Type Argument Default Description
source ol.source.vector

a source to interpolate

getColor function <optional>

a function that takes a value and returns a color (as an Array [r,g,b,a])

useWorker boolean <optional>
false

use worker to calculate the distance map (may cause flickering on small data sets). Source will fire drawstart, drawend while calculating

lib Object <optional>

Functions that will be made available to operations run in a worker

scale number <optional>
4

scale factor, use large factor to enhance performances (but minor accuracy)

maxD number <optional>

maximum distance in proj units to compute (default +Infinity).

weight string | function

The feature attribute to use for the weight or a function that returns a weight from a feature. Weight values should range from 0 to 100. Default use the weight attribute of the feature.

See:

Extends

  • ol.source.ImageCanvas

Methods


computeImage(e)

Compute image data

Parameters:
Name Type Description
e Object

getColor(v)

Get color for a value. Return an array of RGBA values.

Parameters:
Name Type Description
v number

value

Returns:
Type
Array.<number>

getSource()

Get the source


getValue(coord)

Get image value at coord (RGBA)

Parameters:
Name Type Description
coord l.coordinate
Returns:
Type
Uint8ClampedArray

setMaxD( [dist])

Set IDW max distance

Parameters:
Name Type Argument Description
dist number <optional>

max distance in proj units


setScale(scale)

Set IDW scale

Parameters:
Name Type Description
scale number