Geoutil for Node.JS
Install
npm install geoutil --save
Usage
pointDistance()
Get the distance in meters
between two points. Technical
details.
var pointA = 6039826 532907 ;var pointB = 6062869 641474 ; geoutil;// 64781.55866944858
lineDistance()
Get total distance in meters
for polyline. Technical
details.
var line = 61498792 8636448 61500270 8652638 61499957 8660266 61501822 8672846 61503748 8696228 ; geoutil;// 532.126784613296
polygonArea()
Get total area in meters
^2 for polygon. Technical
details.
var polygon = 61498792 8636448 61500270 8652638 61499957 8660266 61501822 8672846 61503748 8696228 61498792 8636448 ; geoutil;// 40.43198051882604
How about GeoJSON?
If you are computing distances on GeoJSON data be sure to set the inverse
option (last parameter on lineDistance()
and pointDistance()
) to true
.