Skip to main content
Version: 7.3.0

bezierSpline

描述

🌐 Description

接受一条 line 并通过应用 Bezier spline 算法返回其曲线版本。

🌐 Takes a line and returns a curved version by applying a Bezier spline algorithm.

Bezier样条实现由Leszek Rybicki完成。

🌐 The bezier spline implementation is by Leszek Rybicki.

参数

🌐 Parameters

名称类型描述
lineFeature<LineString>输入线串
options?Object可选参数 (默认 {})
options.properties?Object将属性转换为输出 (默认 {})
options.resolution?number点之间的时间(毫秒) (默认 10000)
options.sharpness?number衡量样条之间路径弯曲程度的一个指标 (默认 0.85)

返回

🌐 Returns

Feature<LineString> 曲线

示例

🌐 Examples

var line = turf.lineString([
[-76.091308, 18.427501],
[-76.695556, 18.729501],
[-76.552734, 19.40443],
[-74.61914, 19.134789],
[-73.652343, 20.07657],
[-73.157958, 20.210656],
]);

var curved = turf.bezierSpline(line);

安装

🌐 Installation

$ npm install @turf/bezier-spline

import { bezierSpline } from "@turf/bezier-spline";
const result = bezierSpline(...);
$ npm install @turf/turf

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