Skip to content

Commit

Permalink
Adding v7.2.0 documentation snapshot. (#213)
Browse files Browse the repository at this point in the history
  • Loading branch information
smallsaucepan authored Dec 29, 2024
1 parent e885325 commit 8b1cec6
Show file tree
Hide file tree
Showing 224 changed files with 14,405 additions and 92 deletions.
33 changes: 17 additions & 16 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,24 @@ First thing to do is make sure _Current_ points to the code (and hence, the docu

To do this we link the `turf/` submodule directory in turf-www to the relevant commit in the turf repo. In the example below commit `68915ee` refers to the 7.1.0 tag in the turf repo:

```
$ git -C turf/ checkout 68915ee
```bash
git -C turf/ fetch
git -C turf/ checkout 68915ee
```

Now that the `turf/` submodule points to 7.1.0 code regenerate the API documentation:

```
$ npm run generate-api-mdx
```bash
npm run generate-api-mdx
```

You will likely see many changes to MDX files in the `docs/` directory.

Run docusaurus to view the site in dev mode and highlight any missing routes, etc. Docusaurus is pretty good at finding problems. Fix any issues manually, usually by tweaking the MDX.

```
$ npm run build
$ npm run serve
```bash
npm run build
npm run serve
```

Note the generated documentation will appear under the _Next_ drop down menu.
Expand All @@ -63,15 +64,15 @@ You could at this point commit the changes. However we're about to make a versio

Now, version the contents of _Current_ as 7.1.0:

```
$ npm run docusaurus docs:version 7.1.0
```bash
npm run docusaurus docs:version 7.1.0
```

You will now see many more changes in the `versioned_docs` directory. This is the snapshot we want to commit and publish. Before we do that though, switch back to the HEAD of our git repo and regenerate the _Current_ documentation based on that code:

```
$ git submodule update --init
$ npm run generate-api-mdx
```bash
git submodule update --init
npm run generate-api-mdx
```

Most, if not all, of the changes in docs/ should revert. If any remain review them as they may have previously been committed as manual corrections (and thus can be discarded).
Expand All @@ -88,10 +89,10 @@ versioned_sidebars/ <- one new file

Once everything looks good, commit all the files and push to your fork:

```
$ git add .
$ git commit -m "Adding v7.1.0 documentation snapshot."
$ git push
```bash
git add .
git commit -m "Adding v7.1.0 documentation snapshot."
git push
```

### Publishing to turfjs.org
Expand Down
1 change: 1 addition & 0 deletions api-sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export default [
"api/midpoint",
"api/pointOnFeature",
"api/pointToLineDistance",
"api/pointToPolygonDistance",
"api/polygonTangents",
"api/rhumbBearing",
"api/rhumbDestination",
Expand Down
12 changes: 6 additions & 6 deletions docs/api/booleanDisjoint.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Boolean-disjoint returns (TRUE) if the intersection of the two geometries is an

### Parameters

| Name | Type | Description |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| feature1 | **[Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<any\>** | GeoJSON Feature or Geometry |
| feature2 | **[Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<any\>** | GeoJSON Feature or Geometry |
| options<i>?</i> | **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** | Optional parameters _(default \{\})_ |
| options.ignoreSelfIntersections<i>?</i> | **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** | ignores self-intersections on input features _(default false)_ |
| Name | Type | Description |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------ |
| feature1 | **[Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<any\>** | GeoJSON Feature or Geometry |
| feature2 | **[Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<any\>** | GeoJSON Feature or Geometry |
| options<i>?</i> | **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** | Optional parameters _(default \{\})_ |
| options.ignoreSelfIntersections<i>?</i> | **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** | ignore self-intersections on input features _(default true)_ |

### Returns

Expand Down
12 changes: 6 additions & 6 deletions docs/api/booleanIntersects.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ Boolean-intersects returns (TRUE) if the intersection of the two geometries is N

### Parameters

| Name | Type | Description |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------- |
| feature1 | **[Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<any\>** | GeoJSON Feature or Geometry |
| feature2 | **[Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<any\>** | GeoJSON Feature or Geometry |
| options<i>?</i> | **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** | Optional parameters _(default \{\})_ |
| options.ignoreSelfIntersections<i>?</i> | **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** | ignores self-intersections on input features _(default false)_ |
| Name | Type | Description |
| --------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------ |
| feature1 | **[Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<any\>** | GeoJSON Feature or Geometry |
| feature2 | **[Geometry](https://tools.ietf.org/html/rfc7946#section-3.1) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<any\>** | GeoJSON Feature or Geometry |
| options<i>?</i> | **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** | Optional parameters _(default \{\})_ |
| options.ignoreSelfIntersections<i>?</i> | **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** | ignore self-intersections on input features _(default true)_ |

### Returns

Expand Down
18 changes: 9 additions & 9 deletions docs/api/booleanPointInPolygon.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@ import BrowserOnly from "@docusaurus/BrowserOnly";

### Description

Determines if a point lies within a polygon. The polygon can be convex or
concave, or contain holes.
Takes a [Point](https://tools.ietf.org/html/rfc7946#section-3.1.2) and a [Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6) or [MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7) and determines if the point
resides inside the polygon. The polygon can be convex or concave. The function accounts for holes.

### Parameters

| Name | Type | Description |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------- |
| point | **Position \| [Point](https://tools.ietf.org/html/rfc7946#section-3.1.2) \| [Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<[Point](https://tools.ietf.org/html/rfc7946#section-3.1.2)\>** | Point possibly within the polygon. |
| polygon | **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<[Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6) \| [MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7)\>** | Polygon to search within. |
| options<i>?</i> | **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** | Optional parameters. _(default \{\})_ |
| options.ignoreBoundary<i>?</i> | **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** | If set to true, a point lying on the polygon boundary is not considered to be within the polygon. _(default false)_ |
| Name | Type | Description |
| ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
| point | **[Coord](https://tools.ietf.org/html/rfc7946#section-3.1.1)** | input point |
| polygon | **[Feature](https://tools.ietf.org/html/rfc7946#section-3.2)\<[Polygon](https://tools.ietf.org/html/rfc7946#section-3.1.6) \| [MultiPolygon](https://tools.ietf.org/html/rfc7946#section-3.1.7)\>** | input polygon or multipolygon |
| options<i>?</i> | **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** | Optional parameters _(default \{\})_ |
| options.ignoreBoundary<i>?</i> | **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** | True if polygon boundary should be ignored when determining if the point is inside the polygon otherwise false. _(default false)_ |

### Returns

**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** True if the point lies within the polygon, false otherwise.
**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** `true` if the Point is inside the Polygon; `false` if the Point is not inside the Polygon

### Examples

Expand Down
15 changes: 7 additions & 8 deletions docs/api/convertArea.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@ import BrowserOnly from "@docusaurus/BrowserOnly";

### Description

Converts a area to the requested unit.
Valid units: kilometers, kilometres, meters, metres, centimetres, millimeters, acres, miles, yards, feet, inches, hectares
Converts an area from one unit to another.

### Parameters

| Name | Type | Description |
| -------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------- |
| area | **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** | to be converted |
| originalUnit<i>?</i> | **[AreaUnits](docs/api/types/AreaUnits.mdx)** | of the distance _(default "meters")_ |
| finalUnit<i>?</i> | **[AreaUnits](docs/api/types/AreaUnits.mdx)** | returned unit _(default "kilometers")_ |
| Name | Type | Description |
| -------------------- | ----------------------------------------------------------------------------------------------- | ------------------------------------------- |
| area | **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** | Area to be converted |
| originalUnit<i>?</i> | **[AreaUnits](docs/api/types/AreaUnits.mdx)** | Input area unit _(default "meters")_ |
| finalUnit<i>?</i> | **[AreaUnits](docs/api/types/AreaUnits.mdx)** | Returned area unit _(default "kilometers")_ |

### Returns

**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the converted area
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The converted length

### Installation

Expand Down
15 changes: 7 additions & 8 deletions docs/api/convertLength.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,19 @@ import BrowserOnly from "@docusaurus/BrowserOnly";

### Description

Converts a length to the requested unit.
Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, centimeters, feet
Converts a length from one unit to another.

### Parameters

| Name | Type | Description |
| -------------------- | ----------------------------------------------------------------------------------------------- | -------------------------------------- |
| length | **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** | to be converted |
| originalUnit<i>?</i> | **[Units](docs/api/types/Units.mdx)** | of the length _(default "kilometers")_ |
| finalUnit<i>?</i> | **[Units](docs/api/types/Units.mdx)** | returned unit _(default "kilometers")_ |
| Name | Type | Description |
| -------------------- | ----------------------------------------------------------------------------------------------- | --------------------------------------------- |
| length | **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** | Length to be converted |
| originalUnit<i>?</i> | **[Units](docs/api/types/Units.mdx)** | Input length unit _(default "kilometers")_ |
| finalUnit<i>?</i> | **[Units](docs/api/types/Units.mdx)** | Returned length unit _(default "kilometers")_ |

### Returns

**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the converted length
**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** The converted length

### Installation

Expand Down
3 changes: 2 additions & 1 deletion docs/api/greatCircle.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ import BrowserOnly from "@docusaurus/BrowserOnly";

Calculate great circles routes as [LineString](https://tools.ietf.org/html/rfc7946#section-3.1.4) or [MultiLineString](https://tools.ietf.org/html/rfc7946#section-3.1.5).
If the `start` and `end` points span the antimeridian, the resulting feature will
be split into a `MultiLineString`.
be split into a `MultiLineString`. If the `start` and `end` positions are the same
then a `LineString` will be returned with duplicate coordinates the length of the `npoints` option.

### Parameters

Expand Down
1 change: 1 addition & 0 deletions docs/api/interpolate.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ Takes a set of points and estimates their 'property' values on a grid using the
| options.property<i>?</i> | **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | the property name in `points` from which z-values will be pulled, zValue fallbacks to 3rd coordinate if no property exists. _(default 'elevation')_ |
| options.units<i>?</i> | **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** | used in calculating cellSize, can be degrees, radians, miles, or kilometers _(default 'kilometers')_ |
| options.weight<i>?</i> | **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** | exponent regulating the distance-decay weighting _(default 1)_ |
| options.bbox<i>?</i> | **[BBox](https://tools.ietf.org/html/rfc7946#section-5)** | Bounding Box Array [west, south, east, north] associated with the FeatureCollection. _(default bbox(points))_ |

### Returns

Expand Down
Loading

0 comments on commit 8b1cec6

Please sign in to comment.