{"_id":"@dentreality/geodbscan","_rev":"2-60e53578d5e574c1bd708f4b8925d9fd","name":"@dentreality/geodbscan","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@dentreality/geodbscan","version":"0.0.1","description":"A geospatial implementation of the DBSCAN clustering algorithm","keywords":["cluster","clustering","DBSCAN","geo","geojson"],"author":{"name":"Dent Reality"},"license":"MIT","scripts":{"test":"jest","build":"microbundle","dev":"microbundle watch"},"type":"module","source":"src/geodbscan.ts","exports":"./dist/geodbscan.modern.js","main":"./dist/geodbscan.cjs","module":"./dist/geodbscan.module.js","unpkg":"./dist/geodbscan.umd.js","dependencies":{},"devDependencies":{"@types/jest":"^26.0.23","jest":"^27.0.4","microbundle":"^0.13.1","ts-jest":"^27.0.2","typescript":"^4.3.2"},"jest":{"preset":"ts-jest","testEnvironment":"node","extensionsToTreatAsEsm":[".ts"],"globals":{"ts-jest":{"useESM":true}}},"repository":{"type":"git","url":"git+https://github.com/DentReality/GeoDBSCAN.git"},"bugs":{"url":"https://github.com/DentReality/GeoDBSCAN/issues"},"homepage":"https://github.com/DentReality/GeoDBSCAN#readme","gitHead":"b0094c77c744d576713af74ae1d53256fcab002d","_id":"@dentreality/geodbscan@0.0.1","_nodeVersion":"14.16.0","_npmVersion":"6.14.11","dist":{"integrity":"sha512-aWKGAV8OlJ5bZmGW07PryGcKmIB4vvrO8Q+IjVOJmx4wsNMLHXLIYjr8hUXfmlbqSZwEJt+raU3sbsyEgp5SOg==","shasum":"c3b269313b671d177d868aea66914987536dc1eb","tarball":"https://registry.npmjs.org/@dentreality/geodbscan/-/geodbscan-0.0.1.tgz","fileCount":18,"unpackedSize":133694,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgvqKKCRA9TVsSAnZWagAAoFgP/3iNiO6Z4ofeHLVpWFZz\nT61ZEJwosloNyZ/uEhW5CuxJ6PzMo4Tw+37allLxJqi5jB4Mru1kFR6eSyW/\nuQYDn1oghkscXc14F5UHxTqHbnEqk65miD283PWo9r4NiTHsez4wNXe8rAc2\nXQhzPnLYCKkJY2HJG9Wnvzz8gAFramLqUvvVbteqe15TWXZqYjFWSAG/MLo7\ncXRuP63dPkXY2ISvFolUfM/aqg2kcZvA349usbIVvZkAoX/X3RSaErDsVaIM\n4nIqFo5hvQVejr2U1d3GL78PVtFFJVdZR8LtdDm5o1okrcauW0V6SxwRklX+\nWp7H7LaYHJ1yb328z+PCY4ks7ocjQrrJhGsx6nlj+6s7xJjSjmFe2L+5pbIo\n1rQMN8pV8/6qSthVGocsMp7kphM5B2BVaN/ajAXlEqdPBwKpk/P2GRQ50VeC\nRcFS6iAtKsLsSkak2aGyvDsOG0h1oVuPwskd5Cm3UK/aGdGcx1QFCp8/zw0d\ng1nD4sAQkQaVMjoiKHFLdk7fpVhOR0o7cF/k0Y62T6B4x6/RSF2L8/IBC2e/\ndX4k+TEc+GIup04dR2Mu+jO3BptYgFqX0xKWBV2+FeBT9vKeoQV0yacE112x\n27Y6U+reexrg76igl7g+x2OV223TG2bAPsynOpCbI2OX/McLWmzJYD5hm/46\nM4mQ\r\n=m3k8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDZ9mXHLO4kXkir8o510g31dX0YoV3mLS6xh+7JJky9ngIhAKynoPkkChN+JSlbYZ09gUTAZMMN/rJ6cEiIxeFN3dmy"}]},"_npmUser":{"name":"jamesmilneruk","email":"jamesmilner22@hotmail.com"},"directories":{},"maintainers":[{"name":"jamesmilneruk","email":"jamesmilner22@hotmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/geodbscan_0.0.1_1623106186012_0.3942702736644601"},"_hasShrinkwrap":false}},"time":{"created":"2021-06-07T22:49:45.620Z","0.0.1":"2021-06-07T22:49:46.149Z","modified":"2022-04-05T03:46:51.867Z"},"maintainers":[],"description":"A geospatial implementation of the DBSCAN clustering algorithm","homepage":"https://github.com/DentReality/GeoDBSCAN#readme","keywords":["cluster","clustering","DBSCAN","geo","geojson"],"repository":{"type":"git","url":"git+https://github.com/DentReality/GeoDBSCAN.git"},"author":{"name":"Dent Reality"},"bugs":{"url":"https://github.com/DentReality/GeoDBSCAN/issues"},"license":"MIT","readme":"# GeoDBSCAN\n\nGeoDBSCAN provides a simple JavaScript implementation and API for the DBSCAN clustering algorithm using a geographic distance function. This allows developers to create clusters based on the geographic density of the points. The code is a modernisation and extension of [density-clustering](https://github.com/uhho/density-clustering).\n\n- [DBSCAN (Wikipedia)](https://en.wikipedia.org/wiki/DBSCAN)\n- [DBSCAN original academic paper](http://www2.cs.uh.edu/~ceick/7363/Papers/dbscan.pdf)\n\nInterested in this kind of work? Dent Reality is hiring!\n\n## Installation\n\n```shell\nnpm install geodbscan\n```\n\n## Usage\n\nGeoDBSCAN only has one method, namely `cluster`. It is used like this:\n\n```typescript\n// GeoDBSCAN accepts arrays of [number, number] coordinates\n// Here let's assume points is an array of GeoJSON points\nconst coords = points.map((point) => point.geometry.coordinates);\n\n// Now we can generate our clusters\nconst clusters = geodbscan.cluster(coords, {\n  minPts: 2,\n  epsilon: 1000,\n});\n\n// An Array of Arrays that contain the indexs\n// of the coordinates in the cluster\n// (from the 'coords' variable)\n// [\n//   [0, 4, 5, 3],\n//   [1, 2],\n//   [6, 7, 8, 9, 10, 11, 12, 18, 16, 17, 14, 15, 19, 20, 21, 13],\n// ]\n```\n\nIt takes a second options object argument which has two properties:\n\n- **minPts** - minimum number of points used to form a cluster\n- **epsilon?** - the radius of a neighborhood with respect a given point (_this is in meters_). This value is technically optional as we try to calculate a sensible value from a knn distance plot, however you'll probably get better results providing your own value\n\n## Development\n\nWe welcome contributions to the library. The code is written in [TypeScript](https://www.typescriptlang.org/), bundled with [microbundle](https://github.com/developit/microbundle) and tested with [Jest](https://jestjs.io/).\n\n### Testing\n\n```shell\nnpm run test\n```\n\n### Building\n\n```shell\nnpm run build\n```\n\nor in watch mode:\n\n```shell\nnpm run watch\n```\n\n## License\n\nMIT License\n","readmeFilename":"README.md"}