@turf/mask
Advanced tools
Comparing version 7.1.0 to 7.2.0
@@ -7,3 +7,3 @@ import { Polygon, MultiPolygon, Feature, FeatureCollection } from 'geojson'; | ||
* | ||
* @name mask | ||
* @function | ||
* @param {Polygon|MultiPolygon|Feature<Polygon|MultiPolygon>|FeatureCollection<Polygon|MultiPolygon>} polygon GeoJSON polygon used as interior rings or holes | ||
@@ -10,0 +10,0 @@ * @param {Polygon|Feature<Polygon>} [mask] GeoJSON polygon used as the exterior ring (if undefined, the world extent is used) |
// index.ts | ||
import { polygon as createPolygon, multiPolygon } from "@turf/helpers"; | ||
import polygonClipping from "polygon-clipping"; | ||
import * as polyclip from "polyclip-ts"; | ||
import { clone } from "@turf/clone"; | ||
@@ -18,7 +18,7 @@ function mask(polygon, mask2, options) { | ||
polygonOuters = createGeomFromPolygonClippingOutput( | ||
polygonClipping.union(polygon.geometry.coordinates) | ||
polyclip.union(polygon.geometry.coordinates) | ||
); | ||
} else { | ||
polygonOuters = createGeomFromPolygonClippingOutput( | ||
polygonClipping.union(polygon.coordinates) | ||
polyclip.union(polygon.coordinates) | ||
); | ||
@@ -32,7 +32,7 @@ } | ||
function unionFc(fc) { | ||
const unioned = fc.features.length === 2 ? polygonClipping.union( | ||
const unioned = fc.features.length === 2 ? polyclip.union( | ||
fc.features[0].geometry.coordinates, | ||
fc.features[1].geometry.coordinates | ||
) : polygonClipping.union.apply( | ||
polygonClipping, | ||
) : polyclip.union.apply( | ||
polyclip, | ||
fc.features.map(function(f) { | ||
@@ -39,0 +39,0 @@ return f.geometry.coordinates; |
{ | ||
"name": "@turf/mask", | ||
"version": "7.1.0", | ||
"version": "7.2.0", | ||
"description": "turf mask module", | ||
@@ -55,3 +55,3 @@ "author": "Turf Authors", | ||
"@types/benchmark": "^2.1.5", | ||
"@types/tape": "^4.2.32", | ||
"@types/tape": "^4.13.4", | ||
"benchmark": "^2.1.4", | ||
@@ -61,16 +61,16 @@ "load-json-file": "^7.0.1", | ||
"npm-run-all": "^4.1.5", | ||
"tape": "^5.7.2", | ||
"tsup": "^8.0.1", | ||
"tsx": "^4.6.2", | ||
"typescript": "^5.2.2", | ||
"tape": "^5.9.0", | ||
"tsup": "^8.3.5", | ||
"tsx": "^4.19.2", | ||
"typescript": "^5.5.4", | ||
"write-json-file": "^5.0.0" | ||
}, | ||
"dependencies": { | ||
"@turf/clone": "^7.1.0", | ||
"@turf/helpers": "^7.1.0", | ||
"@turf/clone": "^7.2.0", | ||
"@turf/helpers": "^7.2.0", | ||
"@types/geojson": "^7946.0.10", | ||
"polygon-clipping": "^0.15.3", | ||
"tslib": "^2.6.2" | ||
"polyclip-ts": "^0.16.8", | ||
"tslib": "^2.8.1" | ||
}, | ||
"gitHead": "68915eeebc9278bb40dec3f1034499698a0561ef" | ||
"gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
24464
160
45
1
1
1
11
363040
+ Addedpolyclip-ts@^0.16.8
+ Added@turf/clone@7.2.0(transitive)
+ Added@turf/helpers@7.2.0(transitive)
+ Addedbignumber.js@9.1.2(transitive)
+ Addedpolyclip-ts@0.16.8(transitive)
+ Addedsplaytree-ts@1.0.2(transitive)
- Removedpolygon-clipping@^0.15.3
- Removed@turf/clone@7.1.0(transitive)
- Removed@turf/helpers@7.1.0(transitive)
- Removedpolygon-clipping@0.15.7(transitive)
- Removedrobust-predicates@3.0.2(transitive)
- Removedsplaytree@3.1.2(transitive)
Updated@turf/clone@^7.2.0
Updated@turf/helpers@^7.2.0
Updatedtslib@^2.8.1