Common geohash parent finder v0.1.0
Class with multiple methods to help you find the common parent geohash from points, geohashes, bounding boxes, polygons or other GeoJSON shapes.
Installation
Using npm:
npm i common-geohash-parent
Using yarn:
yarn add common-geohash-parent
Example usage
In node:
const ParentFinder = ; const bbox = -3944092 40241799 -3261566 40779502;const precision = 5;const finder = precision;finder ;
Classes
Typedefs
- ParentGeohashList :
Array.<string>
- OptimizationOptions
ParentFinder
Kind: global class
new ParentFinder()
ParentFinder class
ParentGeohashList
parentFinder.fromPoints(points) ⇒ Finds common parents from array of points
Kind: instance method of ParentFinder
Returns: ParentGeohashList
- Array of geohashes
Param | Type | Description |
---|---|---|
points | Array.<Array.<number>> |
[lon, lat] |
ParentGeohashList
parentFinder.fromGeohashes(hashes) ⇒ Finds common parents from array of geohashes
Kind: instance method of ParentFinder
Returns: ParentGeohashList
- List of parent geohashes
Param | Type | Description |
---|---|---|
hashes | Array.<string> |
List of geohashes |
Promise.<ParentGeohashList>
parentFinder.fromBBox(bbox) ⇒ Finds common parents from bounding box
Kind: instance method of ParentFinder
Returns: Promise.<ParentGeohashList>
- Promise of list of parent geohashes
Param | Type | Description |
---|---|---|
bbox | Array.<number> |
[number, number, number, number] |
Promise.<ParentGeohashList>
parentFinder.fromPolygon(inputPolygon) ⇒ Finds common parents from polygon feature
Kind: instance method of ParentFinder
Returns: Promise.<ParentGeohashList>
- Promise of list of parent geohashes
Param | Type | Description |
---|---|---|
inputPolygon | object |
GeoJSON shape |
ParentFinder.ParentFinder
Kind: static class of ParentFinder
new ParentFinder(parentPrecision, [optimization])
Creates an instance of ParentFinder.
Param | Type | Description |
---|---|---|
parentPrecision | number |
Initial parent precision |
[optimization] | OptimizationOptions |
If desired, specify optimization options |
Array.<string>
ParentGeohashList :
OptimizationOptions
Kind: global typedef
Properties
Name | Type |
---|---|
enabled | boolean |
maxParents | number |