Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

turf-midpoint

Turfjs70.8kMITdeprecated3.0.12

Turf packages are now namespaced: please use @turf/midpoint instead

turf midpoint module

turf, midpoint, bisect, geojson, line

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