Skip to content

Commit

Permalink
Snapshotting v7.0.0 documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
smallsaucepan committed Jun 18, 2024
1 parent 3722756 commit 30cfe71
Show file tree
Hide file tree
Showing 173 changed files with 12,573 additions and 0 deletions.
79 changes: 79 additions & 0 deletions versioned_docs/version-7.0.0/api/along.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
---
title: along
---

import * as turf from "turf-next";
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(...);
```
53 changes: 53 additions & 0 deletions versioned_docs/version-7.0.0/api/angle.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: angle
---

import * as turf from "turf-next";
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(...);
```
83 changes: 83 additions & 0 deletions versioned_docs/version-7.0.0/api/area.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
---
title: area
---

import * as turf from "turf-next";
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(...);
```
77 changes: 77 additions & 0 deletions versioned_docs/version-7.0.0/api/bbox.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
---
title: bbox
---

import * as turf from "turf-next";
import ExampleMap from "@site/src/components/ExampleMap";
import BrowserOnly from "@docusaurus/BrowserOnly";

### Description

Calculates the bounding box for any GeoJSON object, including FeatureCollection.
Uses geojson.bbox if available and options.recompute is not set.

### Parameters

| Name | Type | Description |
| ------------------------- | ------------------------------------------------------------ | ------------------------------------------------------ |
| geojson | **[GeoJSON](https://tools.ietf.org/html/rfc7946#section-3)** | any GeoJSON object |
| options<i>?</i> | **Object** | Optional parameters _(default \{\})_ |
| options.recompute<i>?</i> | **boolean** | Whether to ignore an existing bbox property on geojson |

### 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(...);
```
87 changes: 87 additions & 0 deletions versioned_docs/version-7.0.0/api/bboxClip.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
---
title: bboxClip
---

import * as turf from "turf-next";
import ExampleMap from "@site/src/components/ExampleMap";
import BrowserOnly from "@docusaurus/BrowserOnly";

### Description

Takes a [Feature](https://tools.ietf.org/html/rfc7946#section-3.2) and a bbox and clips the feature to the bbox using
[lineclip](https://github.com/mapbox/lineclip).
May result in degenerate edges when clipping Polygons.

### Parameters

| Name | Type | Description |
| ------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- |
| feature | **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<[LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4) \| [MultiLineString](https://tools.ietf.org/html/rfc7946#section-3.1.5) \| [Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6) \| [MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7)\>** | feature to clip to the bbox |
| bbox | **[BBox](https://tools.ietf.org/html/rfc7946#section-5)** | extent in [minX, minY, maxX, maxY] order |

### Returns

<ul>
**[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<[LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4) \| [MultiLineString](https://tools.ietf.org/html/rfc7946#section-3.1.5) \| [Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6) \| [MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7)\>** clipped Feature

</ul>

### Examples

```javascript
var bbox = [0, 0, 10, 10];
var poly = turf.polygon([
[
[2, 2],
[8, 4],
[12, 8],
[3, 7],
[2, 2],
],
]);

var clipped = turf.bboxClip(poly, bbox);
```

export function Map0() {
"use strict";

// jsdoc example start
var bbox = [0, 0, 10, 10];
var poly = turf.polygon([
[
[2, 2],
[8, 4],
[12, 8],
[3, 7],
[2, 2],
],
]);

var clipped = turf.bboxClip(poly, bbox);

//addToMap
var addToMap = { bbox, poly, clipped };
// jsdoc example end

return <ExampleMap addToMap={addToMap} />;
}

<!-- prettier-ignore -->
<BrowserOnly>{() => <Map0 />}</BrowserOnly>

### Installation

```javascript
$ npm install @turf/bbox-clip

import { bboxClip } from "@turf/bbox-clip";
const result = bboxClip(...);
```

```javascript
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.bboxClip(...);
```
Loading

0 comments on commit 30cfe71

Please sign in to comment.