{"name":"point-in-polygon-hao","version":"1.1.0","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":"dist/pointInPolygon.mjs","unpkg":"dist/pointInPolygon.min.js","jsdelivr":"dist/pointInPolygon.min.js","types":"index.d.ts","scripts":{"bench":"npm run build && node test/bench.js","build":"rollup -c","test":"ava"},"dependencies":{},"devDependencies":{"@rollup/plugin-buble":"^0.21.3","@turf/boolean-point-in-polygon":"^6.0.1","ava":"^3.15.0","benchmark":"^2.1.4","eslint":"^5.15.3","eslint-config-mourner":"^3.0.0","esm":"^3.2.20","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"],"verbose":true},"keywords":["point-in-polygon","pip","point","polygon","inside"],"author":{"name":"Rowan Winsemius"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/rowanwins/point-in-polygon-hao.git"},"homepage":"https://github.com/rowanwins/point-in-polygon-hao","gitHead":"23ed3999bff128c56b27ac771edac2eb54263499","bugs":{"url":"https://github.com/rowanwins/point-in-polygon-hao/issues"},"_id":"point-in-polygon-hao@1.1.0","_nodeVersion":"14.8.0","_npmVersion":"6.14.7","dist":{"integrity":"sha512-3hTIM2j/v9Lio+wOyur3kckD4NxruZhpowUbEgmyikW+a2Kppjtu1eN+AhnMQtoHW46zld88JiYWv6fxpsDrTQ==","shasum":"37f5f4fbe14e89fa8a3bb7f67c9158079d2ede7c","tarball":"http://registry-npm.ywwl.com/point-in-polygon-hao/download/point-in-polygon-hao-1.1.0.tgz","fileCount":12,"unpackedSize":13423,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhC7r9CRA9TVsSAnZWagAA5hIP/0lrx9u/5AN/+PEdiR4S\np+AW0t9Y7b8Rt2t/rv2FuYBNRTu392lmczpinlMj7bmi7R5TY9W/tQE1Tuh+\nOiZGsi6HWT7xpMKoGOPFcuZly6sqOVaYPVaAwlIt3DJaj8ygyKjfaHMi/WFP\nl6DZX1yB5LcvPS+ogfBacKoa0v4mH628JBg1vp+oCiXbVuvAZSSyLNu+OOdw\nJ1O6BZfXf1U3gAkSC/zm4iM3+QEbe4XBnvaTNkK5JOGWq27orbInXxVKXZrl\nXL777jmNVC/+8GEF/9Tj8hr+wF0lKhyDsqX954xV4bHLB5gj/06cEmwt2nBu\nktG5OVX5f2lszaXvebShHB0U1GeixnFHKmUTY9VBD5DGVIQK2Fo1kn72vKgC\n5c+FZyS/NB2u2+Y6ghUjbFK6mtpjqjw0WGxH4O6BR0z8E+t/slUV7khqUmlR\nbosLcdv1ubuMMqor+41OAGrIufagXXxQH1v4x1oHjOb32mBcgsNAv3ENyy8B\n2RZposonMfrk7T39hPRz23vySNY8qA0gfix3c3bNY/JjxNJgs6RrTZDX71Vd\n5sckzb6tBBAr0EzXGAOy71vSI3foVaO/aX+FGeIZsL20pYAE3dBT8DddQRGj\nNYGqj66MRD0s6MUv+CZkj0t6FpjRn4G+QKRMyngmc4JVIjKwSte8Tc4Pk0jq\ncxB5\r\n=yBeq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID4d3hGSfHJ5GBIgLAcf2CyPax/pzMzAiOYGiM2Q/hErAiA/gJDYOWE5RqPG/RMfg7BzcO6ABf9XBG9j9Ng8TKAiAA=="}],"size":4492,"noattachment":false,"key":"/point-in-polygon-hao/-/point-in-polygon-hao-1.1.0.tgz"},"_npmUser":{"name":"rowanwins","email":"rowanwins@yahoo.com.au"},"directories":{},"maintainers":[{"name":"rowanwins","email":"rowanwins@yahoo.com.au"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/point-in-polygon-hao_1.1.0_1628158716948_0.6063960239735451"},"_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":1628158717085,"_cnpm_publish_time":1628158717085,"dist-tags":{"latest":"1.2.4"}}