{"name":"point-in-polygon-hao","version":"0.0.6","description":"A point in polygon based on the paper Optimal Reliable Point-in-Polygon Test and Differential Coding Boolean Operations on Polygons","main":"dist/pointInPolygon.js","module":"src/main.js","unpkg":"dist/pointInPolygon.min.js","jsdelivr":"dist/pointInPolygon.min.js","scripts":{"bench":"npm run build && node test/bench.js","build":"rollup -c","test":"ava -v"},"dependencies":{},"devDependencies":{"@turf/boolean-point-in-polygon":"^6.0.1","ava":"^1.3.1","benchmark":"^2.1.4","eslint":"^5.15.3","eslint-config-mourner":"^3.0.0","esm":"^3.2.20","jsts":"^2.0.3","load-json-file":"^5.2.0","point-in-polygon":"^1.0.1","robust-point-in-polygon":"^1.0.3","rollup":"^1.7.0","rollup-plugin-terser":"^4.0.4"},"ava":{"files":["test/*spec.js"],"require":["esm"]},"keywords":["point-in-polygon","pip","point","polygon","inside"],"author":{"name":"Rowan Winsemius"},"license":"MIT","gitHead":"62c1efb587452c1d2dcf3151e3731fb519f5619b","_id":"point-in-polygon-hao@0.0.6","_npmVersion":"6.4.1","_nodeVersion":"8.16.0","_npmUser":{"name":"rowanwins","email":"rowanwins@yahoo.com.au"},"dist":{"integrity":"sha512-DUJGnTq+xpA+8EJfIrm5XOntoZ5VOJEbL+r0IU4b3e/W5i+WPDz1zFHNJx0v2o2WoCtJvPd90xxb4qJc6KJnGg==","shasum":"0cba1081d0bc34659b804f222966ed58b73a6c63","tarball":"http://registry-npm.ywwl.com/point-in-polygon-hao/download/point-in-polygon-hao-0.0.6.tgz","fileCount":7,"unpackedSize":8353,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJdPZWfCRA9TVsSAnZWagAAnHEP/RdPs7ADe7Gt6z9sJBrP\njCHpvILC0VvoN2L3GGrhJ3q2BVYPRSSdaigZf8x8zwqvAfjSiHxwOJ0Zo+/S\n3KELh/tciG6ADMtK33omYW1aV4OM5aJdyHD6+57qBmt7uLWTRqhlywarCxw9\nUEx5D4HrIfUCIQEQqRNSlXWENy1KupB7+LqtUGs8DBouWTVhcNmMXXlFePFb\nj23ety6KKQHHDr1hLRO3MvRC0TpEu4Un8VxeBKiwy4FCbP79gR7cHGYeNGfA\nfwZ9wCZ9hstXwCerm/WAyo/gB5q/TiiZyS75LrBgVgGdZYCm6SQUNJCnhp+B\n3Yyl2EBvhE1q0rmaGC0cyR9Cq46qn3V8sR4x3aN4M4qjQZ8OUwkrA0V1fLyr\nUaJC71Y5EKAM1yjb/7rCee/tPy5lmyG5Subi84fYlLqhvtQSF8VQ+5aaJ3n5\nU6D2yUXoXk4vJw2mkn1OSqTTUwQcu0Z773uLm33FernvtEWHAUEK7bUysJFv\n1ahCHRYw0sOdU++9SmWYcIUvnUTyZHvvkKBimHzmTUAwUPn8M15f3CONGGYJ\nzG1yeunEkzT9sgTNcOtPTC5mqR/Oe3LdcrMC1BsvvR4TJeaLtGURHhJ+2DfE\n/uJBnXg6XqjFyGbw+bvWcJgvHkGrWZPUThtjuhpPRDK9PmhV1usSG/IHfjqr\ne+bk\r\n=AO+p\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDL4kRAy4r6ioRiSV3bel4kgMHnsXtqaT37i7OXZzIZywIgbdWaMKvpQHESPQA5skHT8n1M58JAU4qEnx9t0vz53PI="}],"size":2801,"noattachment":false,"key":"/point-in-polygon-hao/-/point-in-polygon-hao-0.0.6.tgz"},"maintainers":[{"name":"rowanwins","email":"rowanwins@yahoo.com.au"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/point-in-polygon-hao_0.0.6_1564317087099_0.9766581456078207"},"_hasShrinkwrap":false,"readme":"A small library for detecting in a point lies inside a polygon\n\n**Features**\n- Works on polygons with holes\n- Works with degenerate/self-intersecting polyons \n- Returns `0` if on the edge\n- Not effected by floating point errors\n\n\n### Usage\nInstall via `npm install point-in-polygon-hao`\n\n````\nimport inside from 'point-in-polygon-hao'\n\nconst polygon = [\n  [\n    [1, 1],\n    [1, 2],\n    [2, 2],\n    [2, 1],\n    [1, 1]\n  ]\n];\n\ninside([ 1.5, 1.5 ], polygon)\n// => true\n\ninside([ 4.9, 1.2 ], polygon)\n// => false\n\ninside([1, 2], polygon)\n// => 0 to indicate on edge\n````\n\n**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.\n````\nconst polygonWithHole = [\n  [\n    [0, 0], [1, 0], [1, 1], [0, 1], [0, 0]\n  ],\n  [\n    [0.1, 0.1], [0.1, 0.9], [0.9, 0.9], [0.9, 0.1], [0.1, 0.1]\n  ]\n]\n````\nThe library does not support multi-polygons.\n\n### Comparisons\nSome rough comparisons to similar libraries. \nWhile `point-in-polygon` is slightly faster in most cases it does not support polygons with holes or degenerate polygons.\n\n````\n// For a point in a much larger geometry (700+ vertices)\npoint-in-poly-hao x 474,180 ops/sec ±0.55% (93 runs sampled)\npoint-in-polygon x 489,649 ops/sec ±0.75% (91 runs sampled)\nrobust-point-in-polygon x 376,268 ops/sec ±0.79% (89 runs sampled)\n````\n\n````\n// For a point in bounding box check\npoint-in-poly-hao x 29,365,704 ops/sec ±1.30% (90 runs sampled)\npoint-in-polygon x 42,339,450 ops/sec ±0.78% (95 runs sampled)\nrobust-point-in-polygon x 20,675,569 ops/sec ±0.65% (95 runs sampled)\n````\n\n### Algorithm\nThis library is based on the paper [Optimal Reliable Point-in-Polygon Test and\nDifferential Coding Boolean Operations on Polygons](https://www.researchgate.net/publication/328261365_Optimal_Reliable_Point-in-Polygon_Test_and_Differential_Coding_Boolean_Operations_on_Polygons)\n\n### Other notes\n* Works irrespective of winding order of polygon\n* Does not appear to be effected by floating point errors compared to `point-in-polygon` or `robust-point-in-polygon`\n","publish_time":1564317087231,"_cnpm_publish_time":1564317087231,"dist-tags":{"latest":"1.2.4"}}