@turf/line-intersect
Advanced tools
Comparing version 7.1.0 to 7.2.0
@@ -6,3 +6,3 @@ import { LineString, MultiLineString, Polygon, MultiPolygon, FeatureCollection, Feature, Point } from 'geojson'; | ||
* | ||
* @name lineIntersect | ||
* @function | ||
* @param {GeoJSON} line1 any LineString or Polygon | ||
@@ -12,3 +12,3 @@ * @param {GeoJSON} line2 any LineString or Polygon | ||
* @param {boolean} [options.removeDuplicates=true] remove duplicate intersections | ||
* @param {boolean} [options.ignoreSelfIntersections=false] ignores self-intersections on input features | ||
* @param {boolean} [options.ignoreSelfIntersections=true] ignores self-intersections on input features | ||
* @returns {FeatureCollection<Point>} point(s) that intersect both | ||
@@ -15,0 +15,0 @@ * @example |
@@ -10,8 +10,7 @@ // index.ts | ||
function lineIntersect(line1, line2, options = {}) { | ||
const { removeDuplicates = true, ignoreSelfIntersections = false } = options; | ||
const { removeDuplicates = true, ignoreSelfIntersections = true } = options; | ||
let features = []; | ||
if (line1.type === "FeatureCollection") | ||
features = features.concat(line1.features); | ||
else if (line1.type === "Feature") | ||
features.push(line1); | ||
else if (line1.type === "Feature") features.push(line1); | ||
else if (line1.type === "LineString" || line1.type === "Polygon" || line1.type === "MultiLineString" || line1.type === "MultiPolygon") { | ||
@@ -22,4 +21,3 @@ features.push(feature(line1)); | ||
features = features.concat(line2.features); | ||
else if (line2.type === "Feature") | ||
features.push(line2); | ||
else if (line2.type === "Feature") features.push(line2); | ||
else if (line2.type === "LineString" || line2.type === "Polygon" || line2.type === "MultiLineString" || line2.type === "MultiPolygon") { | ||
@@ -26,0 +24,0 @@ features.push(feature(line2)); |
{ | ||
"name": "@turf/line-intersect", | ||
"version": "7.1.0", | ||
"version": "7.2.0", | ||
"description": "turf line-intersect module", | ||
@@ -59,21 +59,21 @@ "author": "Turf Authors", | ||
"devDependencies": { | ||
"@turf/truncate": "^7.1.0", | ||
"@turf/truncate": "^7.2.0", | ||
"@types/benchmark": "^2.1.5", | ||
"@types/tape": "^4.2.32", | ||
"@types/tape": "^4.13.4", | ||
"benchmark": "^2.1.4", | ||
"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/helpers": "^7.1.0", | ||
"@turf/helpers": "^7.2.0", | ||
"@types/geojson": "^7946.0.10", | ||
"sweepline-intersections": "^1.5.0", | ||
"tslib": "^2.6.2" | ||
"tslib": "^2.8.1" | ||
}, | ||
"gitHead": "68915eeebc9278bb40dec3f1034499698a0561ef" | ||
"gitHead": "7b0f0374c4668cd569f8904c71e2ae7d941be867" | ||
} |
@@ -16,3 +16,3 @@ # @turf/line-intersect | ||
* `options.removeDuplicates` **[boolean][3]** remove duplicate intersections (optional, default `true`) | ||
* `options.ignoreSelfIntersections` **[boolean][3]** ignores self-intersections on input features (optional, default `false`) | ||
* `options.ignoreSelfIntersections` **[boolean][3]** ignores self-intersections on input features (optional, default `true`) | ||
@@ -19,0 +19,0 @@ ### Examples |
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
21193
111
Updated@turf/helpers@^7.2.0
Updatedtslib@^2.8.1