Gathering detailed insights and metrics for point-in-polygon-hao
Gathering detailed insights and metrics for point-in-polygon-hao
Gathering detailed insights and metrics for point-in-polygon-hao
Gathering detailed insights and metrics for point-in-polygon-hao
npm install point-in-polygon-hao
Typescript
Module System
Node Version
NPM Version
99.6
Supply Chain
91.9
Quality
89.8
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
4,269,198
Last Day
7,666
Last Week
240,981
Last Month
934,786
Last Year
4,005,645
140 Stars
34 Commits
10 Forks
5 Watching
1 Branches
5 Contributors
Minified
Minified + Gzipped
Latest Version
1.2.4
Package Id
point-in-polygon-hao@1.2.4
Unpacked Size
28.19 kB
Size
6.49 kB
File Count
9
NPM Version
10.2.3
Node Version
20.10.0
Publised On
22 Dec 2024
Cumulative downloads
Total Downloads
Last day
-13.7%
7,666
Compared to previous day
Last week
-1.5%
240,981
Compared to previous week
Last month
10.9%
934,786
Compared to previous month
Last year
2,298%
4,005,645
Compared to previous year
A small library for detecting in a point lies inside a polygon
Features
0
if on the edgeInstall via npm install point-in-polygon-hao
import inside from 'point-in-polygon-hao'
const polygon = [
[
[1, 1],
[1, 2],
[2, 2],
[2, 1],
[1, 1]
]
];
inside([ 1.5, 1.5 ], polygon)
// => true
inside([ 4.9, 1.2 ], polygon)
// => false
inside([1, 2], polygon)
// => 0 to indicate on edge
Note: The input polygon format aligns with the GeoJson specification for polygons. This means that the first and last coordinate in a polygon must be repeated, if not this library will throw an error.
const polygonWithHole = [
[
[0, 0], [1, 0], [1, 1], [0, 1], [0, 0]
],
[
[0.1, 0.1], [0.1, 0.9], [0.9, 0.9], [0.9, 0.1], [0.1, 0.1]
]
]
The library does not support multi-polygons.
Some rough comparisons to similar libraries.
While point-in-polygon
is slightly faster in most cases it does not support polygons with holes or degenerate polygons.
// For a point in a much larger geometry (700+ vertices)
point-in-poly-hao x 381,184 ops/sec ±0.80% (87 runs sampled)
point-in-polygon x 285,734 ops/sec ±1.33% (91 runs sampled)
robust-point-in-polygon x 267,738 ops/sec ±0.78% (93 runs sampled)
// For a point in bounding box check
point-in-poly-hao x 25,822,227 ops/sec ±2.87% (86 runs sampled)
point-in-polygon x 30,321,920 ops/sec ±2.14% (91 runs sampled)
robust-point-in-polygon x 26,708,560 ops/sec ±1.13% (91 runs sampled)
This library is based on the paper Optimal Reliable Point-in-Polygon Test and Differential Coding Boolean Operations on Polygons
point-in-polygon
or robust-point-in-polygon
No vulnerabilities found.
Reason
11 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 4/21 approved changesets -- score normalized to 1
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
project is not fuzzed
Details
Reason
security policy file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2024-12-16
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