Turfjs / Turfjs/turf

Allow aggregating properties in turf-clusters-dbscan

Open
#2,777 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
TypeScript
Stars
10.5k
Forks
1k
Avg merge
1h 11m
Merged PRs (30d)
4

Description

clustersDbscan() does not allow any way to determine which source points have been grouped in each cluster, or a way to aggregate properties in that cluster.

It would be helpful if one or both of these options were supported:

  • a clusterIds option, which if true would include a clusterIds property, an array of ids of each feature in the cluster.
  • an aggregateFunc option, a function which would be called with a feature being clustered, and the cluster it is being grouped into.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the clustersDbscan() entry point and inspect how clustered features and their properties are currently produced. Determine whether clusterIds, aggregateFunc, or both should be supported, then add coverage for the chosen behavior and verify that clustered output exposes the requested source-point information or aggregation result.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.