Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
turf-difference
Advanced tools
Turf difference module
turf.difference(poly1, poly2)
Finds the difference between two Polygon|polygons by clipping the second polygon from the first.
parameter | type | description |
---|---|---|
poly1 | Feature.<Polygon> | input Polygon feaure |
poly2 | Feature.<Polygon> | Polygon feature to difference from poly1 |
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
Requires nodejs.
$ npm install turf-difference
$ npm test
FAQs
[Turf](http://turfjs.org/) difference module
The npm package turf-difference receives a total of 9,374 weekly downloads. As such, turf-difference popularity was classified as popular.
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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.