mapbox/dobbyscan

A very fast density based clustering library for geographic points

87

stars

13

commits

JavaScript

primary language

Jun 22, 2026

updated

README

dobbyscan Node Simply Awesome

A very fast density based clustering JavaScript library for geographic points. Implements a variation of DBSCAN with great circle distance metric.

Example

const clusters = dobbyscan(points, radius, p => p.lon, p => p.lat);

API

dobbyscan(points, radius[, getLng, getLat])

Returns an array of clusters, where each cluster is an array of points (from the input array).

  • points: an array of input points of an arbitrary format.
  • radius: density clustering radius in kilometers.
  • getLng: (optional) a function that returns longitude given an input point, (p) => p[0] by default.
  • getLat: (optional) a function that returns latitude given an input point, (p) => p[1] by default.

Performance

This library is incredibly fast — run bench.js to see it cluster 135k points in ~170ms.

Install

npm install dobbyscan

Contributors

mourner

13 commits

mapbox/dobbyscan

A very fast density based clustering library for geographic points

87

stars

13

commits

JavaScript

primary language

Jun 22, 2026

updated

README

dobbyscan Node Simply Awesome

A very fast density based clustering JavaScript library for geographic points. Implements a variation of DBSCAN with great circle distance metric.

Example

const clusters = dobbyscan(points, radius, p => p.lon, p => p.lat);

API

dobbyscan(points, radius[, getLng, getLat])

Returns an array of clusters, where each cluster is an array of points (from the input array).

  • points: an array of input points of an arbitrary format.
  • radius: density clustering radius in kilometers.
  • getLng: (optional) a function that returns longitude given an input point, (p) => p[0] by default.
  • getLat: (optional) a function that returns latitude given an input point, (p) => p[1] by default.

Performance

This library is incredibly fast — run bench.js to see it cluster 135k points in ~170ms.

Install

npm install dobbyscan

Contributors

mourner

13 commits

Languages

JavaScript

100.0%