Skip to content

@turf/clusters-dbscan: Fix clustersDbscan not respecting units option#3026

Open
mradlinski wants to merge 1 commit intoTurfjs:masterfrom
mradlinski:fix/dbscan-units
Open

@turf/clusters-dbscan: Fix clustersDbscan not respecting units option#3026
mradlinski wants to merge 1 commit intoTurfjs:masterfrom
mradlinski:fix/dbscan-units

Conversation

@mradlinski
Copy link

Previously clustersDbscan respected the units option in regards to maxDistance.
It seems this was overlooked when switching to kdbush in 6e4c18b .

This PR fixes it by converting maxDistance from whatever unit was passed in the option to kilometers (which are used internally by kdbush).

A test was added to check if units are respected for kilometers, meters and degrees.

I didn't find an issue for this, and thought that perhaps for such a simple issue one wasn't needed before creating a PR, sorry if that's the wrong workflow in this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant