geo-helpers

1.2.6 • Public • Published

Geo-helpers

CircleCI Status

Helper methods for dealing with geolocation.

Installation

npm install geo-helpers

Methods

findGeodesic(latA, longA, latB, longB[, max])

  • latA - Float
  • longA - Float
  • latB - Float
  • longB - Float
  • max - Integer

If max parameter is excluded function returns the orthodromic distance between given coordinates a and b. Otherwise checks if orthodromic distance between a and b exceeds the max parameter and returns a boolean value.

findCentroid(latArr, longArr)

  • latArr - Array
  • longArr - Array

Returns geometric midpoint (arithmetic mean) given an array of latitude coordinates and an array of longitude coordinates.

interpolatePoints(latA, longA, latB, longB, distBetweenPoints)

  • latA - Float
  • longA - Float
  • latB - Float
  • longB - Float
  • distBetweenPoints - Float

Returns geographical coordinates of a fixed distance apart (distBetweenPoints) along the direct path between two given points.

Readme

Keywords

none

Package Sidebar

Install

npm i geo-helpers

Weekly Downloads

1

Version

1.2.6

License

ISC

Last publish

Collaborators

  • mdwyer6