Package Exports
- @turf/directional-mean
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@turf/directional-mean) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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 module individually:
$ npm install @turf/directional-meanOr install the Turf module that includes it as a function:
$ npm install @turf/turf