1.0.0 • Published 3 years ago

geohashes-along v1.0.0

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

geohashes-along

Find the geohashes of a given precision along a GeoJSON LineString or MultiLineString Geometry or Feature.

Installation

Using npm, npm i geohashes-along.

Using yarn, yarn add geohashes-along.

Usage

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']

Table of contents

Functions

Functions

getGeohashesAlong

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

Parameters

NameTypeDescription
featureFeature<LineString | MultiLineString> | LineString | MultiLineStringThe GeoJSON Feature or Geometry
precisionnumberThe precision for the geohash list

Returns: string[]

The list of geohashes along the line


getGeohashesAlongLineString

getGeohashesAlongLineString(lineString: LineString, precision: number): string[]

Get a list of geohashes along a LineString Geometry

export

Parameters

NameTypeDescription
lineStringLineStringThe LineString Geometry
precisionnumberThe precision for the geohash list

Returns: string[]

The geohashes along the LineString


getGeohashesAlongMultiLineString

getGeohashesAlongMultiLineString(multiLineString: MultiLineString, precision: number): string[]

Get a list of geohashes along a MultiLineString Geometry

export

Parameters

NameTypeDescription
multiLineStringMultiLineStringThe MultiLineString Geometry
precisionnumberThe precision for the geohash list

Returns: string[]

The geohashes along the MultiLineString