polyline-midpoint
v1.0.0
Published
returns midpoint along geographic polyline
Downloads
2
Readme
polyline-midpoint
A NodeJS package that takes an encoded polyline and returns the midpoint in geoJSON format.
Usage
Install with npm:
npm install polyline-midpoint --save
Example:
var midpoint = require('polyline-midpoint');
var encodedPolyline = 'yhg~FzrmvOkuAo~GkEg{Aer@mlB';
var polylineMidpoint = midpoint(encodedPolyline);
console.log(polylineMidpoint);
Result:
{
type: 'Feature',
properties: {},
geometry:
{
type: 'Point',
coordinates: [ -87.68980233194598, 41.83358593924626 ]
}
}
License
MIT