Skip to main content
Version: Next

directionalMean

描述

¥Description

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>
options?object(默认 )
options.planar?booleanwhether the spatial reference system is projected or geographical.(默认 true)
options.segment?booleanwhether treat a LineString as a whole or a set of segments.(默认 false)

返回

¥Returns

DirectionalMeanLine 方向平均线

¥DirectionalMeanLine Directional Mean Line

示例

¥Examples

var lines = turf.lineStrings([
[
[110, 45],
[120, 50],
],
[
[100, 50],
[115, 55],
],
]);
var directionalMeanLine = turf.directionalMean(lines);
// => directionalMeanLine

安装

¥Installation

$ npm install @turf/directional-mean

import { directionalMean } from "@turf/directional-mean";
const result = directionalMean(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.directionalMean(...);