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

1.0.0 • Public • Published

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

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

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

Get a list of geohashes along a LineString Geometry

export

Parameters

Name Type Description
lineString LineString The LineString Geometry
precision number The 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

Name Type Description
multiLineString MultiLineString The MultiLineString Geometry
precision number The precision for the geohash list

Returns: string[]

The geohashes along the MultiLineString

Readme

Keywords

none

Package Sidebar

Install

npm i geohashes-along

Weekly Downloads

57

Version

1.0.0

License

MIT

Unpacked Size

46.3 kB

Total Files

21

Last publish

Collaborators

  • alrico88