Package Exports
- @turf/directional-mean
 - @turf/directional-mean/package.json
 
Readme
@turf/directional-mean
DirectionalMeanLine
Type: Object
Properties
cartesianAnglenumber the mean angle of all lines. (measure from due earth counterclockwise).bearingAnglenumber the mean angle of all lines. (bearing).circularVariancenumber the extent to which features all point in the same direction. the value ranges 0-1, the bigger the value, the more variation in directions between lines.averageXnumber the centroid of all lines.averageYnumber the centroid of all line.averageLengthnumber the average length of line.countOfLinesnumber the count of features.
directionalMean
This module calculate the average angle of a set of lines, measuring the trend of it. It can be used in both project coordinate system and geography coordinate system. It can handle segments of line or the whole line.
Parameters
linesFeatureCollection<LineString>optionsobject (optional, default{})
Examples
var lines = turf.lineStrings([
  [[110, 45], [120, 50]],
  [[100, 50], [115, 55]],
])
var directionalMeanLine = turf.directionalMean(lines);
// => directionalMeanLineReturns DirectionalMeanLine Directional Mean Line
This module is part of the Turfjs project, an open source module collection dedicated to geographic algorithms. It is maintained in the Turfjs/turf repository, where you can create PRs and issues.
Installation
Install this single module individually:
$ npm install @turf/directional-meanOr install the all-encompassing @turf/turf module that includes all modules as functions:
$ npm install @turf/turf