Comparing version
/// <reference types="geojson" /> | ||
import {Units} from '@turf/helpers' | ||
@@ -9,4 +10,4 @@ type Points = GeoJSON.FeatureCollection<GeoJSON.Point>; | ||
*/ | ||
declare function idw(controlPoints: Points, valueField: string, b: number, cellWidth: boolean, units?: string): Polygons; | ||
declare function idw(controlPoints: Points, valueField: string, b: number, cellWidth: number, units?: Units): Polygons; | ||
declare namespace idw { } | ||
export = idw; |
@@ -0,0 +0,0 @@ var distance = require('@turf/distance'); |
{ | ||
"name": "@turf/idw", | ||
"version": "3.10.0", | ||
"version": "3.10.2", | ||
"description": "Calculate a grid with IDW - Inverse Distance Weighted - values.", | ||
@@ -10,6 +10,7 @@ "main": "index.js", | ||
"dependencies": { | ||
"@turf/bbox": "^3.10.0", | ||
"@turf/centroid": "^3.10.0", | ||
"@turf/distance": "^3.10.0", | ||
"@turf/bbox": "^3.10.0", | ||
"@turf/square-grid": "^3.10.0" | ||
"@turf/helpers": "^3.10.0", | ||
"@turf/square-grid": "^3.10.2" | ||
}, | ||
@@ -16,0 +17,0 @@ "devDependencies": { |
@@ -0,0 +0,0 @@ # @turf/idw |
16
test.js
@@ -6,7 +6,7 @@ var test = require('tape'); | ||
test('idw', function (t) { | ||
var testPoints = JSON.parse(fs.readFileSync('./data/data.geojson')); | ||
var testPoints = JSON.parse(fs.readFileSync('./test/in/data.geojson')); | ||
var idw1 = idw(testPoints,'value' , 0.5 , 1, 'kilometers'); | ||
var idw2 = idw(testPoints,'value', 0.5 ,0.5, 'kilometers'); | ||
var idw3 = idw(testPoints,'value', 2 , 1, 'miles'); | ||
var idw1 = idw(testPoints, 'value', 0.5, 1, 'kilometers'); | ||
var idw2 = idw(testPoints, 'value', 0.5, 0.5, 'kilometers'); | ||
var idw3 = idw(testPoints, 'value', 2, 1, 'miles'); | ||
var idw4 = idw(testPoints, 'WRONGDataField', 0.5, 1, 'miles'); | ||
@@ -19,6 +19,6 @@ | ||
if (process.env.UPDATE) { | ||
fs.writeFileSync(__dirname+'/tests/idw1.geojson', JSON.stringify(idw1,null,2)); | ||
fs.writeFileSync(__dirname+'/tests/idw2.geojson', JSON.stringify(idw2,null,2)); | ||
fs.writeFileSync(__dirname+'/tests/idw3.geojson', JSON.stringify(idw3,null,2)); | ||
if (process.env.REGEN) { | ||
fs.writeFileSync(__dirname + '/test/out/idw1.geojson', JSON.stringify(idw1, null, 2)); | ||
fs.writeFileSync(__dirname + '/test/out/idw2.geojson', JSON.stringify(idw2, null, 2)); | ||
fs.writeFileSync(__dirname + '/test/out/idw3.geojson', JSON.stringify(idw3, null, 2)); | ||
} | ||
@@ -25,0 +25,0 @@ |
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
418753
4.86%12
9.09%91
13.75%5
25%3
50%+ Added
Updated