Find the geohashes of a given precision along a GeoJSON LineString or MultiLineString Geometry or Feature.
Using npm, npm i geohashes-along
.
Using yarn, yarn add geohashes-along
.
Using import
:
import { getGeohashesAlong } from 'geohashes-along';
In a CommonJS environment:
const { getGeohashesAlong } = require('geohashes-along');
Then:
const lineString = {
type: 'LineString',
coordinates: [
[-5.646972656250001, 36.679433365517774],
[-5.52103918210534, 36.67588866176514],
],
};
const geohashesAlong = getGeohashesAlong(lineString, 5);
// geohashesAlong is ['eyebx', 'eys08', 'eys09', 'eys0d']
▸ getGeohashesAlong(feature
: Feature<LineString | MultiLineString> | LineString | MultiLineString, precision
: number): string[]
Get a list of geohashes along a LineString or MultiLineString GeoJSON Feature or Geometry. This is the generic method.
export
Name | Type | Description |
---|---|---|
feature |
Feature<LineString | MultiLineString> | LineString | MultiLineString | The GeoJSON Feature or Geometry |
precision |
number | The precision for the geohash list |
Returns: string[]
The list of geohashes along the line
▸ getGeohashesAlongLineString(lineString
: LineString, precision
: number): string[]
Get a list of geohashes along a LineString Geometry
export
Name | Type | Description |
---|---|---|
lineString |
LineString | The LineString Geometry |
precision |
number | The precision for the geohash list |
Returns: string[]
The geohashes along the LineString
▸ getGeohashesAlongMultiLineString(multiLineString
: MultiLineString, precision
: number): string[]
Get a list of geohashes along a MultiLineString Geometry
export
Name | Type | Description |
---|---|---|
multiLineString |
MultiLineString | The MultiLineString Geometry |
precision |
number | The precision for the geohash list |
Returns: string[]
The geohashes along the MultiLineString