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
79.5
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
7,224,510
Last Day
67,676
Last Week
339,269
Last Month
1,397,099
Last Year
6,855,257
MIT License
140 Stars
34 Commits
9 Forks
4 Watchers
1 Branches
5 Contributors
Updated on Feb 28, 2025
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
Published on
Dec 22, 2024
Cumulative downloads
Total Downloads
Last Day
12%
67,676
Compared to previous day
Last Week
-1.1%
339,269
Compared to previous week
Last Month
20.1%
1,397,099
Compared to previous month
Last Year
2,701.7%
6,855,257
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
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
4 commit(s) and 3 issue activity found in the last 90 days -- score normalized to 5
Reason
Found 5/19 approved changesets -- score normalized to 2
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
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 2025-03-03
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