Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
@turf/interpolate
Advanced tools
Takes a set of points and estimates their 'property' values on a grid using the Inverse Distance Weighting (IDW) method.
points
FeatureCollection<Point> with known value
cellSize
number the distance across each grid point
options
Object Optional parameters (optional, default {}
)
options.gridType
string defines the output format based on a Grid Type (options: 'square' | 'point' | 'hex' | 'triangle') (optional, default 'square'
)options.property
string the property name in points
from which z-values will be pulled, zValue fallbacks to 3rd coordinate if no property exists. (optional, default 'elevation'
)options.units
string used in calculating cellSize, can be degrees, radians, miles, or kilometers (optional, default 'kilometers'
)options.weight
number exponent regulating the distance-decay weighting (optional, default 1
)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.
Install this single module individually:
$ npm install @turf/interpolate
Or install the all-encompassing @turf/turf module that includes all modules as functions:
$ npm install @turf/turf
FAQs
turf interpolate module
We found that @turf/interpolate demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.