{"_id":"which-polygon","_rev":"25-33da2b9f66454b1039af60066fd1970c","name":"which-polygon","description":"Index for matching points against a set of GeoJSON polygons","dist-tags":{"latest":"2.2.1"},"versions":{"1.0.0":{"name":"which-polygon","version":"1.0.0","description":"Index for matching points against a set of GeoJSON polygons","main":"index.js","dependencies":{"rbush":"^1.4.1"},"devDependencies":{"eslint":"^1.8.0","eslint-config-mourner":"^1.0.1"},"scripts":{"test":"eslint *.js"},"repository":{"type":"git","url":"git+https://github.com/mapbox/which-polygon.git"},"keywords":["index","polygon","geojson","query"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","bugs":{"url":"https://github.com/mapbox/which-polygon/issues"},"homepage":"https://github.com/mapbox/which-polygon#readme","eslintConfig":{"extends":"mourner"},"gitHead":"d67d2a60f3ddcbab936ff1cbfd2a801cce7a6350","_id":"which-polygon@1.0.0","_shasum":"10d6ce06fee40015a1f622aefa9c66ec8a5765f0","_from":".","_npmVersion":"3.3.10","_nodeVersion":"0.12.7","_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"dist":{"shasum":"10d6ce06fee40015a1f622aefa9c66ec8a5765f0","tarball":"https://registry.npmjs.org/which-polygon/-/which-polygon-1.0.0.tgz","integrity":"sha512-a4siI2zRAML7HTDQ2M5sKinZol/rheo4pfAeEbOq/3f/4DdnSlNDr/lUDmDUEhIVux8Uve3WoI+FR0xS1QvaDQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCCvD9INbYlyvcGtcBowEbmY3rOtUdgdvwk8y+Erx7YYQIgI0orB2r81EaupNnZLBfeaWcYsQALPIQllpoVD/sacmY="}]},"maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"directories":{}},"2.0.0":{"name":"which-polygon","version":"2.0.0","description":"Index for matching points against a set of GeoJSON polygons","main":"index.js","dependencies":{"rbush":"^1.4.1"},"devDependencies":{"eslint":"^1.8.0","eslint-config-mourner":"^1.0.1","tap":"^2.2.0"},"scripts":{"pretest":"eslint *.js","test":"tap test/test.js"},"repository":{"type":"git","url":"git+https://github.com/mapbox/which-polygon.git"},"keywords":["index","polygon","geojson","query"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","bugs":{"url":"https://github.com/mapbox/which-polygon/issues"},"homepage":"https://github.com/mapbox/which-polygon#readme","eslintConfig":{"extends":"mourner"},"gitHead":"3469541deaa6167897653f27a75558cd4b890cb0","_id":"which-polygon@2.0.0","_shasum":"6f03cbfa1fcfb9d173c40a646a69f963e06a577e","_from":".","_npmVersion":"3.3.10","_nodeVersion":"0.12.7","_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"dist":{"shasum":"6f03cbfa1fcfb9d173c40a646a69f963e06a577e","tarball":"https://registry.npmjs.org/which-polygon/-/which-polygon-2.0.0.tgz","integrity":"sha512-uUi0C+DF1jU5O3Luh/YjUanj3mb9GUfhth2CnsdP0v85psNUdwvyGaT3CAdKrmnSf2IrJD8HQQzBg9m4MLlhpg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtANb3WXuxWcLkaFHQmnuFvdgfKgTncJMZzG4zP4ZtWwIhAMHRnsjjW2zMPhny9JqgDg2b0CVKxfGvWJKW/d2/zVe6"}]},"maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"directories":{}},"2.0.1":{"name":"which-polygon","version":"2.0.1","description":"Index for matching points against a set of GeoJSON polygons","main":"index.js","dependencies":{"rbush":"^2.0.1"},"devDependencies":{"eslint":"^3.6.0","eslint-config-mourner":"^2.0.1","tap":"^7.1.2"},"scripts":{"pretest":"eslint *.js","test":"tap test/test.js"},"repository":{"type":"git","url":"git+https://github.com/mapbox/which-polygon.git"},"keywords":["index","polygon","geojson","query"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","bugs":{"url":"https://github.com/mapbox/which-polygon/issues"},"homepage":"https://github.com/mapbox/which-polygon#readme","eslintConfig":{"extends":"mourner"},"gitHead":"8d976652a25264b7d74b26c7d7b748c1955b70ca","_id":"which-polygon@2.0.1","_shasum":"4fce4032b328936a3c90fa10daba341345916380","_from":".","_npmVersion":"3.10.7","_nodeVersion":"6.6.0","_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"dist":{"shasum":"4fce4032b328936a3c90fa10daba341345916380","tarball":"https://registry.npmjs.org/which-polygon/-/which-polygon-2.0.1.tgz","integrity":"sha512-No0SoD+yoq84k/ukMLfqtwkX4ODvVdghERVSeQqLQMsRL7jy+zT5W7xAMmiNVryQaN67jzYWO+OI+Kj+2sSfxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLt/glJWqBW9ZJs/l8zDT2Yp58D78wGSkYLq8C3ZlYOQIgAarZvbJO+bYhubw8NWJIbtMlvhIckd0oIKVoEyYbqDs="}]},"maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/which-polygon-2.0.1.tgz_1474896992717_0.28599964268505573"},"directories":{}},"2.1.0":{"name":"which-polygon","version":"2.1.0","description":"Index for matching points against a set of GeoJSON polygons","main":"index.js","dependencies":{"rbush":"^2.0.1","lineclip":"^1.1.5"},"devDependencies":{"eslint":"^3.6.0","eslint-config-mourner":"^2.0.1","tap":"^7.1.2"},"scripts":{"pretest":"eslint *.js","test":"tap test/test.js"},"repository":{"type":"git","url":"git+https://github.com/mapbox/which-polygon.git"},"keywords":["index","polygon","geojson","query"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","bugs":{"url":"https://github.com/mapbox/which-polygon/issues"},"homepage":"https://github.com/mapbox/which-polygon#readme","eslintConfig":{"extends":"mourner"},"gitHead":"c0b775d38980c1a1e3f44e9afdb18aedd89802af","_id":"which-polygon@2.1.0","_shasum":"3dbffa2be95201fa068d565d427058926d8db49a","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.7.0","_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"dist":{"shasum":"3dbffa2be95201fa068d565d427058926d8db49a","tarball":"https://registry.npmjs.org/which-polygon/-/which-polygon-2.1.0.tgz","integrity":"sha512-ow8UpU8BMYWP4V7xWZzJtbuO7Rsi/xppcSeOynkSB02od32wdjmG/T6crmi8eG/wIla7OGs6+N/PDSGJtSjS7Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEZFC20VUpOlSnpoa3ph/u96tKoU03flszdh0Db/AqlsAiBFbOSohkGZmtTlpbTJL4Sp53ViNozBZH/fz4AArvTflg=="}]},"maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/which-polygon-2.1.0.tgz_1476357495495_0.9916757259052247"},"directories":{}},"2.2.0":{"name":"which-polygon","version":"2.2.0","description":"Index for matching points against a set of GeoJSON polygons","main":"index.js","dependencies":{"rbush":"^2.0.1","lineclip":"^1.1.5"},"devDependencies":{"eslint":"^4.9.0","eslint-config-mourner":"^2.0.1","tap":"^10.7.2"},"scripts":{"pretest":"eslint *.js","test":"tap test/test.js"},"repository":{"type":"git","url":"git+https://github.com/mapbox/which-polygon.git"},"keywords":["index","polygon","geojson","query"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","bugs":{"url":"https://github.com/mapbox/which-polygon/issues"},"homepage":"https://github.com/mapbox/which-polygon#readme","eslintConfig":{"extends":"mourner"},"gitHead":"e6faafe98ba4623e3c45fc00a24bdd018169f174","_id":"which-polygon@2.2.0","_npmVersion":"5.5.1","_nodeVersion":"8.7.0","_npmUser":{"name":"mourner","email":"agafonkin@gmail.com"},"dist":{"integrity":"sha512-P2+zRXPqUsTVm4moH8gm7ZTlLtOemy4+EY8elJohjJNMTNpkXLFrlI7i2zUYJD8zHopgKH5TuBmYXca3ZLtMkg==","shasum":"e4741c050620e55f932b0355d30327136dc8041d","tarball":"https://registry.npmjs.org/which-polygon/-/which-polygon-2.2.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBQgZgjvjStDoxSrwkkuBUP/OOATUIxlb/YkJvlRluiXAiAQuvM1sqUpcZaKKpzjKXtqShUxHe0hQ6tq68TX56qlWw=="}]},"maintainers":[{"name":"mourner","email":"agafonkin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/which-polygon-2.2.0.tgz_1508143289036_0.7466123795602471"},"directories":{}},"2.2.1":{"name":"which-polygon","version":"2.2.1","description":"Index for matching points against a set of GeoJSON polygons","main":"index.js","dependencies":{"rbush":"^2.0.1","lineclip":"^1.1.5"},"devDependencies":{"eslint":"^4.9.0","eslint-config-mourner":"^2.0.1","tap":"^10.7.2"},"scripts":{"pretest":"eslint *.js","test":"tap test/test.js"},"repository":{"type":"git","url":"git+https://github.com/mapbox/which-polygon.git"},"keywords":["index","polygon","geojson","query"],"author":{"name":"Vladimir Agafonkin"},"license":"ISC","bugs":{"url":"https://github.com/mapbox/which-polygon/issues"},"homepage":"https://github.com/mapbox/which-polygon#readme","eslintConfig":{"extends":"mourner"},"gitHead":"ad814168b4876eeade591dcd69264c3914577541","_id":"which-polygon@2.2.1","_nodeVersion":"14.19.1","_npmVersion":"8.5.5","dist":{"integrity":"sha512-RlpWbqz12OMT0r2lEHk7IUPXz0hb1L/ZZsGushB2P2qxuBu1aq1+bcTfsLtfoRBYHsED6ruBMiwFaidvXZfQVw==","shasum":"093d76c9628ee12bfae39448609accbdcc268c31","tarball":"https://registry.npmjs.org/which-polygon/-/which-polygon-2.2.1.tgz","fileCount":9,"unpackedSize":53420,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICsophwUE0DIkxhQTTdAnccj2LJznz6YokRLQUlJDkZ1AiBL+meLmZQE4rKWcNLzkm3lii/Aevo/bdL5UYmrQfGJbg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7lt/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq92A/5AGgRd/tgjGqJ+X2gEpyG/L1cKYUfi2kFf7VPw+16pqO54HSW\r\niAsTAiI7gnglBOedBU/MoVCvt14NIbEUalZyMUwydE7Bg0vRr5U8TSRmhTnf\r\nbEsd8k30pBzvUkmU5hDguRW7eBlAlF1WosfTIz7JV+6b8YywSdl6FOoyfzjI\r\nwbuVXHxw8yVrDVv6E7AhQhWz8TQ3jzYXzq4WtdGXYVtVXI99xUGqbnbKX92Z\r\neIOxR0fMTOcCI4I1dRy+jCTP9GiStOrUMJEgRK3OY31N3vK76g0cTuBFXjgu\r\n1psgJuK1KCVIUuTSVxZ70s0R/TDSMmmMZJVTdAplZvW36R2OUkHlqRo7mYQo\r\nnf+h/7DYDVzZCWZPjZhUE5cqHbQD0jWu7XnyWfZJP+FalNQQeFtZthIX4EMX\r\ndW6EtAA5guPQ4gDZrvB6622CWbKuyzt6jcwJtfXtjPioGqbSp6tymFvt8y2O\r\nQKlsje4WnD1qYT5ODyTZOOiqagxQ18e5KUrGwxD4XI+blxHWdgQD7pBuTy3j\r\n+INyZaQw4960GBW6CG7HCCK1NrrggrSY3EFFEX/kzc2CgbkkwYwgqfCAunqq\r\nC3EvOBJRhtaYqRcq2PntbMHE8sltE/ZITZK5SktqEvvJ1oL5s73iDVhIF99o\r\nvc44JQdsWqzBuW1Dvf+PjmhC9bjAOQxiypY=\r\n=tlwK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},"directories":{},"maintainers":[{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/which-polygon_2.2.1_1676565375726_0.4000524679749209"},"_hasShrinkwrap":false}},"readme":"A simple index for matching points and bboxes against a set of GeoJSON polygons to find what polygon it belongs to.\nFor example, determining the country of a location given a countries GeoJSON.\n\n[![Build Status](https://travis-ci.org/mapbox/which-polygon.svg?branch=master)](https://travis-ci.org/mapbox/which-polygon)\n[![Coverage Status](https://coveralls.io/repos/mapbox/which-polygon/badge.svg?branch=master&service=github)](https://coveralls.io/github/mapbox/which-polygon?branch=master)\n[![](https://img.shields.io/badge/simply-awesome-brightgreen.svg)](https://github.com/mourner/projects)\n\n### Example usage\n\n\n```js\nvar geojson = require('./countries.json');\nvar query = whichPolygon(geojson);\n\nquery([30.5, 50.5]).admin; // 'Ukraine'\n```\n\nThe input GeoJSON must be a feature collection of polygons or multipolygons.\nThe query returns the properties of the matched polygon feature.\n\nBy default, the query returns properties of the first polygon that has been found (object or null).\nTo return an array of all found polygon properties, use option `multi` as the second argument:\n\n```js\nquery([14.3, 51.2], true); // [{props1}, {props2}, {props3}, ...] || null\n```\n\nOnce the index is built, queries are pretty fast —\n17 seconds to query 1 million random locations on a Macbook Pro in this particular case.\n\nYou can also query all polygons that intersect a given bbox:\n\n```js\nvar query = whichPolygon(geojson);\nvar results = query.bbox([30.5, 50.5, 30.51, 50.51]);\nresults[0].admin; // 'Ukraine'\n```\n","maintainers":[{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"time":{"modified":"2023-02-16T16:36:16.690Z","created":"2015-11-03T19:59:53.079Z","1.0.0":"2015-11-03T19:59:53.079Z","2.0.0":"2015-11-04T11:48:50.207Z","2.0.1":"2016-09-26T13:36:34.757Z","2.1.0":"2016-10-13T11:18:17.537Z","2.2.0":"2017-10-16T08:41:30.013Z","2.2.1":"2023-02-16T16:36:15.886Z"},"homepage":"https://github.com/mapbox/which-polygon#readme","keywords":["index","polygon","geojson","query"],"repository":{"type":"git","url":"git+https://github.com/mapbox/which-polygon.git"},"author":{"name":"Vladimir Agafonkin"},"bugs":{"url":"https://github.com/mapbox/which-polygon/issues"},"license":"ISC","readmeFilename":"README.md","users":{"mwesten":true}}