mapbox / supercluster

A very fast geospatial point clustering library for browsers and Node.
ISC License
2.11k stars 299 forks source link

Add array type for storing coordinate values to allow improving accuracy for small radius #244

Open ewelinaBS opened 10 months ago

ewelinaBS commented 10 months ago

For small radius <~50cm, the clustering is not accurate. (Probably the accuracy will be different depending on the latitude.) The problem originates from rounding the coordinates to float32.

Work done

Enable arrayType argument for supercluster constructor to determine in what format store the coordinates values. Default Float32Array value will work the same as before.

andrewharvey commented 2 months ago

I've added a unit test for this in #249