geohashes-clusterer
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

geohashes-clusterer

Table of contents

Functions

Functions

assignClusterToGeohashes

assignClusterToGeohashes(data: any[], geohashProp: string, valueProp: string, bucketsArray: Buckets): ClusteredGeohashItem[]

Assigns a cluster to each geohash based on provided buckets

export

Parameters:

Name Type Description
data any[] The input data, it can have any props, but only 2 will be used
geohashProp string The prop holding the geohash string
valueProp string The prop holding the value (number)
bucketsArray Buckets The buckets array expressing min and max. Will check if geohash value is greater or equal than the bucket start, or smaller than the bucket max

Returns: ClusteredGeohashItem[]

The geohash list with an assigned bucket

Defined in: index.ts:25


clusterGeohashesAsGeoJSON

clusterGeohashesAsGeoJSON(data: any[], geohashProp: string, valueProp: string, buckets: Buckets): FeatureCollection<Polygon | MultiPolygon>

Creates a GeoJSON FeatureCollection with the clusters as Features

export

Parameters:

Name Type Description
data any[] The input data, it can have any props, but only 2 will be used
geohashProp string The prop holding the geohash string
valueProp string The prop holding the value (number)
buckets Buckets The buckets array expressing min and max. Will check if geohash value is greater or equal than the bucket start, or smaller than the bucket max

Returns: FeatureCollection<Polygon | MultiPolygon>

The resulting FeatureCollection. Each Feature has the cluster name in its properties

Defined in: index.ts:65


clusterGeohashesByValue

clusterGeohashesByValue(data: any[], geohashProp: string, valueProp: string, bucketsArray: Buckets): ClusterObj

Clusters geohashes into an object, with the cluster tag as prop and the arrays of clustered geohashes as value

export

Parameters:

Name Type Description
data any[] The input data, it can have any props, but only 2 will be used
geohashProp string The prop holding the geohash string
valueProp string The prop holding the value (number)
bucketsArray Buckets The buckets array expressing min and max. Will check if geohash value is greater or equal than the bucket start, or smaller than the bucket max

Returns: ClusterObj

The object holding the clusters and its members

Defined in: index.ts:50

Readme

Keywords

none

Package Sidebar

Install

npm i geohashes-clusterer

Weekly Downloads

2

Version

0.2.0

License

MIT

Unpacked Size

70 kB

Total Files

21

Last publish

Collaborators

  • alrico88