Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@turf/clusters-dbscan

Package Overview
Dependencies
Maintainers
9
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@turf/clusters-dbscan

turf clusters-dbscan module

  • 7.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
465K
decreased by-35.67%
Maintainers
9
Weekly downloads
 
Created

What is @turf/clusters-dbscan?

@turf/clusters-dbscan is a module from the Turf.js library that provides functionality for clustering geographical points using the DBSCAN (Density-Based Spatial Clustering of Applications with Noise) algorithm. This is useful for identifying clusters of points in spatial data, which can be applied in various fields such as geographic information systems (GIS), urban planning, and environmental monitoring.

What are @turf/clusters-dbscan's main functionalities?

Cluster Points

This feature allows you to cluster geographical points based on their proximity to each other. The code sample demonstrates how to create a collection of points and then apply the DBSCAN algorithm to identify clusters within a specified distance (0.3 units) and a minimum number of points (2) to form a cluster.

const turf = require('@turf/turf');

const points = turf.featureCollection([
  turf.point([0, 0]),
  turf.point([0.1, 0.1]),
  turf.point([0.2, 0.2]),
  turf.point([10, 10]),
  turf.point([10.1, 10.1])
]);

const clustered = turf.clustersDbscan(points, 0.3, { minPoints: 2 });

console.log(clustered);

Identify Noise Points

This feature helps in identifying noise points, which are points that do not belong to any cluster. The code sample shows how to filter out noise points from the clustered result.

const turf = require('@turf/turf');

const points = turf.featureCollection([
  turf.point([0, 0]),
  turf.point([0.1, 0.1]),
  turf.point([0.2, 0.2]),
  turf.point([10, 10]),
  turf.point([10.1, 10.1])
]);

const clustered = turf.clustersDbscan(points, 0.3, { minPoints: 2 });

const noisePoints = clustered.features.filter(feature => feature.properties.cluster === 'noise');

console.log(noisePoints);

Other packages similar to @turf/clusters-dbscan

Keywords

FAQs

Package last updated on 09 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc