{"versions":{"1.1.0":{"name":"geokdbush","version":"1.1.0","main":"index.js","author":{"name":"Vladimir Agafonkin","email":"agafonkin@gmail.com"},"license":"ISC","dependencies":{"tinyqueue":"^1.2.2"},"devDependencies":{"all-the-cities":"2.0.0","eslint":"^3.17.1","eslint-config-mourner":"^2.0.1","kdbush":"^1.0.1","sphere-knn":"^1.3.1","tape":"^4.6.3"},"eslintConfig":{"extends":"mourner"},"scripts":{"pretest":"eslint index.js test.js bench","test":"tape test.js","bench":"cd bench && node bench-geokdbush && node bench-sphere-knn && node bench-naive"},"gitHead":"39b02eb83946a57e65b396816beb58d2083c9e67","description":"A geographic extension for [kdbush](https://github.com/mourner/kdbush), the fastest static spatial index for points in JavaScript.","_id":"geokdbush@1.1.0","_shasum":"aa5e8e7953a6594b40a85fbdb61059af0f51468f","_from":".","_npmVersion":"4.2.0","_nodeVersion":"7.9.0","_npmUser":{"name":"anonymous","email":"agafonkin@gmail.com"},"dist":{"shasum":"aa5e8e7953a6594b40a85fbdb61059af0f51468f","size":21646,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/geokdbush/-/geokdbush-1.1.0.tgz","integrity":"sha512-pyyrGCMXZwWJaGt1YZIgGQg5ol3JjvEKESTon10HxdfWXlaqh5An8fNJkwOYUE+VkQfCdvYQKPVezTQU9AqWAA=="},"maintainers":[{"name":"anonymous","email":"agafonkin@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/geokdbush-1.1.0.tgz_1493297520516_0.6545148896984756"},"directories":{},"publish_time":1493297523000,"_hasShrinkwrap":false,"_cnpm_publish_time":1493297523000,"_cnpmcore_publish_time":"2021-12-16T20:11:39.613Z","contributors":[]},"1.0.2":{"name":"geokdbush","version":"1.0.2","main":"index.js","author":{"name":"Vladimir Agafonkin","email":"agafonkin@gmail.com"},"license":"ISC","dependencies":{"tinyqueue":"^1.2.2"},"devDependencies":{"all-the-cities":"2.0.0","eslint":"^3.17.1","eslint-config-mourner":"^2.0.1","kdbush":"^1.0.1","sphere-knn":"^1.3.1","tape":"^4.6.3"},"eslintConfig":{"extends":"mourner"},"scripts":{"pretest":"eslint index.js test.js bench","test":"tape test.js","bench":"cd bench && node bench-geokdbush && node bench-sphere-knn && node bench-naive"},"gitHead":"8189b64c2b884cdc2c262405adda3d6bed2b9639","description":"A geographic extension for [kdbush](https://github.com/mourner/kdbush), the fastest static spatial index for points in JavaScript.","_id":"geokdbush@1.0.2","_shasum":"509db825f0cf08954962c09e256e84fef8fc60de","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.2","_npmUser":{"name":"anonymous","email":"agafonkin@gmail.com"},"dist":{"shasum":"509db825f0cf08954962c09e256e84fef8fc60de","size":17216,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/geokdbush/-/geokdbush-1.0.2.tgz","integrity":"sha512-jU4Yt1fWIRe3+RDmPVwhVnxUcni/jg2J2TCp8rJKRxfQgm+Xhb9XHu7L8/IPJFqIBoRTruaDYge2TwrxN3H6tg=="},"maintainers":[{"name":"anonymous","email":"agafonkin@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/geokdbush-1.0.2.tgz_1489850393914_0.8117009266279638"},"directories":{},"publish_time":1489850395915,"_hasShrinkwrap":false,"_cnpm_publish_time":1489850395915,"_cnpmcore_publish_time":"2021-12-16T20:11:39.879Z","contributors":[]},"1.0.1":{"name":"geokdbush","version":"1.0.1","main":"index.js","author":{"name":"Vladimir Agafonkin","email":"agafonkin@gmail.com"},"license":"ISC","dependencies":{"tinyqueue":"^1.2.2"},"devDependencies":{"all-the-cities":"2.0.0","eslint":"^3.17.1","eslint-config-mourner":"^2.0.1","kdbush":"^1.0.1","sphere-knn":"^1.3.1","tape":"^4.6.3"},"eslintConfig":{"extends":"mourner"},"scripts":{"pretest":"eslint *.js bench","test":"tape test.js","bench":"cd bench && node bench-geokdbush && node bench-sphere-knn && node bench-naive"},"gitHead":"01b5a1ae1a787e1cd0238d89b90ffcf6c0a9d7db","description":"A geographic extension for [kdbush](https://github.com/mourner/kdbush), the fastest static spatial index for points in JavaScript.","_id":"geokdbush@1.0.1","_shasum":"33046463fbc0c3158ea0d456c90432d10b23efc0","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.2","_npmUser":{"name":"anonymous","email":"agafonkin@gmail.com"},"dist":{"shasum":"33046463fbc0c3158ea0d456c90432d10b23efc0","size":14614,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/geokdbush/-/geokdbush-1.0.1.tgz","integrity":"sha512-0uXIC1uA4tV35r1HCyznY5mqAwbBAZ8TYHZAgLSrMVGgLodLTqqF5wC4LG23MrJoexvZ24JtvQtAZSfNDFqp9Q=="},"maintainers":[{"name":"anonymous","email":"agafonkin@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/geokdbush-1.0.1.tgz_1489767151955_0.574204578762874"},"directories":{},"publish_time":1489767152617,"_hasShrinkwrap":false,"_cnpm_publish_time":1489767152617,"_cnpmcore_publish_time":"2021-12-16T20:11:40.098Z","contributors":[]},"1.0.0":{"name":"geokdbush","version":"1.0.0","main":"index.js","author":{"name":"Vladimir Agafonkin","email":"agafonkin@gmail.com"},"license":"ISC","dependencies":{"tinyqueue":"^1.2.2"},"devDependencies":{"all-the-cities":"2.0.0","eslint":"^3.17.1","eslint-config-mourner":"^2.0.1","kdbush":"^1.0.1","quickselect":"^1.0.0","sphere-knn":"^1.3.1","tape":"^4.6.3"},"eslintConfig":{"extends":"mourner"},"scripts":{"pretest":"eslint *.js bench","test":"tape test.js","bench":"cd bench && node bench-geokdbush && node bench-sphere-knn && node bench-naive"},"gitHead":"0b4b7d09af0a0bbd3d120bbc9d7a03fa31265831","description":"A geographic extension for [kdbush](https://github.com/mourner/kdbush), the fastest static spatial index for points in JavaScript.","_id":"geokdbush@1.0.0","_shasum":"a24f4eb8d1c72ab16adc3af6337860e16db08065","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.7.2","_npmUser":{"name":"anonymous","email":"agafonkin@gmail.com"},"dist":{"shasum":"a24f4eb8d1c72ab16adc3af6337860e16db08065","size":14473,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/geokdbush/-/geokdbush-1.0.0.tgz","integrity":"sha512-B+bJsALuyTmqzzmVPuyJBFNZIV6Nha2l6h6SjInVfA793CDbj2rgHlijIC6rOJWGkeUyQkiS8nCHi6syWrOS8Q=="},"maintainers":[{"name":"anonymous","email":"agafonkin@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/geokdbush-1.0.0.tgz_1489757227787_0.8039075362030417"},"directories":{},"publish_time":1489757228352,"_hasShrinkwrap":false,"_cnpm_publish_time":1489757228352,"_cnpmcore_publish_time":"2021-12-16T20:11:40.727Z","contributors":[]},"2.0.0":{"name":"geokdbush","version":"2.0.0","author":{"name":"Vladimir Agafonkin","email":"agafonkin@gmail.com"},"license":"ISC","_id":"geokdbush@2.0.0","homepage":"https://github.com/mourner/geokdbush#readme","bugs":{"url":"https://github.com/mourner/geokdbush/issues"},"dist":{"shasum":"8dddb1b5a5fb06bf4b69f86e008b38678f9a3f19","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/geokdbush/-/geokdbush-2.0.0.tgz","fileCount":11,"integrity":"sha512-6vxU1wd61uC5VIA1F195N5b1Czx7JVilIYVPvkAWvBkdFdlgZ/xbIeqCWDQMczyzH0mpDsuzMRBpdfILyZe1/Q==","signatures":[{"sig":"MEYCIQCfvWFG+pFShliQod4ZgxcalUONzgI9AJuwB4LwiKdikAIhALX0ayb8cMOAF2n6U4f7gwcLmi4gJbl5J9xHG9dXheZQ","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":17017,"size":5441},"main":"index.js","type":"module","gitHead":"4d8a55f4f8c6d7e284e56158452dc346382ec261","scripts":{"test":"node test.js","bench":"cd bench && node bench-geokdbush && node bench-sphere-knn && node bench-naive && node bench-vptree","pretest":"eslint index.js test.js bench"},"_npmUser":{"name":"anonymous","email":"agafonkin@gmail.com"},"repository":{"url":"git+https://github.com/mourner/geokdbush.git","type":"git"},"_npmVersion":"10.8.0","description":"A geographic extension for [KDBush](https://github.com/mourner/kdbush), the fastest static spatial index for points in JavaScript.","directories":{},"_nodeVersion":"20.14.0","dependencies":{"tinyqueue":"^2.0.3"},"_hasShrinkwrap":false,"devDependencies":{"eslint":"^9.6.0","kdbush":"^4.0.2","vptree":"^1.0.0","sphere-knn":"^1.4.0","all-the-cities":"3.1.0","eslint-config-mourner":"^4.0.1"},"_npmOperationalInternal":{"tmp":"tmp/geokdbush_2.0.0_1719825504532_0.16069797106905148","host":"s3://npm-registry-packages"},"_cnpmcore_publish_time":"2024-07-01T09:18:24.695Z","publish_time":1719825504695,"_source_registry_name":"default","contributors":[]},"2.0.1":{"name":"geokdbush","version":"2.0.1","type":"module","main":"index.js","author":{"name":"Vladimir Agafonkin","email":"agafonkin@gmail.com"},"license":"ISC","dependencies":{"tinyqueue":"^2.0.3"},"repository":{"type":"git","url":"git+https://github.com/mourner/geokdbush.git"},"devDependencies":{"all-the-cities":"3.1.0","eslint":"^9.6.0","eslint-config-mourner":"^4.0.1","kdbush":"^4.0.2","sphere-knn":"^1.4.0","vptree":"^1.0.0"},"scripts":{"pretest":"eslint index.js test.js bench","test":"node test.js","bench":"cd bench && node bench-geokdbush && node bench-sphere-knn && node bench-naive && node bench-vptree"},"_id":"geokdbush@2.0.1","gitHead":"11a620163083eee22c5be1b388cbcf17c48cefa1","description":"A geographic extension for [KDBush](https://github.com/mourner/kdbush), the fastest static spatial index for points in JavaScript.","bugs":{"url":"https://github.com/mourner/geokdbush/issues"},"homepage":"https://github.com/mourner/geokdbush#readme","_nodeVersion":"20.14.0","_npmVersion":"10.8.0","dist":{"integrity":"sha512-0M8so1Qx6+jJ1xpirpCNrgUsWAzIcQ3LrLmh0KJPBYI3gH7vy70nY5zEEjSp9Tn0nBt6Q2Fh922oL08lfib4Zg==","shasum":"85a4d65f89150f1ad5d8831e01c9b60f2f5a15a2","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/geokdbush/-/geokdbush-2.0.1.tgz","fileCount":4,"unpackedSize":9513,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjfzsZiAcIlA8pRcKxDhqLvyJZTA5PkbTh2LPUNYQT9AIhAOln8J1kZGIL8m7Qnz+NOQ7UfONQ9iKvVC9FdisGWSqV"}],"size":3694},"_npmUser":{"name":"anonymous","email":"agafonkin@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/geokdbush_2.0.1_1719825601840_0.5982728515493552"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2024-07-01T09:20:01.995Z","publish_time":1719825601995,"_source_registry_name":"default","contributors":[]},"2.1.0":{"name":"geokdbush","version":"2.1.0","type":"module","main":"index.js","exports":"./index.js","types":"index.d.ts","sideEffects":false,"author":{"name":"Vladimir Agafonkin","email":"agafonkin@gmail.com"},"license":"ISC","dependencies":{"tinyqueue":"^3.0.0"},"repository":{"type":"git","url":"git+https://github.com/mourner/geokdbush.git"},"devDependencies":{"all-the-cities":"3.1.0","eslint":"^10.2.0","eslint-config-mourner":"^4.1.0","kdbush":"^4.0.2","sphere-knn":"^1.4.0","typescript":"^6.0.2","vptree":"^1.0.0"},"scripts":{"pretest":"eslint index.js test.js bench","test":"tsc && node test.js","bench":"cd bench && node bench-geokdbush && node bench-sphere-knn && node bench-naive && node bench-vptree"},"gitHead":"59bad682d65f5ba6baf43daa9b0ab0dc8a7d05b1","_id":"geokdbush@2.1.0","description":"A geographic extension for [KDBush](https://github.com/mourner/kdbush), the fastest static spatial index for points in JavaScript.","bugs":{"url":"https://github.com/mourner/geokdbush/issues"},"homepage":"https://github.com/mourner/geokdbush#readme","_nodeVersion":"24.14.0","_npmVersion":"11.11.0","dist":{"integrity":"sha512-bMc7mu+SeUxtHwRpVvZ36qnZa/x8YAGuaPNeGDxd9bxp/jYuJ5GrUirUPz6UNiT+nn/79IQ4gCNan0y4alEUxw==","shasum":"210816f63e63cc0092c34f1fe79d0dd5d87c7c20","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/geokdbush/-/geokdbush-2.1.0.tgz","fileCount":5,"unpackedSize":13106,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDBqi/j6BTZPlT5OVXiZz7hdpX52Od6cPlKHrbLt1dMsQIhANYX4i609FinFK9sC4CZsgAFqyA9b+Gi1QKOpp6vKlXE"}],"size":4226},"_npmUser":{"name":"anonymous","email":"agafonkin@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"agafonkin@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/geokdbush_2.1.0_1775466329164_0.561644070365166"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2026-04-06T09:05:29.347Z","publish_time":1775466329347,"_source_registry_name":"default","contributors":[]}},"dist-tags":{"latest":"2.1.0"},"name":"geokdbush","time":{"created":"2022-01-26T17:00:25.498Z","modified":"2026-04-06T09:05:42.694Z","1.1.0":"2017-04-27T12:52:03.000Z","1.0.2":"2017-03-18T15:19:55.915Z","1.0.1":"2017-03-17T16:12:32.617Z","1.0.0":"2017-03-17T13:27:08.352Z","2.0.0":"2024-07-01T09:18:24.695Z","2.0.1":"2024-07-01T09:20:01.995Z","2.1.0":"2026-04-06T09:05:29.347Z"},"readme":"## geokdbush [![Node](https://github.com/mourner/geokdbush/actions/workflows/node.yml/badge.svg)](https://github.com/mourner/geokdbush/actions/workflows/node.yml) [![Simply Awesome](https://img.shields.io/badge/simply-awesome-brightgreen.svg)](https://github.com/mourner/projects)\n\nA geographic extension for [KDBush](https://github.com/mourner/kdbush),\nthe fastest static spatial index for points in JavaScript.\n\nIt implements fast [nearest neighbors](https://en.wikipedia.org/wiki/Nearest_neighbor_search) queries\nfor locations on Earth, taking Earth curvature and date line wrapping into account.\nInspired by [sphere-knn](https://github.com/darkskyapp/sphere-knn), but uses a different algorithm.\n\n### Example\n\n```js\nimport KDBush from 'kdbush';\nimport * as geokdbush from 'geokdbush';\n\nconst index = new KDBush(points.length);\nfor (const {lon, lat} of points) index.add(lon, lat);\nindex.finish();\n\nconst nearestIds = geokdbush.around(index, -119.7051, 34.4363, 1000);\n\nconst nearest = nearestIds.map(id => points[id]);\n```\n\n### API\n\n#### geokdbush.around(index, longitude, latitude[, maxResults, maxDistance, filterFn])\n\nReturns an array of the closest points from a given location in order of increasing distance.\n\n- `index`: [kdbush](https://github.com/mourner/kdbush) index.\n- `longitude`: query point longitude.\n- `latitude`: query point latitude.\n- `maxResults`: (optional) maximum number of points to return (`Infinity` by default).\n- `maxDistance`: (optional) maximum distance in kilometers to search within (`Infinity` by default).\n- `filterFn`: (optional) a function to filter the results with.\n\n#### geokdbush.distance(longitude1, latitude1, longitude2, latitude2)\n\nReturns great circle distance between two locations in kilometers.\n\n### Performance\n\nThis library is incredibly fast.\nThe results below were obtained with `npm run bench`\n(Node v20, Macbook Pro 2020 M1 Pro).\n\nbenchmark | geokdbush | sphere-knn | naive\n--- | ---: | ---: | ---:\nindex 138398 points | 57.6ms | 408ms | n/a\nquery 1000 closest | 1.6ms | 1.8ms | 72ms\nquery 50000 closest | 14.7ms | 91.5ms | 72ms\nquery all 138398 | 33.7ms | 500ms | 72ms\n1000 queries of 1 | 24.7ms | 27.5ms | 11.1s","users":{}}