{"_id":"point-in-big-polygon","_rev":"17-2671fbf6d1e517fd473d8c13f95c756c","name":"point-in-big-polygon","description":"Industrial strength point in polygon test","dist-tags":{"latest":"2.0.1"},"versions":{"0.0.0":{"name":"point-in-big-polygon","version":"0.0.0","description":"Industrial strength point in polygon test","main":"pnp-big.js","directories":{"test":"test"},"dependencies":{"robust-orientation":"^1.0.0","slab-decomposition":"^0.0.0"},"devDependencies":{"tape":"~2.5.0"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/point-in-big-polygon.git"},"keywords":["point","in","big","polygon","robust","exact","fast","scalable","2d","classify","orient"],"author":{"name":"Mikola Lysenko"},"license":"MIT","bugs":{"url":"https://github.com/mikolalysenko/point-in-big-polygon/issues"},"homepage":"https://github.com/mikolalysenko/point-in-big-polygon","_id":"point-in-big-polygon@0.0.0","dist":{"shasum":"5ddfacf15a1668098f2fafe8f26e752c54fd6df5","tarball":"https://registry.npmjs.org/point-in-big-polygon/-/point-in-big-polygon-0.0.0.tgz","integrity":"sha512-fV37aBUgvitqfmvWDQPFIom2piD/brmkw7hpvLiuY4UMzanyl0BlgU09z7VrSNW48eIlHdoEfoiI4tt7YG5/LA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGceHFtXlYCySYakT3GeHKxPKlxIE9rqaNFMtCHkJyp7AiEAuaE8EEORcxRoJj/twbfVDNbsvPZVk9gWzvegyuw2TI8="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}]},"0.0.1":{"name":"point-in-big-polygon","version":"0.0.1","description":"Industrial strength point in polygon test","main":"pnp-big.js","directories":{"test":"test"},"dependencies":{"robust-orientation":"^1.0.0","slab-decomposition":"^1.0.1"},"devDependencies":{"tape":"~2.5.0"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/point-in-big-polygon.git"},"keywords":["point","in","big","polygon","robust","exact","fast","scalable","2d","classify","orient"],"author":{"name":"Mikola Lysenko"},"license":"MIT","bugs":{"url":"https://github.com/mikolalysenko/point-in-big-polygon/issues"},"homepage":"https://github.com/mikolalysenko/point-in-big-polygon","_id":"point-in-big-polygon@0.0.1","dist":{"shasum":"2ff7a63d2f340a18e7008a2ba344793f43a3e807","tarball":"https://registry.npmjs.org/point-in-big-polygon/-/point-in-big-polygon-0.0.1.tgz","integrity":"sha512-nHB2fM9rGGAgHoI7LlTzdgBO0OH9YHWtoCHpOGYXv8uDCno7a3aGVEvdokwLWoBJO1ET7BVJHuwYLcZaBBW1xw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDoLjbCB+ZmIlnbC2MeNsIZ8S22vgpz3l4dw/1N9tCEhwIhAOIfgds2q1qKvD+yyJcg7cgQqn/uR+x//5IDaEGp8d34"}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}]},"1.0.0":{"name":"point-in-big-polygon","version":"1.0.0","description":"Industrial strength point in polygon test","main":"pnp-big.js","directories":{"test":"test"},"dependencies":{"robust-orientation":"^1.0.2","slab-decomposition":"^1.0.1"},"devDependencies":{"tape":"~2.5.0","signum":"0.0.0","robust-point-in-polygon":"0.0.0"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/point-in-big-polygon.git"},"keywords":["point","in","big","polygon","robust","exact","fast","scalable","2d","classify","orient"],"author":{"name":"Mikola Lysenko"},"license":"MIT","bugs":{"url":"https://github.com/mikolalysenko/point-in-big-polygon/issues"},"homepage":"https://github.com/mikolalysenko/point-in-big-polygon","_id":"point-in-big-polygon@1.0.0","dist":{"shasum":"18667257a18ba9ceaa39de4fc3a2cf4996a20225","tarball":"https://registry.npmjs.org/point-in-big-polygon/-/point-in-big-polygon-1.0.0.tgz","integrity":"sha512-4ndmlqCakU2K3hskeJpgMp10RJubHfDbdhJpk09cwTLs5eHVDurq8etTSI5x5ITVKLIpHRLkAhaMHXsV7nluqw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICUxTBubo6SB4fFZytLuY3f1CwDWy4iK/BNOzYI9KmRDAiAbXAw/B8mMq0AMdyciuIhMPscXsfa8psqZ0AJCW17Z4A=="}]},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}]},"2.0.0":{"name":"point-in-big-polygon","version":"2.0.0","description":"Industrial strength point in polygon test","main":"pnp-big.js","directories":{"test":"test"},"dependencies":{"binary-search-bounds":"^1.0.0","interval-tree-1d":"^1.0.1","robust-orientation":"^1.1.3","slab-decomposition":"^1.0.1"},"devDependencies":{"tape":"~2.5.0","signum":"0.0.0","robust-point-in-polygon":"^1.0.3"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/point-in-big-polygon.git"},"keywords":["point","in","big","polygon","robust","exact","fast","scalable","2d","classify","orient"],"author":{"name":"Mikola Lysenko"},"license":"MIT","bugs":{"url":"https://github.com/mikolalysenko/point-in-big-polygon/issues"},"homepage":"https://github.com/mikolalysenko/point-in-big-polygon","gitHead":"5ef01b1d2bc7d4354608562eceb69953131d6700","_id":"point-in-big-polygon@2.0.0","_shasum":"39b613ea6cf17d6b43e188f77f34c44c6b33ba55","_from":".","_npmVersion":"2.1.4","_nodeVersion":"0.10.26","_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"dist":{"shasum":"39b613ea6cf17d6b43e188f77f34c44c6b33ba55","tarball":"https://registry.npmjs.org/point-in-big-polygon/-/point-in-big-polygon-2.0.0.tgz","integrity":"sha512-FS9R6AYKOtxfZFV7Yq1/CEkravx5p/guHZIlTRj0vhhgkeA48jj4egJhbt3eUjN0dfsJzbKH9WyxB1EqIgx/rw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1NdlA6lWf6PNwqXNB4SitlgWSV7OmxHM7xkf72h6WdQIgC8AQCZht7UgTyO6CQJcBdNT2DGo9yLb2ayW8B1qj/6Y="}]}},"2.0.1":{"name":"point-in-big-polygon","version":"2.0.1","description":"Industrial strength point in polygon test","main":"pnp-big.js","directories":{"test":"test"},"dependencies":{"binary-search-bounds":"^2.0.0","interval-tree-1d":"^1.0.1","robust-orientation":"^1.1.3","slab-decomposition":"^1.0.1"},"devDependencies":{"tape":"~2.5.0","signum":"0.0.0","robust-point-in-polygon":"^1.0.3"},"scripts":{"test":"tape test/*.js"},"repository":{"type":"git","url":"git://github.com/mikolalysenko/point-in-big-polygon.git"},"keywords":["point","in","big","polygon","robust","exact","fast","scalable","2d","classify","orient"],"author":{"name":"Mikola Lysenko"},"license":"MIT","bugs":{"url":"https://github.com/mikolalysenko/point-in-big-polygon/issues"},"homepage":"https://github.com/mikolalysenko/point-in-big-polygon","gitHead":"91094f90d1441d38def20348df02248cc6cee0b2","_id":"point-in-big-polygon@2.0.1","_nodeVersion":"14.15.3","_npmVersion":"6.14.10","dist":{"integrity":"sha512-DtrN8pa2VfMlvmWlCcypTFeBE4+OYz1ojDNJLKCWa4doiVAD6PRBbxFYAT71tsp5oKaRXT5sxEiHCAQKb1zr2Q==","shasum":"69d293010cead58af08c3082ad1d23f600ef10af","tarball":"https://registry.npmjs.org/point-in-big-polygon/-/point-in-big-polygon-2.0.1.tgz","fileCount":6,"unpackedSize":11390,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJguEbyCRA9TVsSAnZWagAATOAP/2J4EqqMs3KRrE/j3AWv\nrN+d1sxvGONXZ2T8kjVXWm6HIgwGCHpH0+zn1dPxLb7lIImRXs/NdR3HZs74\npGM71Q9iCxyxibzx/JbGAcNiEoryhvqd+AntGuWY7/V/WLF2s9qbq239oJvI\nkuUn3W0pasJ8cNvj/jfQPzRonySfZgaQGa+UQdKqVmqg1GXA8Fm3GYSiZLFa\nEfQ/I6qiMNHpyvbAGGJ62BcnPkiDOrYpZKwQFWSjvSzN0m0WPYkNJoPr2sFU\nGgVKKfIew1EiBNvittmSGnZrifZ+lmZAjFAfwDCcXj7C9+3eOG81D7AHcopS\nk4Nbmq8reLy1sJpX0uZheAEE2p/zqsYk1kB3N+8/4uxWotM+UBL2jNM+9Khz\nFqUnlLC3AhD0SjLCbsp5idfLtY2l6fmCdBh4p4UBDYtoz8tzOxpkSONIRok1\nQmQaVjvp2DHQQ19n1z78uiZqv12wury9j3vDz4yLpqf7zsml3hRPmRtmU73a\nePC6DmEeP7jMOhJFq2Jg0N62Y5I14F8bIdDhl+QNaZYs76esI5CiQddRyCQv\nqnQK0InMtClbjqSokAa5FN/qzoMe3JuZkHA4RLzNGPU2bKx5DmVE739gGcG2\nR7UAQRmH6QCNgwL7d/W6jeInzUiUlR6hVTKMpPifzBknCNsOfoMoSgi0vyYg\nD+KT\r\n=SAvk\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9Sh+Mj9+pm2X3vCrqEdI6lzZASV0tRYQ5NTCAXXLerwIgOpIX4nYRY4RCVtJ+DfutxBx6eYo/fnPo9umiuowNLeE="}]},"_npmUser":{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"},"maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/point-in-big-polygon_2.0.1_1622689522585_0.4125229833577133"},"_hasShrinkwrap":false}},"readme":"point-in-big-polygon\n====================\nIndustrial scale point-in-polygon test. Given a polygon, this module preprocesses it in O(n log(n)) time such that any point can be classified against the polygon in O(log(n)) operations. All computations are performed in exact arithmetic.\n\nIf you want to use multiple polygons/regions, you should use [point-in-region](https://github.com/mikolalysenko/point-in-region) instead.\n\n# Example\n\n```javascript\nvar preprocessPolygon = require('point-in-big-polygon')\n\n//Define the polygon loops\nvar loops = [\n  [ [-10, -10], [-10, 10], [10, 10], [10, -10] ],\n  [ [-1, -1], [1, -1], [1, 1], [-1, 1] ]\n]\n\n//Preprocess it\nvar classifyPoint = preprocessPolygon(loops)\n\n//Render polygon test in ASCII to console\nvar img = []\nfor(var y=-12; y<=12; y+=1) {\n  var row = []\n  for(var x=-12; x<=12; x+=0.5) {\n    var v = classifyPoint([x, y])\n    if(v < 0) {\n      row.push('-')\n    } else if(v === 0) {\n      row.push('o')\n    } else {\n      row.push('+')\n    }\n  }\n  img.push(row.join(''))\n}\nconsole.log(img.join('\\n'))\n```\n\nExample output:\n\n```\n+++++++++++++++++++++++++++++++++++++++++++++++++\n+++++++++++++++++++++++++++++++++++++++++++++++++\n++++ooooooooooooooooooooooooooooooooooooooooo++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++o-----------------ooooo-----------------o++++\n++++o-----------------o+++o-----------------o++++\n++++o-----------------ooooo-----------------o++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++o---------------------------------------o++++\n++++ooooooooooooooooooooooooooooooooooooooooo++++\n+++++++++++++++++++++++++++++++++++++++++++++++++\n+++++++++++++++++++++++++++++++++++++++++++++++++\n```\n\n# Install\n\nThis module works in any reasonable CommonJS environment including browserify, iojs and node.js.\n\n```\nnpm install point-in-big-polygon\n```\n\n# API\n\n## Constructor\n\n#### `var classifyPoint = require(\"point-in-big-polygon\")(loops)`\nPreprocess a polygon given by a collection of clockwise oriented loops to handle point membership queries.\n\n* `loops` are a collection of oriented loops representing the boundary of the polygon. These loops must be manifold (ie no self intersections or dangling edges).\n\n**Returns** A point membership function that can be used to classify points relative to the function\n\n## Method\n\n#### `classifyPoint(p)`\nThis function is the result of running the preprocessing operation on a polygon. It takes a single point as input and tests it against the boundary.\n\n* `p` is a point encoded as a length 2 array\n\n**Returns** A number which classifies `p` relative to the boundary\n\n* `-1` means that `p` is inside\n* `0` means that `p` is on the boundary\n* `+1` means that `p` is outside\n\n# Credits\n(c) 2014 Mikola Lysenko. MIT License","maintainers":[{"name":"mikolalysenko","email":"mikolalysenko@gmail.com"}],"time":{"modified":"2022-06-24T06:02:42.399Z","created":"2014-03-01T19:55:37.965Z","0.0.0":"2014-03-01T19:55:39.100Z","0.0.1":"2014-03-30T14:57:16.542Z","1.0.0":"2014-04-28T22:33:25.902Z","2.0.0":"2015-01-30T14:11:31.429Z","2.0.1":"2021-06-03T03:05:22.745Z"},"readmeFilename":"README.md","homepage":"https://github.com/mikolalysenko/point-in-big-polygon","keywords":["point","in","big","polygon","robust","exact","fast","scalable","2d","classify","orient"],"repository":{"type":"git","url":"git://github.com/mikolalysenko/point-in-big-polygon.git"},"author":{"name":"Mikola Lysenko"},"bugs":{"url":"https://github.com/mikolalysenko/point-in-big-polygon/issues"},"license":"MIT","users":{"maxogden":true,"eterna2":true,"mast4461":true}}