turf-bezier

WebJar for turf-bezier

License

License

ISC
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

turf-bezier
Last Version

Last Version

3.0.12
Release Date

Release Date

Type

Type

jar
Description

Description

turf-bezier
WebJar for turf-bezier
Project URL

Project URL

http://webjars.org
Source Code Management

Source Code Management

https://github.com/turf-junkyard/turf-bezier

Download turf-bezier

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/turf-bezier/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>turf-bezier</artifactId>
    <version>3.0.12</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/turf-bezier/
implementation 'org.webjars.npm:turf-bezier:3.0.12'
// https://jarcasting.com/artifacts/org.webjars.npm/turf-bezier/
implementation ("org.webjars.npm:turf-bezier:3.0.12")
'org.webjars.npm:turf-bezier:jar:3.0.12'
<dependency org="org.webjars.npm" name="turf-bezier" rev="3.0.12">
  <artifact name="turf-bezier" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='turf-bezier', version='3.0.12')
)
libraryDependencies += "org.webjars.npm" % "turf-bezier" % "3.0.12"
[org.webjars.npm/turf-bezier "3.0.12"]

Dependencies

compile (1)

Group / Artifact Type Version
org.webjars.npm : turf-helpers jar [3.0.12,4)

Project Modules

There are no modules declared in this project.

turf-bezier

build status

generate a bezier curve from a linestring

turf.bezier(line, [resolution=10000], [sharpness=0.85])

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

The bezier spline implementation is by Leszek Rybicki.

Parameters

parameter type description
line Feature.<LineString> input LineString
[resolution=10000] Number optional: time in milliseconds between points
[sharpness=0.85] Number optional: a measure of how curvy the path should be between splines

Example

var line = {
  "type": "Feature",
  "properties": {
    "stroke": "#f00"
  },
  "geometry": {
    "type": "LineString",
    "coordinates": [
      [-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.bezier(line);
curved.properties = { stroke: '#0f0' };

var result = {
  "type": "FeatureCollection",
  "features": [line, curved]
};

//=result

Returns Feature.<LineString>, curved line

Installation

Requires nodejs.

$ npm install turf-bezier

Tests

$ npm test
org.webjars.npm

deprecated turf modules: do not use or reference, for redirects only

turf is now a monorepo: all turf modules are in Turfjs/turf

Versions

Version
3.0.12