-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Taking snapshot of 6.5.0 documentation in preparation for including l…
…atest "canary" documentation as well. (#195)
- Loading branch information
1 parent
346736e
commit f9e1831
Showing
173 changed files
with
12,465 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Turf documentation versions | ||
|
||
## Current version (Stable) | ||
|
||
| | | | | ||
| ----- | ---------------------------- | ------------------------------------------------------------------------ | | ||
| 6.5.0 | [Documentation](/docs/intro) | [Release Notes](https://github.com/Turfjs/turf/blob/v6.5.0/CHANGELOG.md) | | ||
|
||
## Next version (Unreleased) | ||
|
||
Here you can find the documentation for work-in-process unreleased version. | ||
|
||
| | | | ||
| --------- | --------------------------------- | | ||
| Canary 🚧 | [Documentation](/docs/next/intro) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
--- | ||
title: along | ||
--- | ||
|
||
import * as turf from "@turf/turf"; | ||
import ExampleMap from "@site/src/components/ExampleMap"; | ||
import BrowserOnly from "@docusaurus/BrowserOnly"; | ||
|
||
### Description | ||
|
||
Takes a [LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4) and returns a [Point](https://tools.ietf.org/html/rfc7946#section-3.1.2) at a specified distance along the line. | ||
|
||
### Parameters | ||
|
||
| Name | Type | Description | | ||
| --------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- | | ||
| line | **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<[LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4)>** | input line | | ||
| distance | **number** | distance along the line | | ||
| options<i>?</i> | **Object** | Optional parameters | | ||
| options.units<i>?</i> | **string** | can be degrees, radians, miles, or kilometers _(default "kilometers")_ | | ||
|
||
### Returns | ||
|
||
<ul> | ||
**[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<[Point](https://tools.ietf.org/html/rfc7946#section-3.1.2)>** Point `````distance````` `````units````` along the line | ||
|
||
</ul> | ||
|
||
### Examples | ||
|
||
```javascript | ||
var line = turf.lineString([ | ||
[-83, 30], | ||
[-84, 36], | ||
[-78, 41], | ||
]); | ||
var options = { units: "miles" }; | ||
|
||
var along = turf.along(line, 200, options); | ||
``` | ||
|
||
export function Map0() { | ||
"use strict"; | ||
|
||
// jsdoc example start | ||
var line = turf.lineString([ | ||
[-83, 30], | ||
[-84, 36], | ||
[-78, 41], | ||
]); | ||
var options = { units: "miles" }; | ||
|
||
var along = turf.along(line, 200, options); | ||
|
||
//addToMap | ||
var addToMap = { along, line }; | ||
// jsdoc example end | ||
|
||
return <ExampleMap addToMap={addToMap} />; | ||
} | ||
|
||
<!-- prettier-ignore --> | ||
<BrowserOnly>{() => <Map0 />}</BrowserOnly> | ||
|
||
### Installation | ||
|
||
```javascript | ||
$ npm install @turf/along | ||
|
||
import { along } from "@turf/along"; | ||
const result = along(...); | ||
``` | ||
|
||
```javascript | ||
$ npm install @turf/turf | ||
|
||
import * as turf from "@turf/turf"; | ||
const result = turf.along(...); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
--- | ||
title: angle | ||
--- | ||
|
||
import * as turf from "@turf/turf"; | ||
import ExampleMap from "@site/src/components/ExampleMap"; | ||
import BrowserOnly from "@docusaurus/BrowserOnly"; | ||
|
||
### Description | ||
|
||
Finds the angle formed by two adjacent segments defined by 3 points. The result will be the (positive clockwise) | ||
angle with origin on the `startPoint-midPoint` segment, or its explementary angle if required. | ||
|
||
### Parameters | ||
|
||
| Name | Type | Description | | ||
| ---------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------- | | ||
| startPoint | **[Coord](https://tools.ietf.org/html/rfc7946#section-3.1.1)** | Start Point Coordinates | | ||
| midPoint | **[Coord](https://tools.ietf.org/html/rfc7946#section-3.1.1)** | Mid Point Coordinates | | ||
| endPoint | **[Coord](https://tools.ietf.org/html/rfc7946#section-3.1.1)** | End Point Coordinates | | ||
| options<i>?</i> | **Object** | Optional parameters _(default \{})_ | | ||
| options.explementary<i>?</i> | **boolean** | Returns the explementary angle instead (360 - angle) _(default false)_ | | ||
| options.mercator<i>?</i> | **boolean** | if calculations should be performed over Mercator or WGS84 projection _(default false)_ | | ||
|
||
### Returns | ||
|
||
<ul> | ||
**number** Angle between the provided points, or its explementary. | ||
|
||
</ul> | ||
|
||
### Examples | ||
|
||
```javascript | ||
turf.angle([5, 5], [5, 6], [3, 4]); | ||
//=45 | ||
``` | ||
|
||
### Installation | ||
|
||
```javascript | ||
$ npm install @turf/angle | ||
|
||
import { angle } from "@turf/angle"; | ||
const result = angle(...); | ||
``` | ||
|
||
```javascript | ||
$ npm install @turf/turf | ||
|
||
import * as turf from "@turf/turf"; | ||
const result = turf.angle(...); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
--- | ||
title: area | ||
--- | ||
|
||
import * as turf from "@turf/turf"; | ||
import ExampleMap from "@site/src/components/ExampleMap"; | ||
import BrowserOnly from "@docusaurus/BrowserOnly"; | ||
|
||
### Description | ||
|
||
Takes one or more features and returns their area in square meters. | ||
|
||
### Parameters | ||
|
||
| Name | Type | Description | | ||
| ------- | ------------------------------------------------------------ | ------------------------ | | ||
| geojson | **[GeoJSON](https://tools.ietf.org/html/rfc7946#section-3)** | input GeoJSON feature(s) | | ||
|
||
### Returns | ||
|
||
<ul> | ||
**number** area in square meters | ||
|
||
</ul> | ||
|
||
### Examples | ||
|
||
```javascript | ||
var polygon = turf.polygon([ | ||
[ | ||
[125, -15], | ||
[113, -22], | ||
[154, -27], | ||
[144, -15], | ||
[125, -15], | ||
], | ||
]); | ||
|
||
var area = turf.area(polygon); | ||
``` | ||
|
||
export function Map0() { | ||
"use strict"; | ||
|
||
// jsdoc example start | ||
var polygon = turf.polygon([ | ||
[ | ||
[125, -15], | ||
[113, -22], | ||
[154, -27], | ||
[144, -15], | ||
[125, -15], | ||
], | ||
]); | ||
|
||
var area = turf.area(polygon); | ||
|
||
//addToMap | ||
var addToMap = { polygon }; | ||
polygon.properties.area = area; | ||
// jsdoc example end | ||
|
||
return <ExampleMap addToMap={addToMap} />; | ||
} | ||
|
||
<!-- prettier-ignore --> | ||
<BrowserOnly>{() => <Map0 />}</BrowserOnly> | ||
|
||
### Installation | ||
|
||
```javascript | ||
$ npm install @turf/area | ||
|
||
import { area } from "@turf/area"; | ||
const result = area(...); | ||
``` | ||
|
||
```javascript | ||
$ npm install @turf/turf | ||
|
||
import * as turf from "@turf/turf"; | ||
const result = turf.area(...); | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
title: bbox | ||
--- | ||
|
||
import * as turf from "@turf/turf"; | ||
import ExampleMap from "@site/src/components/ExampleMap"; | ||
import BrowserOnly from "@docusaurus/BrowserOnly"; | ||
|
||
### Description | ||
|
||
Takes a set of features, calculates the bbox of all input features, and returns a bounding box. | ||
|
||
### Parameters | ||
|
||
| Name | Type | Description | | ||
| ------- | ------------------------------------------------------------ | ------------------ | | ||
| geojson | **[GeoJSON](https://tools.ietf.org/html/rfc7946#section-3)** | any GeoJSON object | | ||
|
||
### Returns | ||
|
||
<ul> | ||
**[BBox](https://tools.ietf.org/html/rfc7946#section-5)** bbox extent in [minX, minY, maxX, maxY] order | ||
|
||
</ul> | ||
|
||
### Examples | ||
|
||
```javascript | ||
var line = turf.lineString([ | ||
[-74, 40], | ||
[-78, 42], | ||
[-82, 35], | ||
]); | ||
var bbox = turf.bbox(line); | ||
var bboxPolygon = turf.bboxPolygon(bbox); | ||
``` | ||
|
||
export function Map0() { | ||
"use strict"; | ||
|
||
// jsdoc example start | ||
var line = turf.lineString([ | ||
[-74, 40], | ||
[-78, 42], | ||
[-82, 35], | ||
]); | ||
var bbox = turf.bbox(line); | ||
var bboxPolygon = turf.bboxPolygon(bbox); | ||
|
||
//addToMap | ||
var addToMap = { line, bboxPolygon }; | ||
// jsdoc example end | ||
|
||
return <ExampleMap addToMap={addToMap} />; | ||
} | ||
|
||
<!-- prettier-ignore --> | ||
<BrowserOnly>{() => <Map0 />}</BrowserOnly> | ||
|
||
### Installation | ||
|
||
```javascript | ||
$ npm install @turf/bbox | ||
|
||
import { bbox } from "@turf/bbox"; | ||
const result = bbox(...); | ||
``` | ||
|
||
```javascript | ||
$ npm install @turf/turf | ||
|
||
import * as turf from "@turf/turf"; | ||
const result = turf.bbox(...); | ||
``` |
Oops, something went wrong.