Comparing version 3.6.0 to 3.6.1
@@ -35,10 +35,10 @@ var distance = require('@turf/distance'); | ||
// calculate the distance from each control point to cell's centroid | ||
for (var j = 0; j < controlPoints.length; j++) { | ||
var d = distance(centroid(samplingGrid.features[j]), controlPoints[j], units); | ||
for (var j = 0; j < controlPoints.features.length; j++) { | ||
var d = distance(centroid(samplingGrid.features[i]), controlPoints.features[j], units); | ||
if (d === 0) { | ||
zw = controlPoints[j].properties[valueField]; | ||
zw = controlPoints.features[j].properties[valueField]; | ||
} | ||
var w = 1.0 / Math.pow(d, b); | ||
sw += w; | ||
zw += w * controlPoints[j].properties[valueField]; | ||
zw += w * controlPoints.features[j].properties[valueField]; | ||
} | ||
@@ -45,0 +45,0 @@ // write IDW value for each grid cell |
{ | ||
"name": "@turf/idw", | ||
"version": "3.6.0", | ||
"version": "3.6.1", | ||
"description": "Calculate a grid with IDW - Inverse Distance Weighted - values.", | ||
@@ -10,6 +10,6 @@ "main": "index.js", | ||
"dependencies": { | ||
"@turf/centroid": "^3.0.0", | ||
"@turf/distance": "^3.0.0", | ||
"@turf/bbox": "^3.0.0", | ||
"@turf/square-grid": "^3.0.0" | ||
"@turf/centroid": "^3.6.1", | ||
"@turf/distance": "^3.6.1", | ||
"@turf/bbox": "^3.6.1", | ||
"@turf/square-grid": "^3.6.1" | ||
}, | ||
@@ -16,0 +16,0 @@ "devDependencies": { |
@@ -20,2 +20,6 @@ # @turf/idw | ||
<!-- This file is automatically generated. Please don't edit it directly: | ||
if you find an error, edit the source file (likely index.js), and re-run | ||
./scripts/generate-readmes in the turf project. --> | ||
--- | ||
@@ -22,0 +26,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
397791
44
Updated@turf/bbox@^3.6.1
Updated@turf/centroid@^3.6.1
Updated@turf/distance@^3.6.1
Updated@turf/square-grid@^3.6.1