turf-midpoint

turf midpoint module

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
turf-midpoint
003.0.128 years ago10 years agoMinified + gzip package size for turf-midpoint in KB

Readme

turf-midpoint
build status
turf midpoint module

turf.midpoint(a, b)

Takes two point features and returns a point between the two.

Parameters

| parameter | type | description | | --------- | ----- | ----------- | | a | Point | | | b | Point | |

Example

var pt1 = turf.point([0,0]);
var pt2 = turf.point([10, 0]);
var midpointed = turf.midpoint(pt1, pt2);
var features = turf.featurecollection([
 pt1, pt2, midpointed]);
//=features

Installation

Requires nodejs.
$ npm install turf-midpoint

Tests

$ npm test