Skip to content

fracasula/node-geo-utils

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

node-geo-utils

This package include a simple geolocation utility for Node.js that allow you to calculate the distance between two latitude/longitude points.

Example

var GeoPoint = require('GeoUtils').GeoPoint,
    GeoUtils = (new (require('GeoUtils').GeoUtils)());
	
var p1 = new GeoPoint(41.908, 12.479), // Rome
    p2 = new GeoPoint(45.4719, 9.186); // Milan
	
console.log(GeoUtils.distanceBetween(p1, p2));

Output of the above example will be:

{
    miles: 296.08390700884814,
    km: 476.5008592412477,
    m: 476500.8592412477
}

About

Node.js Geo utilities (calculate distance between two latitude/longitude points)

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published