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-difference
Advanced tools
Finds the difference between two polygons by clipping the second polygon from the first.
Parameters
poly1
Feature<Polygon> input Polygon feaurepoly2
Feature<Polygon> Polygon feature to difference from poly1
Examples
var poly1 = {
"type": "Feature",
"properties": {
"fill": "#0f0"
},
"geometry": {
"type": "Polygon",
"coordinates": [[
[-46.738586, -23.596711],
[-46.738586, -23.458207],
[-46.560058, -23.458207],
[-46.560058, -23.596711],
[-46.738586, -23.596711]
]]
}
};
var poly2 = {
"type": "Feature",
"properties": {
"fill": "#00f"
},
"geometry": {
"type": "Polygon",
"coordinates": [[
[-46.650009, -23.631314],
[-46.650009, -23.5237],
[-46.509246, -23.5237],
[-46.509246, -23.631314],
[-46.650009, -23.631314]
]]
}
};
var differenced = turf.difference(poly1, poly2);
differenced.properties.fill = '#f00';
var polygons = {
"type": "FeatureCollection",
"features": [poly1, poly2]
};
//=polygons
//=differenced
Returns Feature<Polygon> a Polygon feature showing the area of poly1
excluding the area of poly2
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 module individually:
$ npm install turf-difference
Or install the Turf module that includes it as a function:
$ npm install turf
FAQs
[Turf](http://turfjs.org/) difference module
We found that turf-difference demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.