Gathering detailed insights and metrics for turf-line-slice-at-intersection
Gathering detailed insights and metrics for turf-line-slice-at-intersection
Gathering detailed insights and metrics for turf-line-slice-at-intersection
Gathering detailed insights and metrics for turf-line-slice-at-intersection
npm install turf-line-slice-at-intersection
Typescript
Module System
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
6 Stars
13 Commits
3 Forks
11 Watchers
1 Branches
10 Contributors
Updated on Feb 05, 2024
Latest Version
1.0.1
Package Id
turf-line-slice-at-intersection@1.0.1
Size
6.05 kB
NPM Version
2.14.9
Node Version
0.12.9
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
3
Slice a line whenever it intersects other features
turf.line-slice-at-intersection(line, segmenter)
Takes a LineString and a Feature to segment it by.
Any time the line intersects the feature, it will be segmented.
parameter | type | description |
---|---|---|
line | Feature.<LineString> | line to segment |
segmenter | Feature | feature to segment line by |
1var line = { 2 "type": "Feature", 3 "properties": {}, 4 "geometry": { 5 "type": "LineString", 6 "coordinates": [ 7 [ 8 -24.78515625, 9 2.7235830833483856 10 ], 11 [ 12 -22.8515625, 13 2.1967272417616712 14 ], 15 [ 16 -20.390625, 17 5.003394345022162 18 ], 19 [ 20 -18.984375, 21 2.6357885741666065 22 ], 23 [ 24 -14.94140625, 25 4.8282597468669755 26 ], 27 [ 28 -11.337890625, 29 7.536764322084078 30 ], 31 [ 32 -9.052734375, 33 3.601142320158722 34 ], 35 [ 36 -6.328125, 37 0.3515602939922709 38 ] 39 ] 40 } 41}; 42 43var poly = { 44 "type": "Feature", 45 "properties": {}, 46 "geometry": { 47 "type": "Polygon", 48 "coordinates": [ 49 [ 50 [ 51 -20.91796875, 52 9.882275493429953 53 ], 54 [ 55 -22.67578125, 56 6.926426847059551 57 ], 58 [ 59 -21.005859375, 60 1.6696855009865839 61 ], 62 [ 63 -18.45703125, 64 5.090944175033399 65 ], 66 [ 67 -16.083984375, 68 1.845383988573187 69 ], 70 [ 71 -13.798828125, 72 8.928487062665504 73 ], 74 [ 75 -20.91796875, 76 9.882275493429953 77 ] 78 ] 79 ] 80 } 81}; 82 83var features = turf.featurecollection([line,poly]) 84//=features 85 86var result = turf.lineSliceAtIntersection(line, poly); 87 88result.features.forEach(function(ft, ind) { 89 ft.properties.stroke = (ind % 2 === 0) ? '#f40' : '#389979'; 90}); 91 92//=result
Returns FeatureCollection.<LineString>
, segmented lines
Requires nodejs.
1$ npm install turf-line-slice-at-intersection
1$ npm test
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
Found 0/13 approved changesets -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More