Geoutil for Node.JS
Install
npm install geoutil --save
Usage
pointDistance()
Get the distance in meters
between two points. Technical details
var pointA = [ 60.39826, 5.32907 ];
var pointB = [ 60.62869, 6.41474 ];
geoutil.pointDistance(pointA, pointB);
lineDistance()
Get total distance in meters
for polyline. Technical details
var line = [
[ 61.498792, 8.636448 ],
[ 61.500270, 8.652638 ],
[ 61.499957, 8.660266 ],
[ 61.501822, 8.672846 ],
[ 61.503748, 8.696228 ]
];
geoutil.lineDistance(line);
polygonArea()
Get total area in meters
^2 for polygon. Technical details
var polygon = [[
[ 61.498792, 8.636448 ]
[ 61.500270, 8.652638 ]
[ 61.499957, 8.660266 ]
[ 61.501822, 8.672846 ]
[ 61.503748, 8.696228 ]
[ 61.498792, 8.636448 ]
]];
geoutil.polygonArea(poly);