# turf-linestring

> turf lineString module

Latest version **1.0.2** (published 2015-02-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install turf-linestring
pnpm add turf-linestring
yarn add turf-linestring
bun add turf-linestring
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2015-02-06 |
| First published | 2014-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | morganherlocker |
| Maintainers | morganherlocker, mourner, jvrousseau, jseppi, cspanring, cwmma, lyzidiamond, tmcw |
| Keywords | linestring, line, gis, geojson, turf |

## Links

- npm: https://www.npmjs.com/package/turf-linestring
- Repository: https://github.com/Turfjs/turf-linestring
- Issues: https://github.com/Turfjs/turf-linestring/issues
- npm.io page: https://npm.io/package/turf-linestring

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.0.2 (latest) — 2015-02-06
- 1.0.1 — 2015-01-22
- 1.0.0 — 2014-12-10
- 0.1.1 — 2014-06-02
- 0.1.0 — 2014-04-01

## README

# turf-linestring

[![build status](https://secure.travis-ci.org/Turfjs/turf-linestring.png)](http://travis-ci.org/Turfjs/turf-linestring)

turf lineString module


### `turf.linestring(coordinates, properties)`

Creates a LineString Feature based on a
coordinate array. Properties can be added optionally.


### Parameters

| parameter     | type                   | description                                                  |
| ------------- | ---------------------- | ------------------------------------------------------------ |
| `coordinates` | Array.<Array.<Number>> | - an array of Positions                                      |
| `properties`  | Object                 | an Object consisting of key-value pairs to add as properties |


### Example

```js
var linestring1 = turf.linestring([
	[-21.964416, 64.148203],
	[-21.956176, 64.141316],
	[-21.93901, 64.135924],
	[-21.927337, 64.136673]
]);
var linestring2 = turf.linestring([
	[-21.929054, 64.127985],
	[-21.912918, 64.134726],
	[-21.916007, 64.141016],
	[-21.930084, 64.14446]
], {name: 'line 1', distance: 145});

//=linestring1

//=linestring2
```

## Installation

Requires [nodejs](http://nodejs.org/).

```sh
$ npm install turf-linestring
```

## Tests

```sh
$ npm test
```

---
_Source: https://npm.io/package/turf-linestring · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
