{"_id":"point-in-polygon","_rev":"291857","name":"point-in-polygon","description":"determine if a point is inside a polygon with a ray intersection counting algorithm","dist-tags":{"latest":"1.1.0"},"maintainers":[{"name":"substack","email":""}],"time":{"modified":"2021-06-03T18:52:03.000Z","created":"2012-01-01T20:26:16.441Z","1.1.0":"2021-03-16T00:05:38.792Z","1.0.2":"2021-03-15T23:00:55.342Z","1.0.1":"2016-07-06T04:24:57.831Z","1.0.0":"2015-06-13T17:59:39.967Z","0.0.0":"2012-01-01T20:26:16.441Z"},"users":{"marinho":true,"acollins-ts":true,"onesimusrex":true,"marcosc90":true,"scott.m.sarsfield":true},"author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"repository":{"type":"git","url":"git://github.com/substack/point-in-polygon.git"},"versions":{"1.1.0":{"name":"point-in-polygon","description":"determine if a point is inside a polygon with a ray intersection counting algorithm","version":"1.1.0","repository":{"type":"git","url":"git://github.com/substack/point-in-polygon.git"},"main":"index.js","keywords":["point","polygon","inside"],"directories":{"lib":".","example":"example","test":"test"},"scripts":{"test":"tape test/*.js"},"devDependencies":{"tape":"^4.0.0"},"license":"MIT","author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"gitHead":"24761fb3737d8d0d2a68dcf8be2c36c6a12cd1b8","bugs":{"url":"https://github.com/substack/point-in-polygon/issues"},"homepage":"https://github.com/substack/point-in-polygon#readme","_id":"point-in-polygon@1.1.0","_nodeVersion":"12.18.2","_npmVersion":"6.14.9","dist":{"shasum":"b0af2616c01bdee341cbf2894df643387ca03357","size":2792,"noattachment":false,"key":"/point-in-polygon/-/point-in-polygon-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/point-in-polygon/download/point-in-polygon-1.1.0.tgz"},"_npmUser":{"name":"substack","email":"substack@gmail.com"},"maintainers":[{"name":"substack","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/point-in-polygon_1.1.0_1615853138648_0.1543889365842157"},"_hasShrinkwrap":false,"publish_time":1615853138792,"_cnpm_publish_time":1615853138792},"1.0.2":{"name":"point-in-polygon","description":"determine if a point is inside a polygon with a ray intersection counting algorithm","version":"1.0.2","repository":{"type":"git","url":"git://github.com/substack/point-in-polygon.git"},"main":"index.js","keywords":["point","polygon","inside"],"directories":{"lib":".","example":"example","test":"test"},"scripts":{"test":"tape test/*.js"},"devDependencies":{"tape":"^4.0.0"},"license":"MIT","author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"gitHead":"5081a4a92d0a40a01e166296163407081aa052c7","bugs":{"url":"https://github.com/substack/point-in-polygon/issues"},"homepage":"https://github.com/substack/point-in-polygon#readme","_id":"point-in-polygon@1.0.2","_nodeVersion":"12.18.2","_npmVersion":"6.14.9","dist":{"shasum":"1a73773566092dcb563e5fdc05bbecce96f25caa","size":1987,"noattachment":false,"key":"/point-in-polygon/-/point-in-polygon-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/point-in-polygon/download/point-in-polygon-1.0.2.tgz"},"_npmUser":{"name":"substack","email":"substack@gmail.com"},"maintainers":[{"name":"substack","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/point-in-polygon_1.0.2_1615849255202_0.25244458139267145"},"_hasShrinkwrap":false,"publish_time":1615849255342,"_cnpm_publish_time":1615849255342},"1.0.1":{"name":"point-in-polygon","description":"determine if a point is inside a polygon with a ray intersection counting algorithm","version":"1.0.1","repository":{"type":"git","url":"git://github.com/substack/point-in-polygon.git"},"main":"index.js","keywords":["point","polygon","inside"],"directories":{"lib":".","example":"example","test":"test"},"scripts":{"test":"tape test/*.js"},"devDependencies":{"tape":"^4.0.0"},"license":"MIT","author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"gitHead":"e1888ce59696a5713b5520cbc17fa268ee703229","bugs":{"url":"https://github.com/substack/point-in-polygon/issues"},"homepage":"https://github.com/substack/point-in-polygon#readme","_id":"point-in-polygon@1.0.1","_shasum":"d59b64e8fee41c49458aac82b56718c5957b2af7","_from":".","_npmVersion":"3.7.1","_nodeVersion":"5.5.0","_npmUser":{"name":"substack","email":"substack@gmail.com"},"dist":{"shasum":"d59b64e8fee41c49458aac82b56718c5957b2af7","size":1904,"noattachment":false,"key":"/point-in-polygon/-/point-in-polygon-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/point-in-polygon/download/point-in-polygon-1.0.1.tgz"},"maintainers":[{"name":"substack","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/point-in-polygon-1.0.1.tgz_1467779094097_0.1194892106577754"},"publish_time":1467779097831,"_cnpm_publish_time":1467779097831,"_hasShrinkwrap":false},"1.0.0":{"name":"point-in-polygon","description":"determine if a point is inside a polygon with a ray intersection counting algorithm","version":"1.0.0","repository":{"type":"git","url":"git://github.com/substack/point-in-polygon.git"},"main":"index.js","keywords":["point","polygon","inside"],"directories":{"lib":".","example":"example","test":"test"},"scripts":{"test":"tape test/*.js"},"devDependencies":{"tape":"^4.0.0"},"license":"MIT","author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"gitHead":"fcc078d5f302736aa09c5c87ae1337d798a9e9ef","bugs":{"url":"https://github.com/substack/point-in-polygon/issues"},"homepage":"https://github.com/substack/point-in-polygon#readme","_id":"point-in-polygon@1.0.0","_shasum":"f722230c368af6275621ee3839db34b6ee8758a2","_from":".","_npmVersion":"2.10.1","_nodeVersion":"2.0.0","_npmUser":{"name":"substack","email":"substack@gmail.com"},"dist":{"shasum":"f722230c368af6275621ee3839db34b6ee8758a2","size":1236,"noattachment":false,"key":"/point-in-polygon/-/point-in-polygon-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/point-in-polygon/download/point-in-polygon-1.0.0.tgz"},"maintainers":[{"name":"substack","email":""}],"publish_time":1434218379967,"_cnpm_publish_time":1434218379967,"_hasShrinkwrap":false},"0.0.0":{"name":"point-in-polygon","description":"determine if a point is inside a polygon with a ray intersection counting algorithm","version":"0.0.0","repository":{"type":"git","url":"git://github.com/substack/point-in-polygon.git"},"main":"index.js","keywords":["point","polygon","inside"],"directories":{"lib":".","example":"example","test":"test"},"scripts":{"test":"tap test/*.js"},"devDependencies":{"tap":"0.0.x"},"engines":{"node":">=0.4.0"},"license":"MIT","author":{"name":"James Halliday","email":"mail@substack.net","url":"http://substack.net"},"_npmUser":{"name":"substack","email":"mail@substack.net"},"_id":"point-in-polygon@0.0.0","dependencies":{},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"09130fc5cdef218de5f9bdf0e6c4a3b2e1beae51","size":1195,"noattachment":false,"key":"/point-in-polygon/-/point-in-polygon-0.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/point-in-polygon/download/point-in-polygon-0.0.0.tgz"},"maintainers":[{"name":"substack","email":""}],"publish_time":1325449576441,"_cnpm_publish_time":1325449576441,"_hasShrinkwrap":false}},"readme":"# point-in-polygon\n\nDetermine if a point is inside of a polygon.\n\nThis module casts a semi-infinite ray from the inquiry point and counts intersections,\nbased on\n[this algorithm](https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html).\n\nIf you need a numerically robust solution and are willing to trade some performance for it,\nuse [robust-point-in-polygon](https://github.com/mikolalysenko/robust-point-in-polygon).\n\n# example\n\n``` js\nvar pointInPolygon = require('point-in-polygon');\nvar polygon = [ [ 1, 1 ], [ 1, 2 ], [ 2, 2 ], [ 2, 1 ] ];\n\nconsole.log(pointInPolygon([ 1.5, 1.5 ], polygon)); // true\nconsole.log(pointInPolygon([ 4.9, 1.2 ], polygon)); // false\nconsole.log(pointInPolygon([ 1.8, 1.1 ], polygon)); // true\n```\n\n# methods\n\n``` js\nvar pointInPolygon = require('point-in-polygon')\nvar pointInPolygonFlat = require('point-in-polygon/flat')\nvar pointInPolygonNested = require('point-in-polygon/nested')\n```\n\n## pointInPolygon(point, polygon, start=0, end=polygon.length)\n\nReturn whether `point` is contained in `polygon`.\n\n* `point` should be a 2-item array of coordinates\n* `polygon` should be an array of 2-item arrays of coordinates or a flat array of coordinates\n* `start` is an offset into `polygon`. default `0`\n* `end` is an offset into `polygon`. default `polygon.length`\n\nThe flat or nested is detected automatically. Or you can use the specific methods if you want to\nskip the check.\n\n# install\n\n```\nnpm install point-in-polygon\n```\n\n# license\n\nMIT\n","_attachments":{},"homepage":"https://github.com/substack/point-in-polygon#readme","bugs":{"url":"https://github.com/substack/point-in-polygon/issues"},"license":"MIT"}