@turf/interpolate v7.2.0
@turf/interpolate
interpolate
Takes a set of points and estimates their 'property' values on a grid using the Inverse Distance Weighting (IDW) method.
Parameters
pointsFeatureCollection<Point> with known valuecellSizenumber the distance across each grid pointoptionsObject Optional parameters (optional, default{})options.gridTypestring defines the output format based on a Grid Type (options: 'square' | 'point' | 'hex' | 'triangle') (optional, default'square')options.propertystring the property name inpointsfrom which z-values will be pulled, zValue fallbacks to 3rd coordinate if no property exists. (optional, default'elevation')options.unitsstring used in calculating cellSize, can be degrees, radians, miles, or kilometers (optional, default'kilometers')options.weightnumber exponent regulating the distance-decay weighting (optional, default1)
Examples
var points = turf.randomPoint(30, {bbox: [50, 30, 70, 50]});
// add a random property to each point
turf.featureEach(points, function(point) {
point.properties.solRad = Math.random() * 50;
});
var options = {gridType: 'points', property: 'solRad', units: 'miles'};
var grid = turf.interpolate(points, 100, options);
//addToMap
var addToMap = [grid];Returns FeatureCollection<(Point | Polygon)> grid of points or polygons with interpolated 'property'
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Installation
Install this module individually:
$ npm install @turf/interpolateOr install the Turf module that includes it as a function:
$ npm install @turf/turf11 months ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago
8 years ago