From 4a4126a0130438cac3a96932d9d2c8f37a590007 Mon Sep 17 00:00:00 2001 From: Matthew Fedderly Date: Tue, 19 Dec 2023 15:40:20 -0500 Subject: [PATCH 1/4] Upgrade monorepolint and rework its config to match the new pnpm work --- .husky/pre-commit | 4 + .monorepolint.config.mjs | 258 +++++++++++++++ .monorepolint.config.ts | 260 --------------- package.json | 28 +- packages/turf-along/README.md | 20 +- packages/turf-bbox-clip/README.md | 18 +- packages/turf-bbox-polygon/README.md | 4 +- packages/turf-bezier-spline/README.md | 18 +- packages/turf-boolean-equal/README.md | 2 +- .../turf-boolean-point-in-polygon/README.md | 16 +- packages/turf-center-mean/README.md | 6 +- packages/turf-center-median/README.md | 24 +- packages/turf-center-of-mass/README.md | 6 +- packages/turf-center/README.md | 6 +- packages/turf-centroid/README.md | 6 +- packages/turf-circle/README.md | 26 +- packages/turf-clusters-dbscan/README.md | 24 +- packages/turf-clusters-dbscan/index.ts | 19 +- packages/turf-clusters-kmeans/README.md | 18 +- packages/turf-clusters/README.md | 4 +- packages/turf-combine/README.md | 18 +- packages/turf-concave/README.md | 24 +- packages/turf-convex/README.md | 6 +- packages/turf-destination/README.md | 4 +- packages/turf-difference/README.md | 10 +- packages/turf-directional-mean/README.md | 2 +- packages/turf-distance-weight/README.md | 2 +- packages/turf-distance/README.md | 18 +- packages/turf-ellipse/README.md | 2 +- packages/turf-envelope/README.md | 4 +- packages/turf-flatten/README.md | 8 +- packages/turf-geojson-rbush/README.md | 304 ++++++++++++++---- packages/turf-great-circle/README.md | 6 +- packages/turf-helpers/README.md | 184 ++++++----- packages/turf-hex-grid/README.md | 12 +- packages/turf-intersect/README.md | 16 +- packages/turf-invariant/README.md | 20 +- packages/turf-isobands/README.md | 30 +- packages/turf-isolines/README.md | 30 +- packages/turf-kinks/README.md | 16 +- packages/turf-line-chunk/README.md | 24 +- packages/turf-line-offset/README.md | 20 +- packages/turf-line-segment/README.md | 6 +- packages/turf-line-slice-along/README.md | 20 +- packages/turf-line-slice/README.md | 6 +- packages/turf-mask/README.md | 10 +- packages/turf-meta/README.md | 14 +- packages/turf-midpoint/README.md | 4 +- packages/turf-moran-index/README.md | 14 +- .../turf-nearest-neighbor-analysis/README.md | 40 +-- packages/turf-nearest-point-on-line/README.md | 24 +- packages/turf-nearest-point-to-line/README.md | 28 +- packages/turf-nearest-point/README.md | 16 +- packages/turf-planepoint/README.md | 8 +- packages/turf-point-grid/README.md | 14 +- packages/turf-point-on-feature/README.md | 4 +- .../turf-point-to-line-distance/README.md | 24 +- packages/turf-points-within-polygon/README.md | 16 +- packages/turf-polygon-smooth/README.md | 18 +- packages/turf-polygon-tangents/README.md | 12 +- packages/turf-polygon-to-line/README.md | 18 +- packages/turf-polygonize/README.md | 14 +- packages/turf-quadrat-analysis/README.md | 22 +- packages/turf-rectangle-grid/README.md | 12 +- packages/turf-rhumb-destination/README.md | 4 +- packages/turf-sample/README.md | 10 +- packages/turf-shortest-path/README.md | 17 +- packages/turf-simplify/README.md | 20 +- .../README.md | 26 +- packages/turf-tag/README.md | 18 +- packages/turf-tin/README.md | 12 +- packages/turf-triangle-grid/README.md | 8 +- packages/turf-union/README.md | 14 +- pnpm-lock.yaml | 109 ++----- 74 files changed, 1223 insertions(+), 886 deletions(-) create mode 100755 .husky/pre-commit create mode 100644 .monorepolint.config.mjs delete mode 100644 .monorepolint.config.ts diff --git a/.husky/pre-commit b/.husky/pre-commit new file mode 100755 index 0000000000..a5a29d9f7d --- /dev/null +++ b/.husky/pre-commit @@ -0,0 +1,4 @@ +#!/usr/bin/env sh +. "$(dirname -- "$0")/_/husky.sh" + +pnpm lint-staged diff --git a/.monorepolint.config.mjs b/.monorepolint.config.mjs new file mode 100644 index 0000000000..505ae8ab27 --- /dev/null +++ b/.monorepolint.config.mjs @@ -0,0 +1,258 @@ +// @ts-check +import * as path from "node:path"; +import { glob } from "glob"; +import * as fs from "node:fs"; +import { + alphabeticalDependencies, + alphabeticalScripts, + packageOrder, + packageEntry, + packageScript, + requireDependency, +} from "@monorepolint/rules"; + +const TS_PACKAGES = []; // projects that use typescript to build +const JS_PACKAGES = []; // projects that use javascript/rollup to build +const MAIN_PACKAGE = "@turf/turf"; + +const TAPE_PACKAGES = []; // projects that have tape tests +const TYPES_PACKAGES = []; // projects that have types tests +const BENCH_PACKAGES = []; // projects that have benchmarks + +// iterate all the packages and figure out what buckets everything falls into +const __dirname = new URL(".", import.meta.url).pathname; +glob.sync(path.join(__dirname, "packages", "turf-*")).forEach((pk) => { + const name = JSON.parse( + fs.readFileSync(path.join(pk, "package.json"), "utf8") + ).name; + + if (fs.existsSync(path.join(pk, "index.ts"))) { + TS_PACKAGES.push(name); + } else { + JS_PACKAGES.push(name); + } + + if (fs.existsSync(path.join(pk, "test.js"))) { + TAPE_PACKAGES.push(name); + } + + if (fs.existsSync(path.join(pk, "types.ts"))) { + TYPES_PACKAGES.push(name); + } +}); + +const TS_BENCH_PACKAGES = BENCH_PACKAGES.filter( + (pkg) => -1 !== TS_PACKAGES.indexOf(pkg) +); +const JS_BENCH_PACKAGES = BENCH_PACKAGES.filter( + (pkg) => -1 !== JS_PACKAGES.indexOf(pkg) +); +const TS_TAPE_PACKAGES = TAPE_PACKAGES.filter( + (pkg) => -1 !== TS_PACKAGES.indexOf(pkg) +); +const JS_TAPE_PACKAGES = TAPE_PACKAGES.filter( + (pkg) => -1 !== JS_PACKAGES.indexOf(pkg) +); + +export default { + rules: [ + packageOrder({ + options: { + order: [ + "name", + "version", + "private", + "description", + "author", + "contributors", + "license", + "bugs", + "homepage", + "repository", + "funding", + "publishConfig", + "keywords", + "type", + "main", + "module", + "types", + "exports", + "browser", + "sideEffects", + "files", + "scripts", + "husky", + "lint-staged", + "devDependencies", + "dependencies", + ], + }, + includeWorkspaceRoot: true, + }), + alphabeticalDependencies({ includeWorkspaceRoot: true }), + alphabeticalScripts({ includeWorkspaceRoot: true }), + packageEntry({ + options: { + entries: { + // @turf/turf is commonly consumed through CDNs, moving this output file is a breaking change for anyone + // who has a hardcoded reference to this specific file, instead of letting the CDN pick the path. + // Example of a URL that will break: https://unpkg.com/@turf/turf/dist/turf.min.js + // Example of a URL that will keep working: https://unpkg.com/@turf/turf + browser: "turf.min.js", + files: ["dist", "index.d.ts", "turf.min.js"], + exports: { + "./package.json": "./package.json", + ".": { + import: { + types: "./dist/esm/index.d.mts", + default: "./dist/esm/index.mjs", + }, + require: { + types: "./dist/cjs/index.d.ts", + default: "./dist/cjs/index.cjs", + }, + }, + }, + }, + }, + includePackages: [MAIN_PACKAGE], + }), + + packageEntry({ + options: { + entries: { + main: "dist/cjs/index.cjs", + module: "dist/esm/index.mjs", + types: "dist/cjs/index.d.ts", + sideEffects: false, + publishConfig: { + access: "public", + }, + exports: { + "./package.json": "./package.json", + ".": { + import: { + types: "./dist/esm/index.d.mts", + default: "./dist/esm/index.mjs", + }, + require: { + types: "./dist/cjs/index.d.ts", + default: "./dist/cjs/index.cjs", + }, + }, + }, + }, + }, + includePackages: [...TS_PACKAGES, ...JS_PACKAGES], + }), + + packageEntry({ + options: { + entries: { + files: ["dist"], + }, + }, + includePackages: TS_PACKAGES, + }), + + packageEntry({ + options: { + entries: { + files: ["dist", "index.d.ts"], + }, + }, + includePackages: JS_PACKAGES, + }), + + packageEntry({ + options: { + entries: { + funding: "https://opencollective.com/turf", + }, + }, + }), + + packageScript({ + options: { + scripts: { + docs: "tsx ../../scripts/generate-readmes.ts", + test: "npm-run-all --npm-path npm test:*", + }, + }, + excludePackages: [MAIN_PACKAGE], + }), + + packageScript({ + options: { + scripts: { + build: "tsup --config ../../tsup.config.ts", + }, + }, + includePackages: [...TS_PACKAGES, ...JS_PACKAGES], + }), + + packageScript({ + options: { + scripts: { + build: + "tsup --config ../../tsup.config.ts && rollup -c rollup.config.js", + }, + }, + includePackages: [MAIN_PACKAGE], + }), + + packageScript({ + options: { + scripts: { + bench: "tsx bench.ts", + "test:tape": "tsx test.ts", + }, + }, + includePackages: [...TS_TAPE_PACKAGES, ...JS_TAPE_PACKAGES], + }), + + packageScript({ + options: { + scripts: { + "test:types": "tsc --esModuleInterop --noEmit --strict types.ts", + }, + }, + includePackages: TYPES_PACKAGES, + }), + + requireDependency({ + options: { + devDependencies: { + benchmark: "^2.1.4", + "npm-run-all": "^4.1.5", + tape: "^5.7.2", + tsx: "^4.6.2", + }, + }, + includePackages: [...TS_PACKAGES, ...JS_PACKAGES], + }), + + requireDependency({ + options: { + dependencies: { + tslib: "^2.6.2", + }, + devDependencies: { + "@types/benchmark": "^2.1.5", + "@types/tape": "^4.2.32", + typescript: "^5.2.2", + }, + }, + includePackages: TS_PACKAGES, + }), + + requireDependency({ + options: { + devDependencies: { + rollup: "^2.79.1", + }, + }, + includePackages: [MAIN_PACKAGE], + }), + ], +}; diff --git a/.monorepolint.config.ts b/.monorepolint.config.ts deleted file mode 100644 index 8ba6bec739..0000000000 --- a/.monorepolint.config.ts +++ /dev/null @@ -1,260 +0,0 @@ -const path = require("path"); -const { glob } = require("glob"); -const fs = require("fs"); - -const TS_PACKAGES: string[] = []; // projects that use typescript to build -const JS_PACKAGES: string[] = []; // projects that use javascript/rollup to build -const MAIN_PACKAGE = "@turf/turf"; - -const TAPE_PACKAGES: string[] = []; // projects that have tape tests -const TYPES_PACKAGES: string[] = []; // projects that have types tests -const BENCH_PACKAGES: string[] = []; // projects that have benchmarks - -// iterate all the packages and figure out what buckets everything falls into -glob.sync(path.join(__dirname, "packages", "turf-*")).forEach((pk) => { - const name: string = JSON.parse( - fs.readFileSync(path.join(pk, "package.json"), "utf8") - ).name; - - if (fs.existsSync(path.join(pk, "index.ts"))) { - TS_PACKAGES.push(name); - } else { - JS_PACKAGES.push(name); - } - - if (fs.existsSync(path.join(pk, "test.js"))) { - TAPE_PACKAGES.push(name); - } - - if (fs.existsSync(path.join(pk, "types.ts"))) { - TYPES_PACKAGES.push(name); - } -}); - -const TS_BENCH_PACKAGES = BENCH_PACKAGES.filter( - (pkg) => -1 !== TS_PACKAGES.indexOf(pkg) -); -const JS_BENCH_PACKAGES = BENCH_PACKAGES.filter( - (pkg) => -1 !== JS_PACKAGES.indexOf(pkg) -); -const TS_TAPE_PACKAGES = TAPE_PACKAGES.filter( - (pkg) => -1 !== TS_PACKAGES.indexOf(pkg) -); -const JS_TAPE_PACKAGES = TAPE_PACKAGES.filter( - (pkg) => -1 !== JS_PACKAGES.indexOf(pkg) -); - -module.exports = { - rules: { - ":package-order": { - options: { - order: [ - "name", - "version", - "private", - "description", - "workspaces", - "author", - "contributors", - "license", - "bugs", - "homepage", - "repository", - "funding", - "publishConfig", - "keywords", - "main", - "module", - "exports", - "browser", - "types", - "sideEffects", - "files", - "scripts", - "husky", - "lint-staged", - "devDependencies", - "dependencies", - ], - }, - includeWorkspaceRoot: true, - }, - - ":alphabetical-scripts": {}, - - ":package-entry": [ - { - options: { - entries: { - // @turf/turf is commonly consumed through CDNs, moving this output file is a breaking change for anyone - // who has a hardcoded reference to this specific file, instead of letting the CDN pick the path. - // Example of a URL that will break: https://unpkg.com/@turf/turf/dist/turf.min.js - // Example of a URL that will keep working: https://unpkg.com/@turf/turf - browser: "turf.min.js", - files: ["dist", "index.d.ts", "turf.min.js"], - exports: { - "./package.json": "./package.json", - ".": { - types: "./index.d.ts", - import: "./dist/es/index.js", - require: "./dist/js/index.js", - }, - }, - }, - }, - includePackages: [MAIN_PACKAGE], - }, - { - options: { - entries: { - main: "dist/js/index.js", - module: "dist/es/index.js", - sideEffects: false, - publishConfig: { - access: "public", - }, - }, - }, - includePackages: [...TS_PACKAGES, ...JS_PACKAGES], - }, - { - options: { - entries: { - types: "dist/js/index.d.ts", - files: ["dist"], - exports: { - "./package.json": "./package.json", - ".": { - types: "./dist/js/index.d.ts", - import: "./dist/es/index.js", - require: "./dist/js/index.js", - }, - }, - }, - }, - includePackages: TS_PACKAGES, - }, - { - options: { - entries: { - types: "index.d.ts", - files: ["dist", "index.d.ts"], - exports: { - "./package.json": "./package.json", - ".": { - types: "./index.d.ts", - import: "./dist/es/index.js", - require: "./dist/js/index.js", - }, - }, - }, - }, - includePackages: JS_PACKAGES, - }, - { - options: { - entries: { - funding: "https://opencollective.com/turf", - }, - }, - }, - ], - - ":package-script": [ - { - options: { - scripts: { - docs: "tsx ../../scripts/generate-readmes.ts", - test: "npm-run-all --npm-path npm test:*", - }, - }, - excludePackages: [MAIN_PACKAGE], - }, - { - options: { - scripts: { - build: "npm-run-all --npm-path npm build:*", - "build:js": "tsc", - "build:es": - 'tsc --outDir dist/es --module esnext --declaration false && echo \'{"type":"module"}\' > dist/es/package.json', - }, - }, - includePackages: TS_PACKAGES, - }, - { - options: { - scripts: { - build: - 'rollup -c ../../rollup.config.js && echo \'{"type":"module"}\' > dist/es/package.json', - }, - }, - includePackages: JS_PACKAGES, - }, - { - options: { - scripts: { - build: - 'rollup -c rollup.config.js && echo \'{"type":"module"}\' > dist/es/package.json', - }, - }, - includePackages: [MAIN_PACKAGE], - }, - { - options: { - scripts: { - bench: "tsx bench.ts", - "test:tape": "tsx test.ts", - }, - }, - includePackages: [...TS_TAPE_PACKAGES, ...JS_TAPE_PACKAGES], - }, - { - options: { - scripts: { - "test:types": "tsc --esModuleInterop --noEmit --strict types.ts", - }, - }, - includePackages: TYPES_PACKAGES, - }, - ], - - ":alphabetical-dependencies": { - includeWorkspaceRoot: true, - }, - - ":require-dependency": [ - { - options: { - devDependencies: { - benchmark: "^2.1.4", - "npm-run-all": "^4.1.5", - tape: "^5.7.2", - tsx: "^3.14.0", - }, - }, - includePackages: [...TS_PACKAGES, ...JS_PACKAGES], - }, - { - options: { - dependencies: { - tslib: "^2.6.2", - }, - devDependencies: { - "@types/benchmark": "^2.1.5", - "@types/tape": "^4.2.32", - typescript: "^5.2.2", - }, - }, - includePackages: TS_PACKAGES, - }, - { - options: { - devDependencies: { - rollup: "^2.79.1", - }, - }, - includePackages: JS_PACKAGES, - }, - ], - }, -}; diff --git a/package.json b/package.json index a2c7ad0ba0..715b6708f9 100644 --- a/package.json +++ b/package.json @@ -2,23 +2,18 @@ "private": true, "funding": "https://opencollective.com/turf", "scripts": { + "docs": "tsx ./scripts/generate-readmes.ts", "lint": "npm-run-all lint:*", - "lint:eslint": "eslint packages", - "lint:prettier": "prettier --check .", - "lintDISABLED:mrl": "mrl check", + "lint:docs": "documentation lint packages/turf-*/index.js packages/turf-*/index.mjs", "lint:escheck-cjs": "es-check es8 packages/*/dist/cjs/index.cjs packages/turf/turf.min.js", "lint:escheck-esm": "es-check --module es8 packages/*/dist/esm/index.mjs", "lint:escheck-web": "es-check es5 packages/turf/turf.min.js", - "lint:docs": "documentation lint packages/turf-*/index.js packages/turf-*/index.mjs", + "lint:eslint": "eslint packages", + "lint:mrl": "mrl check", + "lint:prettier": "prettier --check .", "preinstall": "npx only-allow pnpm", - "prepare": "lerna run build", - "test": "pnpm run lint && lerna run test && lerna run --scope @turf/turf last-checks", - "docs": "tsx ./scripts/generate-readmes.ts" - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } + "prepare": "lerna run build && husky install", + "test": "pnpm run lint && lerna run test && lerna run --scope @turf/turf last-checks" }, "lint-staged": { "package.json": [ @@ -29,11 +24,15 @@ "prettier --write" ], "packages/*/index.{js,ts}": [ - "./scripts/generate-readmes" + "pnpm tsx ./scripts/generate-readmes" ], "**/*": "prettier --write --ignore-unknown" }, "devDependencies": { + "@monorepolint/cli": "0.5.0-alpha.132", + "@monorepolint/config": "0.5.0-alpha.132", + "@monorepolint/core": "0.5.0-alpha.132", + "@monorepolint/rules": "0.5.0-alpha.132", "@types/geojson": "7946.0.8", "@types/node": "18.11.9", "@typescript-eslint/eslint-plugin": "^6.10.0", @@ -50,12 +49,11 @@ "eslint-plugin-prettier": "^5.0.1", "esm": "^3.2.25", "fs-extra": "^11.1.1", - "husky": "^4.3.8", + "husky": "^8.0.0", "lerna": "^7.4.2", "lint-staged": "^10.5.4", "load-json-file": "^7.0.1", "meow": "^12.1.1", - "monorepolint": "^0.5.0-alpha.20", "npm-run-all": "^4.1.5", "prettier": "^3.0.3", "progress": "^2.0.3", diff --git a/packages/turf-along/README.md b/packages/turf-along/README.md index e172218e84..1c2ad30c2c 100644 --- a/packages/turf-along/README.md +++ b/packages/turf-along/README.md @@ -8,11 +8,11 @@ Takes a [LineString][1] and returns a [Point][2] at a specified distance along t ### Parameters -* `line` **[Feature][3]<[LineString][1]>** input line -* `distance` **[number][4]** distance along the line -* `options` **[Object][5]?** Optional parameters +* `line` **[Feature][3]<[LineString][4]>** input line +* `distance` **[number][5]** distance along the line +* `options` **[Object][6]?** Optional parameters - * `options.units` **[string][6]** can be degrees, radians, miles, or kilometers (optional, default `"kilometers"`) + * `options.units` **[string][7]** can be degrees, radians, miles, or kilometers (optional, default `"kilometers"`) ### Examples @@ -26,7 +26,7 @@ var along = turf.along(line, 200, options); var addToMap = [along, line] ``` -Returns **[Feature][3]<[Point][2]>** Point `distance` `units` along the line +Returns **[Feature][3]<[Point][8]>** Point `distance` `units` along the line [1]: https://tools.ietf.org/html/rfc7946#section-3.1.4 @@ -34,11 +34,15 @@ Returns **[Feature][3]<[Point][2]>** Point `distance` `units` along the line [3]: https://tools.ietf.org/html/rfc7946#section-3.2 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.4 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[8]: https://tools.ietf.org/html/rfc7946#section-3.1.2 diff --git a/packages/turf-bbox-clip/README.md b/packages/turf-bbox-clip/README.md index e9031ca2c0..753546249c 100644 --- a/packages/turf-bbox-clip/README.md +++ b/packages/turf-bbox-clip/README.md @@ -10,8 +10,8 @@ May result in degenerate edges when clipping Polygons. ### Parameters -* `feature` **[Feature][1]<([LineString][3] | [MultiLineString][4] | [Polygon][5] | [MultiPolygon][6])>** feature to clip to the bbox -* `bbox` **[BBox][7]** extent in \[minX, minY, maxX, maxY] order +* `feature` **[Feature][3]<([LineString][4] | [MultiLineString][5] | [Polygon][6] | [MultiPolygon][7])>** feature to clip to the bbox +* `bbox` **[BBox][8]** extent in \[minX, minY, maxX, maxY] order ### Examples @@ -25,21 +25,23 @@ var clipped = turf.bboxClip(poly, bbox); var addToMap = [bbox, poly, clipped] ``` -Returns **[Feature][1]<([LineString][3] | [MultiLineString][4] | [Polygon][5] | [MultiPolygon][6])>** clipped Feature +Returns **[Feature][3]<([LineString][4] | [MultiLineString][5] | [Polygon][6] | [MultiPolygon][7])>** clipped Feature [1]: https://tools.ietf.org/html/rfc7946#section-3.2 [2]: https://github.com/mapbox/lineclip -[3]: https://tools.ietf.org/html/rfc7946#section-3.1.4 +[3]: https://tools.ietf.org/html/rfc7946#section-3.2 -[4]: https://tools.ietf.org/html/rfc7946#section-3.1.5 +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.4 -[5]: https://tools.ietf.org/html/rfc7946#section-3.1.6 +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.5 -[6]: https://tools.ietf.org/html/rfc7946#section-3.1.7 +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.6 -[7]: https://tools.ietf.org/html/rfc7946#section-5 +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + +[8]: https://tools.ietf.org/html/rfc7946#section-5 diff --git a/packages/turf-bbox-polygon/README.md b/packages/turf-bbox-polygon/README.md index f0368d0432..f63460721d 100644 --- a/packages/turf-bbox-polygon/README.md +++ b/packages/turf-bbox-polygon/README.md @@ -25,7 +25,7 @@ var poly = turf.bboxPolygon(bbox); var addToMap = [poly] ``` -Returns **[Feature][6]<[Polygon][1]>** a Polygon representation of the bounding box +Returns **[Feature][6]<[Polygon][7]>** a Polygon representation of the bounding box [1]: https://tools.ietf.org/html/rfc7946#section-3.1.6 @@ -39,6 +39,8 @@ Returns **[Feature][6]<[Polygon][1]>** a Polygon representation of the bounding [6]: https://tools.ietf.org/html/rfc7946#section-3.2 +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + --- diff --git a/packages/turf-bezier-spline/README.md b/packages/turf-bezier-spline/README.md index 58a7e82c00..4e71c4c1f3 100644 --- a/packages/turf-bezier-spline/README.md +++ b/packages/turf-bezier-spline/README.md @@ -12,12 +12,12 @@ The bezier spline implementation is by [Leszek Rybicki][3]. ### Parameters -* `line` **[Feature][4]<[LineString][1]>** input LineString -* `options` **[Object][5]** Optional parameters (optional, default `{}`) +* `line` **[Feature][4]<[LineString][5]>** input LineString +* `options` **[Object][6]** Optional parameters (optional, default `{}`) - * `options.properties` **[Object][5]** Translate properties to output (optional, default `{}`) - * `options.resolution` **[number][6]** time in milliseconds between points (optional, default `10000`) - * `options.sharpness` **[number][6]** a measure of how curvy the path should be between splines (optional, default `0.85`) + * `options.properties` **[Object][6]** Translate properties to output (optional, default `{}`) + * `options.resolution` **[number][7]** time in milliseconds between points (optional, default `10000`) + * `options.sharpness` **[number][7]** a measure of how curvy the path should be between splines (optional, default `0.85`) ### Examples @@ -38,7 +38,7 @@ var addToMap = [line, curved] curved.properties = { stroke: '#0F0' }; ``` -Returns **[Feature][4]<[LineString][1]>** curved line +Returns **[Feature][4]<[LineString][5]>** curved line [1]: https://tools.ietf.org/html/rfc7946#section-3.1.4 @@ -48,9 +48,11 @@ Returns **[Feature][4]<[LineString][1]>** curved line [4]: https://tools.ietf.org/html/rfc7946#section-3.2 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.4 -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number diff --git a/packages/turf-boolean-equal/README.md b/packages/turf-boolean-equal/README.md index 912a42388c..818ee623e4 100644 --- a/packages/turf-boolean-equal/README.md +++ b/packages/turf-boolean-equal/README.md @@ -5,7 +5,7 @@ ## booleanEqual Determine whether two geometries of the same type have identical X,Y coordinate values. -See [http://edndoc.esri.com/arcsde/9.0/general\_topics/understand\_spatial\_relations.htm][1] +See [http://edndoc.esri.com/arcsde/9.0/general_topics/understand_spatial_relations.htm][1] ### Parameters diff --git a/packages/turf-boolean-point-in-polygon/README.md b/packages/turf-boolean-point-in-polygon/README.md index b4e929eb17..47f668cb63 100644 --- a/packages/turf-boolean-point-in-polygon/README.md +++ b/packages/turf-boolean-point-in-polygon/README.md @@ -10,10 +10,10 @@ resides inside the polygon. The polygon can be convex or concave. The function a ### Parameters * `point` **[Coord][4]** input point -* `polygon` **[Feature][5]<([Polygon][2] | [MultiPolygon][3])>** input polygon or multipolygon -* `options` **[Object][6]** Optional parameters (optional, default `{}`) +* `polygon` **[Feature][5]<([Polygon][6] | [MultiPolygon][7])>** input polygon or multipolygon +* `options` **[Object][8]** Optional parameters (optional, default `{}`) - * `options.ignoreBoundary` **[boolean][7]** True if polygon boundary should be ignored when determining if + * `options.ignoreBoundary` **[boolean][9]** True if polygon boundary should be ignored when determining if the point is inside the polygon otherwise false. (optional, default `false`) ### Examples @@ -32,7 +32,7 @@ turf.booleanPointInPolygon(pt, poly); //= true ``` -Returns **[boolean][7]** `true` if the Point is inside the Polygon; `false` if the Point is not inside the Polygon +Returns **[boolean][9]** `true` if the Point is inside the Polygon; `false` if the Point is not inside the Polygon [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -44,9 +44,13 @@ Returns **[boolean][7]** `true` if the Point is inside the Polygon; `false` if t [5]: https://tools.ietf.org/html/rfc7946#section-3.2 -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.6 -[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean diff --git a/packages/turf-center-mean/README.md b/packages/turf-center-mean/README.md index 1efa4de049..299afa4842 100644 --- a/packages/turf-center-mean/README.md +++ b/packages/turf-center-mean/README.md @@ -34,7 +34,7 @@ mean.properties['marker-size'] = 'large'; mean.properties['marker-color'] = '#000'; ``` -Returns **[Feature][1]<[Point][6]>** a Point feature at the mean center point of all input features +Returns **[Feature][6]<[Point][7]>** a Point feature at the mean center point of all input features [1]: https://tools.ietf.org/html/rfc7946#section-3.2 @@ -46,7 +46,9 @@ Returns **[Feature][1]<[Point][6]>** a Point feature at the mean center point of [5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[6]: https://tools.ietf.org/html/rfc7946#section-3.1.2 +[6]: https://tools.ietf.org/html/rfc7946#section-3.2 + +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.2 diff --git a/packages/turf-center-median/README.md b/packages/turf-center-median/README.md index bc634bc78b..d239e7a923 100644 --- a/packages/turf-center-median/README.md +++ b/packages/turf-center-median/README.md @@ -43,12 +43,12 @@ Press, 2009, 150–151. ### Parameters -* `features` **[FeatureCollection][1]\** Any GeoJSON Feature Collection -* `options` **[Object][3]** Optional parameters (optional, default `{}`) +* `features` **[FeatureCollection][3]\** Any GeoJSON Feature Collection +* `options` **[Object][4]** Optional parameters (optional, default `{}`) - * `options.weight` **[string][4]?** the property name used to weight the center - * `options.tolerance` **[number][5]** the difference in distance between candidate medians at which point the algorighim stops iterating. (optional, default `0.001`) - * `options.counter` **[number][5]** how many attempts to find the median, should the tolerance be insufficient. (optional, default `10`) + * `options.weight` **[string][5]?** the property name used to weight the center + * `options.tolerance` **[number][6]** the difference in distance between candidate medians at which point the algorighim stops iterating. (optional, default `0.001`) + * `options.counter` **[number][6]** how many attempts to find the median, should the tolerance be insufficient. (optional, default `10`) ### Examples @@ -60,21 +60,23 @@ var medianCenter = turf.centerMedian(points); var addToMap = [points, medianCenter] ``` -Returns **[Feature][6]<[Point][7]>** The median center of the collection +Returns **[Feature][7]<[Point][8]>** The median center of the collection [1]: https://tools.ietf.org/html/rfc7946#section-3.3 [2]: https://doi.org/10.1111/j.1467-9787.1962.tb00902.x} -[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[3]: https://tools.ietf.org/html/rfc7946#section-3.3 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[6]: https://tools.ietf.org/html/rfc7946#section-3.2 +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[7]: https://tools.ietf.org/html/rfc7946#section-3.1.2 +[7]: https://tools.ietf.org/html/rfc7946#section-3.2 + +[8]: https://tools.ietf.org/html/rfc7946#section-3.1.2 diff --git a/packages/turf-center-of-mass/README.md b/packages/turf-center-of-mass/README.md index 7d35fd2fcd..138195320b 100644 --- a/packages/turf-center-of-mass/README.md +++ b/packages/turf-center-of-mass/README.md @@ -24,7 +24,7 @@ var center = turf.centerOfMass(polygon); var addToMap = [polygon, center] ``` -Returns **[Feature][1]<[Point][7]>** the center of mass +Returns **[Feature][7]<[Point][8]>** the center of mass [1]: https://tools.ietf.org/html/rfc7946#section-3.2 @@ -38,7 +38,9 @@ Returns **[Feature][1]<[Point][7]>** the center of mass [6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[7]: https://tools.ietf.org/html/rfc7946#section-3.1.2 +[7]: https://tools.ietf.org/html/rfc7946#section-3.2 + +[8]: https://tools.ietf.org/html/rfc7946#section-3.1.2 diff --git a/packages/turf-center/README.md b/packages/turf-center/README.md index 1f138a456a..8e6d3f138e 100644 --- a/packages/turf-center/README.md +++ b/packages/turf-center/README.md @@ -32,7 +32,7 @@ center.properties['marker-size'] = 'large'; center.properties['marker-color'] = '#000'; ``` -Returns **[Feature][1]<[Point][5]>** a Point feature at the absolute center point of all input features +Returns **[Feature][5]<[Point][6]>** a Point feature at the absolute center point of all input features [1]: https://tools.ietf.org/html/rfc7946#section-3.2 @@ -42,7 +42,9 @@ Returns **[Feature][1]<[Point][5]>** a Point feature at the absolute center poin [4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[5]: https://tools.ietf.org/html/rfc7946#section-3.1.2 +[5]: https://tools.ietf.org/html/rfc7946#section-3.2 + +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.2 diff --git a/packages/turf-centroid/README.md b/packages/turf-centroid/README.md index 3e95e40643..9d28e952f2 100644 --- a/packages/turf-centroid/README.md +++ b/packages/turf-centroid/README.md @@ -24,7 +24,7 @@ var centroid = turf.centroid(polygon); var addToMap = [polygon, centroid] ``` -Returns **[Feature][3]<[Point][4]>** the centroid of the input object +Returns **[Feature][4]<[Point][5]>** the centroid of the input object [1]: https://tools.ietf.org/html/rfc7946#section-3 @@ -32,7 +32,9 @@ Returns **[Feature][3]<[Point][4]>** the centroid of the input object [3]: https://tools.ietf.org/html/rfc7946#section-3.2 -[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2 +[4]: https://tools.ietf.org/html/rfc7946#section-3.2 + +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.2 diff --git a/packages/turf-circle/README.md b/packages/turf-circle/README.md index 89fdaa522c..c28581442e 100644 --- a/packages/turf-circle/README.md +++ b/packages/turf-circle/README.md @@ -8,13 +8,13 @@ Takes a [Point][1] and calculates the circle polygon given a radius in degrees, ### Parameters -* `center` **([Feature][2]<[Point][1]> | [Array][3]<[number][4]>)** center point -* `radius` **[number][4]** radius of the circle -* `options` **[Object][5]** Optional parameters (optional, default `{}`) +* `center` **([Feature][2]<[Point][3]> | [Array][4]<[number][5]>)** center point +* `radius` **[number][5]** radius of the circle +* `options` **[Object][6]** Optional parameters (optional, default `{}`) - * `options.steps` **[number][4]** number of steps (optional, default `64`) - * `options.units` **[string][6]** miles, kilometers, degrees, or radians (optional, default `'kilometers'`) - * `options.properties` **[Object][5]** properties (optional, default `{}`) + * `options.steps` **[number][5]** number of steps (optional, default `64`) + * `options.units` **[string][7]** miles, kilometers, degrees, or radians (optional, default `'kilometers'`) + * `options.properties` **[Object][6]** properties (optional, default `{}`) ### Examples @@ -28,21 +28,23 @@ var circle = turf.circle(center, radius, options); var addToMap = [turf.point(center), circle] ``` -Returns **[Feature][2]<[Polygon][7]>** circle polygon +Returns **[Feature][2]<[Polygon][8]>** circle polygon [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 [2]: https://tools.ietf.org/html/rfc7946#section-3.2 -[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array +[3]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[7]: https://tools.ietf.org/html/rfc7946#section-3.1.6 +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[8]: https://tools.ietf.org/html/rfc7946#section-3.1.6 diff --git a/packages/turf-clusters-dbscan/README.md b/packages/turf-clusters-dbscan/README.md index 974d6af7ca..a00e5c620c 100644 --- a/packages/turf-clusters-dbscan/README.md +++ b/packages/turf-clusters-dbscan/README.md @@ -8,13 +8,13 @@ Takes a set of [points][1] and partition them into clusters according to [https: ### Parameters -* `points` **[FeatureCollection][3]<[Point][1]>** to be clustered -* `maxDistance` **[number][4]** Maximum Distance between any point of the cluster to generate the clusters (kilometers only) -* `options` **[Object][5]** Optional parameters (optional, default `{}`) +* `points` **[FeatureCollection][3]<[Point][4]>** to be clustered +* `maxDistance` **[number][5]** Maximum Distance between any point of the cluster to generate the clusters (kilometers only) +* `options` **[Object][6]** Optional parameters (optional, default `{}`) - * `options.units` **[string][6]** in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers (optional, default `"kilometers"`) - * `options.mutate` **[boolean][7]** Allows GeoJSON input to be mutated (optional, default `false`) - * `options.minPoints` **[number][4]** Minimum number of points to generate a single cluster, + * `options.units` **[string][7]** in which `maxDistance` is expressed, can be degrees, radians, miles, or kilometers (optional, default `"kilometers"`) + * `options.mutate` **[boolean][8]** Allows GeoJSON input to be mutated (optional, default `false`) + * `options.minPoints` **[number][5]** Minimum number of points to generate a single cluster, points which do not meet this requirement will be classified as an 'edge' or 'noise'. (optional, default `3`) ### Examples @@ -29,7 +29,7 @@ var clustered = turf.clustersDbscan(points, maxDistance); var addToMap = [clustered]; ``` -Returns **[FeatureCollection][3]<[Point][1]>** Clustered Points with an additional two properties associated to each Feature:* {number} cluster - the associated clusterId +Returns **[FeatureCollection][3]<[Point][4]>** Clustered Points with an additional two properties associated to each Feature:* {number} cluster - the associated clusterId * {string} dbscan - type of point it has been classified as ('core'|'edge'|'noise') [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -38,13 +38,15 @@ Returns **[FeatureCollection][3]<[Point][1]>** Clustered Points with an addition [3]: https://tools.ietf.org/html/rfc7946#section-3.3 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean diff --git a/packages/turf-clusters-dbscan/index.ts b/packages/turf-clusters-dbscan/index.ts index 4908cb946a..f24a3df534 100644 --- a/packages/turf-clusters-dbscan/index.ts +++ b/packages/turf-clusters-dbscan/index.ts @@ -2,7 +2,6 @@ import { GeoJsonProperties, FeatureCollection, Point } from "geojson"; import { clone } from "@turf/clone"; import { distance } from "@turf/distance"; import { degreesToRadians, lengthToDegrees, Units } from "@turf/helpers"; -// @ts-expect-error No types available for rbush. import RBush from "rbush"; type Dbscan = "core" | "edge" | "noise"; @@ -121,14 +120,16 @@ function clustersDbscan( // Calculate the bounding box for the region query const bbox = { minX, minY, maxX, maxY }; - return tree.search(bbox).filter((neighbor: IndexedPoint) => { - const neighborIndex = neighbor.index; - const neighborPoint = points.features[neighborIndex]; - const distanceInKm = distance(point, neighborPoint, { - units: "kilometers", - }); - return distanceInKm <= maxDistance; - }) as IndexedPoint[]; + return (tree.search(bbox) as ReadonlyArray).filter( + (neighbor) => { + const neighborIndex = neighbor.index; + const neighborPoint = points.features[neighborIndex]; + const distanceInKm = distance(point, neighborPoint, { + units: "kilometers", + }); + return distanceInKm <= maxDistance; + } + ); }; // Function to expand a cluster diff --git a/packages/turf-clusters-kmeans/README.md b/packages/turf-clusters-kmeans/README.md index fe77503c88..3d29df8124 100644 --- a/packages/turf-clusters-kmeans/README.md +++ b/packages/turf-clusters-kmeans/README.md @@ -9,11 +9,11 @@ It uses the [k-means algorithm][2] ### Parameters -* `points` **[FeatureCollection][3]<[Point][1]>** to be clustered -* `options` **[Object][4]** Optional parameters (optional, default `{}`) +* `points` **[FeatureCollection][3]<[Point][4]>** to be clustered +* `options` **[Object][5]** Optional parameters (optional, default `{}`) - * `options.numberOfClusters` **[number][5]** numberOfClusters that will be generated (optional, default `Math.sqrt(numberOfPoints/2)`) - * `options.mutate` **[boolean][6]** allows GeoJSON input to be mutated (significant performance increase if true) (optional, default `false`) + * `options.numberOfClusters` **[number][6]** numberOfClusters that will be generated (optional, default `Math.sqrt(numberOfPoints/2)`) + * `options.mutate` **[boolean][7]** allows GeoJSON input to be mutated (significant performance increase if true) (optional, default `false`) ### Examples @@ -27,7 +27,7 @@ var clustered = turf.clustersKmeans(points, options); var addToMap = [clustered]; ``` -Returns **[FeatureCollection][3]<[Point][1]>** Clustered Points with an additional two properties associated to each Feature:* {number} cluster - the associated clusterId +Returns **[FeatureCollection][3]<[Point][4]>** Clustered Points with an additional two properties associated to each Feature:* {number} cluster - the associated clusterId * {\[number, number]} centroid - Centroid of the cluster \[Longitude, Latitude] [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -36,11 +36,13 @@ Returns **[FeatureCollection][3]<[Point][1]>** Clustered Points with an addition [3]: https://tools.ietf.org/html/rfc7946#section-3.3 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number + +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean diff --git a/packages/turf-clusters/README.md b/packages/turf-clusters/README.md index 51531ab0fe..7a82242646 100644 --- a/packages/turf-clusters/README.md +++ b/packages/turf-clusters/README.md @@ -50,7 +50,7 @@ Type: [Function][2] * `clusterValue` **any?** Value used to create cluster being processed. * `currentIndex` **[number][3]?** The index of the current element being processed in the array.Starts at index 0 -Returns **void** +Returns **void** ## clusterEach @@ -96,7 +96,7 @@ turf.clusterEach(clustered, 'cluster', function (cluster, clusterValue) { }); ``` -Returns **void** +Returns **void** ## clusterReduceCallback diff --git a/packages/turf-combine/README.md b/packages/turf-combine/README.md index 1c530e47de..604d5c183f 100644 --- a/packages/turf-combine/README.md +++ b/packages/turf-combine/README.md @@ -9,7 +9,7 @@ into [MultiPoint][5], [MultiLineString][6], or [MultiPolygon][7] features. ### Parameters -* `fc` **[FeatureCollection][1]<([Point][2] | [LineString][3] | [Polygon][4])>** a FeatureCollection of any type +* `fc` **[FeatureCollection][8]<([Point][9] | [LineString][10] | [Polygon][11])>** a FeatureCollection of any type ### Examples @@ -25,7 +25,7 @@ var combined = turf.combine(fc); var addToMap = [combined] ``` -Returns **[FeatureCollection][1]<([MultiPoint][5] | [MultiLineString][6] | [MultiPolygon][7])>** a FeatureCollection of corresponding type to input +Returns **[FeatureCollection][8]<([MultiPoint][12] | [MultiLineString][13] | [MultiPolygon][14])>** a FeatureCollection of corresponding type to input [1]: https://tools.ietf.org/html/rfc7946#section-3.3 @@ -41,6 +41,20 @@ Returns **[FeatureCollection][1]<([MultiPoint][5] | [MultiLineString][6] | [Mult [7]: https://tools.ietf.org/html/rfc7946#section-3.1.7 +[8]: https://tools.ietf.org/html/rfc7946#section-3.3 + +[9]: https://tools.ietf.org/html/rfc7946#section-3.1.2 + +[10]: https://tools.ietf.org/html/rfc7946#section-3.1.4 + +[11]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + +[12]: https://tools.ietf.org/html/rfc7946#section-3.1.3 + +[13]: https://tools.ietf.org/html/rfc7946#section-3.1.5 + +[14]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + --- diff --git a/packages/turf-concave/README.md b/packages/turf-concave/README.md index eb903ad4cc..bd47b3b608 100644 --- a/packages/turf-concave/README.md +++ b/packages/turf-concave/README.md @@ -9,12 +9,12 @@ Internally, this uses [turf-tin][2] to generate geometries. ### Parameters -* `points` **[FeatureCollection][3]<[Point][1]>** input points -* `options` **[Object][4]** Optional parameters (optional, default `{}`) +* `points` **[FeatureCollection][3]<[Point][4]>** input points +* `options` **[Object][5]** Optional parameters (optional, default `{}`) - * `options.maxEdge` **[number][5]** the length (in 'units') of an edge necessary for part of the + * `options.maxEdge` **[number][6]** the length (in 'units') of an edge necessary for part of the hull to become concave. (optional, default `Infinity`) - * `options.units` **[string][6]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) + * `options.units` **[string][7]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) ### Examples @@ -35,7 +35,7 @@ var hull = turf.concave(points, options); var addToMap = [points, hull] ``` -Returns **([Feature][7]<([Polygon][8] | [MultiPolygon][9])> | null)** a concave hull (null value is returned if unable to compute hull) +Returns **([Feature][8]<([Polygon][9] | [MultiPolygon][10])> | null)** a concave hull (null value is returned if unable to compute hull) [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -43,17 +43,19 @@ Returns **([Feature][7]<([Polygon][8] | [MultiPolygon][9])> | null)** a concave [3]: https://tools.ietf.org/html/rfc7946#section-3.3 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[7]: https://tools.ietf.org/html/rfc7946#section-3.2 +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[8]: https://tools.ietf.org/html/rfc7946#section-3.1.6 +[8]: https://tools.ietf.org/html/rfc7946#section-3.2 -[9]: https://tools.ietf.org/html/rfc7946#section-3.1.7 +[9]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + +[10]: https://tools.ietf.org/html/rfc7946#section-3.1.7 diff --git a/packages/turf-convex/README.md b/packages/turf-convex/README.md index bf8763bf79..a359457ef1 100644 --- a/packages/turf-convex/README.md +++ b/packages/turf-convex/README.md @@ -36,7 +36,7 @@ var hull = turf.convex(points); var addToMap = [points, hull] ``` -Returns **[Feature][1]<[Polygon][3]>** a convex hull +Returns **[Feature][9]<[Polygon][10]>** a convex hull [1]: https://tools.ietf.org/html/rfc7946#section-3.2 @@ -54,6 +54,10 @@ Returns **[Feature][1]<[Polygon][3]>** a convex hull [8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[9]: https://tools.ietf.org/html/rfc7946#section-3.2 + +[10]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + --- diff --git a/packages/turf-destination/README.md b/packages/turf-destination/README.md index c2f0f5880d..17221156a0 100644 --- a/packages/turf-destination/README.md +++ b/packages/turf-destination/README.md @@ -34,7 +34,7 @@ destination.properties['marker-color'] = '#f00'; point.properties['marker-color'] = '#0f0'; ``` -Returns **[Feature][7]<[Point][1]>** destination point +Returns **[Feature][7]<[Point][8]>** destination point [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -50,6 +50,8 @@ Returns **[Feature][7]<[Point][1]>** destination point [7]: https://tools.ietf.org/html/rfc7946#section-3.2 +[8]: https://tools.ietf.org/html/rfc7946#section-3.1.2 + --- diff --git a/packages/turf-difference/README.md b/packages/turf-difference/README.md index 4659b157fc..b9f2a70aa1 100644 --- a/packages/turf-difference/README.md +++ b/packages/turf-difference/README.md @@ -8,7 +8,7 @@ Finds the difference between multiple [polygons][1] by clipping the subsequent p ### Parameters -* `features` **[FeatureCollection][2]<([Polygon][1] | [MultiPolygon][3])>** input Polygon features +* `features` **[FeatureCollection][2]<([Polygon][3] | [MultiPolygon][4])>** input Polygon features ### Examples @@ -40,15 +40,17 @@ var difference = turf.difference(turf.featureCollection([polygon1, polygon2])); var addToMap = [polygon1, polygon2, difference]; ``` -Returns **([Feature][4]<([Polygon][1] | [MultiPolygon][3])> | null)** a Polygon or MultiPolygon feature showing the area of `polygon1` excluding the area of `polygon2` (if empty returns `null`) +Returns **([Feature][5]<([Polygon][3] | [MultiPolygon][4])> | null)** a Polygon or MultiPolygon feature showing the area of `polygon1` excluding the area of `polygon2` (if empty returns `null`) [1]: https://tools.ietf.org/html/rfc7946#section-3.1.6 [2]: https://tools.ietf.org/html/rfc7946#section-3.3 -[3]: https://tools.ietf.org/html/rfc7946#section-3.1.7 +[3]: https://tools.ietf.org/html/rfc7946#section-3.1.6 -[4]: https://tools.ietf.org/html/rfc7946#section-3.2 +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + +[5]: https://tools.ietf.org/html/rfc7946#section-3.2 diff --git a/packages/turf-directional-mean/README.md b/packages/turf-directional-mean/README.md index f509e3d3eb..8870687cf6 100644 --- a/packages/turf-directional-mean/README.md +++ b/packages/turf-directional-mean/README.md @@ -25,7 +25,7 @@ It can handle segments of line or the whole line. ### Parameters -* `lines` **[FeatureCollection][3]<[LineString][4]>** +* `lines` **[FeatureCollection][3]<[LineString][4]>** * `options` **[object][1]** (optional, default `{}`) * `options.planar` **[boolean][5]** whether the spatial reference system is projected or geographical. (optional, default `true`) diff --git a/packages/turf-distance-weight/README.md b/packages/turf-distance-weight/README.md index 10325b385c..ea93a5b0fd 100644 --- a/packages/turf-distance-weight/README.md +++ b/packages/turf-distance-weight/README.md @@ -12,7 +12,7 @@ calcualte the Minkowski p-norm distance between two features. * `feature2` **[Feature][1]<[Point][2]>** point feature * `p` p-norm 1=\ diff --git a/packages/turf-ellipse/README.md b/packages/turf-ellipse/README.md index 7a013993f0..cb49376e9c 100644 --- a/packages/turf-ellipse/README.md +++ b/packages/turf-ellipse/README.md @@ -14,7 +14,7 @@ Takes a [Point][1] and calculates the ellipse polygon given two semi-axes expres * `options` **[Object][4]** Optional parameters (optional, default `{}`) * `options.angle` **[number][3]** angle of rotation in decimal degrees, positive clockwise (optional, default `0`) - * `options.pivot` **[Coord][2]** point around which the rotation will be performed (optional, default `'origin'`) + * `options.pivot` **[Coord][2]** point around which any rotation will be performed (optional, default `center`) * `options.steps` **[number][3]** number of steps (optional, default `64`) * `options.units` **[string][5]** unit of measurement for axes (optional, default `'kilometers'`) * `options.properties` **[Object][4]** properties (optional, default `{}`) diff --git a/packages/turf-envelope/README.md b/packages/turf-envelope/README.md index 26e0628ead..60cb055dfb 100644 --- a/packages/turf-envelope/README.md +++ b/packages/turf-envelope/README.md @@ -25,7 +25,7 @@ var enveloped = turf.envelope(features); var addToMap = [features, enveloped]; ``` -Returns **[Feature][3]<[Polygon][1]>** a rectangular Polygon feature that encompasses all vertices +Returns **[Feature][3]<[Polygon][4]>** a rectangular Polygon feature that encompasses all vertices [1]: https://tools.ietf.org/html/rfc7946#section-3.1.6 @@ -33,6 +33,8 @@ Returns **[Feature][3]<[Polygon][1]>** a rectangular Polygon feature that encomp [3]: https://tools.ietf.org/html/rfc7946#section-3.2 +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + --- diff --git a/packages/turf-flatten/README.md b/packages/turf-flatten/README.md index 9f7195ff1c..bdf62b41dc 100644 --- a/packages/turf-flatten/README.md +++ b/packages/turf-flatten/README.md @@ -8,7 +8,7 @@ Flattens any [GeoJSON][1] to a [FeatureCollection][2] inspired by [geojson-flatt ### Parameters -* `geojson` **[GeoJSON][1]** any valid GeoJSON Object +* `geojson` **[GeoJSON][4]** any valid GeoJSON Object ### Examples @@ -25,7 +25,7 @@ var flatten = turf.flatten(multiGeometry); var addToMap = [flatten] ``` -Returns **[FeatureCollection][2]\** all Multi-Geometries are flattened into single Features +Returns **[FeatureCollection][5]\** all Multi-Geometries are flattened into single Features [1]: https://tools.ietf.org/html/rfc7946#section-3 @@ -33,6 +33,10 @@ Returns **[FeatureCollection][2]\** all Multi-Geometries are flattened into [3]: https://github.com/tmcw/geojson-flatten +[4]: https://tools.ietf.org/html/rfc7946#section-3 + +[5]: https://tools.ietf.org/html/rfc7946#section-3.3 + --- diff --git a/packages/turf-geojson-rbush/README.md b/packages/turf-geojson-rbush/README.md index 2c843d9289..26c96972a0 100644 --- a/packages/turf-geojson-rbush/README.md +++ b/packages/turf-geojson-rbush/README.md @@ -1,44 +1,182 @@ -# GeoJSON RBush used in TurfJS +# @turf/geojson-rbush -[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/DenisCarriere/geojson-rbush/master/LICENSE) + + +## rbush + +### insert + +[insert][1] -GeoJSON implementation of [RBush](https://github.com/mourner/rbush) — a high-performance JavaScript R-tree-based 2D spatial index for points and rectangles. +#### Parameters -## Install +* `feature` **[Feature][2]** insert single GeoJSON Feature -**npm** +#### Examples -```bash -$ npm install --save geojson-rbush +```javascript +var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]); +tree.insert(poly) ``` -## API +Returns **RBush** GeoJSON RBush - +### load + +[load][3] + +#### Parameters + +* `features` **([FeatureCollection][4] | [Array][5]<[Feature][2]>)** load entire GeoJSON FeatureCollection + +#### Examples + +```javascript +var polys = turf.polygons([ + [[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]], + [[[-93, 32], [-83, 32], [-83, 39], [-93, 39], [-93, 32]]] +]); +tree.load(polys); +``` + +Returns **RBush** GeoJSON RBush + +### remove + +[remove][6] + +#### Parameters + +* `feature` **[Feature][2]** remove single GeoJSON Feature +* `equals` **[Function][7]** Pass a custom equals function to compare by value for removal. + +#### Examples + +```javascript +var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]); + +tree.remove(poly); +``` -#### Table of Contents +Returns **RBush** GeoJSON RBush + +### clear + +[clear][6] + +#### Examples -- [rbush](#rbush) -- [insert](#insert) -- [load](#load) -- [remove](#remove) -- [clear](#clear) -- [search](#search) -- [collides](#collides) -- [all](#all) -- [toJSON](#tojson) -- [fromJSON](#fromjson) +```javascript +tree.clear() +``` + +Returns **RBush** GeoJSON Rbush + +### search + +[search][8] + +#### Parameters + +* `geojson` **([BBox][9] | [FeatureCollection][4] | [Feature][2])** search with GeoJSON + +#### Examples + +```javascript +var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]); -### rbush +tree.search(poly); +``` + +Returns **[FeatureCollection][4]** all features that intersects with the given GeoJSON. + +### collides + +[collides][10] + +#### Parameters + +* `geojson` **([BBox][9] | [FeatureCollection][4] | [Feature][2])** collides with GeoJSON + +#### Examples + +```javascript +var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]); + +tree.collides(poly); +``` + +Returns **[boolean][11]** true if there are any items intersecting the given GeoJSON, otherwise false. + +### all -GeoJSON implementation of [RBush](https://github.com/mourner/rbush#rbush) spatial index. +[all][8] -**Parameters** +#### Examples -- `maxEntries` **[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** defines the maximum number of entries in a tree node. 9 (used by default) is a +```javascript +tree.all() +``` + +Returns **[FeatureCollection][4]** all the features in RBush + +### toJSON + +[toJSON][12] + +#### Examples + +```javascript +var exported = tree.toJSON() +``` + +Returns **any** export data as JSON object + +### fromJSON + +[fromJSON][12] + +#### Parameters + +* `json` **any** import previously exported data + +#### Examples + +```javascript +var exported = { + "children": [ + { + "type": "Feature", + "geometry": { + "type": "Point", + "coordinates": [110, 50] + }, + "properties": {}, + "bbox": [110, 50, 110, 50] + } + ], + "height": 1, + "leaf": true, + "minX": 110, + "minY": 50, + "maxX": 110, + "maxY": 50 +} +tree.fromJSON(exported) +``` + +Returns **RBush** GeoJSON RBush + +## rbush + +GeoJSON implementation of [RBush][13] spatial index. + +### Parameters + +* `maxEntries` **[number][14]** defines the maximum number of entries in a tree node. 9 (used by default) is a reasonable choice for most applications. Higher value means faster insertion and slower search, and vice versa. (optional, default `9`) -**Examples** +### Examples ```javascript var geojsonRbush = require('geojson-rbush').default; @@ -49,13 +187,13 @@ Returns **RBush** GeoJSON RBush ### insert -[insert](https://github.com/mourner/rbush#data-format) +[insert][1] -**Parameters** +#### Parameters -- `feature` **Feature** insert single GeoJSON Feature +* `feature` **[Feature][2]** insert single GeoJSON Feature -**Examples** +#### Examples ```javascript var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]); @@ -66,13 +204,13 @@ Returns **RBush** GeoJSON RBush ### load -[load](https://github.com/mourner/rbush#bulk-inserting-data) +[load][3] -**Parameters** +#### Parameters -- `features` **(FeatureCollection | [Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<Feature>)** load entire GeoJSON FeatureCollection +* `features` **([FeatureCollection][4] | [Array][5]<[Feature][2]>)** load entire GeoJSON FeatureCollection -**Examples** +#### Examples ```javascript var polys = turf.polygons([ @@ -86,14 +224,14 @@ Returns **RBush** GeoJSON RBush ### remove -[remove](https://github.com/mourner/rbush#removing-data) +[remove][6] -**Parameters** +#### Parameters -- `feature` **Feature** remove single GeoJSON Feature -- `equals` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)** Pass a custom equals function to compare by value for removal. +* `feature` **[Feature][2]** remove single GeoJSON Feature +* `equals` **[Function][7]** Pass a custom equals function to compare by value for removal. -**Examples** +#### Examples ```javascript var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]); @@ -105,9 +243,9 @@ Returns **RBush** GeoJSON RBush ### clear -[clear](https://github.com/mourner/rbush#removing-data) +[clear][6] -**Examples** +#### Examples ```javascript tree.clear() @@ -117,13 +255,13 @@ Returns **RBush** GeoJSON Rbush ### search -[search](https://github.com/mourner/rbush#search) +[search][8] -**Parameters** +#### Parameters -- `geojson` **(BBox | FeatureCollection | Feature)** search with GeoJSON +* `geojson` **([BBox][9] | [FeatureCollection][4] | [Feature][2])** search with GeoJSON -**Examples** +#### Examples ```javascript var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]); @@ -131,17 +269,17 @@ var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]] tree.search(poly); ``` -Returns **FeatureCollection** all features that intersects with the given GeoJSON. +Returns **[FeatureCollection][4]** all features that intersects with the given GeoJSON. ### collides -[collides](https://github.com/mourner/rbush#collisions) +[collides][10] -**Parameters** +#### Parameters -- `geojson` **(BBox | FeatureCollection | Feature)** collides with GeoJSON +* `geojson` **([BBox][9] | [FeatureCollection][4] | [Feature][2])** collides with GeoJSON -**Examples** +#### Examples ```javascript var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]]]); @@ -149,25 +287,25 @@ var poly = turf.polygon([[[-78, 41], [-67, 41], [-67, 48], [-78, 48], [-78, 41]] tree.collides(poly); ``` -Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if there are any items intersecting the given GeoJSON, otherwise false. +Returns **[boolean][11]** true if there are any items intersecting the given GeoJSON, otherwise false. ### all -[all](https://github.com/mourner/rbush#search) +[all][8] -**Examples** +#### Examples ```javascript tree.all() ``` -Returns **FeatureCollection** all the features in RBush +Returns **[FeatureCollection][4]** all the features in RBush ### toJSON -[toJSON](https://github.com/mourner/rbush#export-and-import) +[toJSON][12] -**Examples** +#### Examples ```javascript var exported = tree.toJSON() @@ -177,13 +315,13 @@ Returns **any** export data as JSON object ### fromJSON -[fromJSON](https://github.com/mourner/rbush#export-and-import) +[fromJSON][12] -**Parameters** +#### Parameters -- `json` **any** import previously exported data +* `json` **any** import previously exported data -**Examples** +#### Examples ```javascript var exported = { @@ -209,3 +347,51 @@ tree.fromJSON(exported) ``` Returns **RBush** GeoJSON RBush + +[1]: https://github.com/mourner/rbush#data-format + +[2]: https://tools.ietf.org/html/rfc7946#section-3.2 + +[3]: https://github.com/mourner/rbush#bulk-inserting-data + +[4]: https://tools.ietf.org/html/rfc7946#section-3.3 + +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array + +[6]: https://github.com/mourner/rbush#removing-data + +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function + +[8]: https://github.com/mourner/rbush#search + +[9]: https://tools.ietf.org/html/rfc7946#section-5 + +[10]: https://github.com/mourner/rbush#collisions + +[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean + +[12]: https://github.com/mourner/rbush#export-and-import + +[13]: https://github.com/mourner/rbush#rbush + +[14]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number + + + +--- + +This module is part of the [Turfjs project](https://turfjs.org/), an open source module collection dedicated to geographic algorithms. It is maintained in the [Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create PRs and issues. + +### Installation + +Install this single module individually: + +```sh +$ npm install @turf/geojson-rbush +``` + +Or install the all-encompassing @turf/turf module that includes all modules as functions: + +```sh +$ npm install @turf/turf +``` diff --git a/packages/turf-great-circle/README.md b/packages/turf-great-circle/README.md index 8703e2577b..221bf2ad9a 100644 --- a/packages/turf-great-circle/README.md +++ b/packages/turf-great-circle/README.md @@ -31,7 +31,7 @@ var greatCircle = turf.greatCircle(start, end, {properties: {name: 'Seattle to D var addToMap = [start, end, greatCircle] ``` -Returns **[Feature][6]<([LineString][1] | [MultiLineString][2])>** great circle line feature +Returns **[Feature][6]<([LineString][7] | [MultiLineString][8])>** great circle line feature [1]: https://tools.ietf.org/html/rfc7946#section-3.1.4 @@ -45,6 +45,10 @@ Returns **[Feature][6]<([LineString][1] | [MultiLineString][2])>** great circle [6]: https://tools.ietf.org/html/rfc7946#section-3.2 +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.4 + +[8]: https://tools.ietf.org/html/rfc7946#section-3.1.5 + --- diff --git a/packages/turf-helpers/README.md b/packages/turf-helpers/README.md index abd0a5d82b..729530d7f4 100644 --- a/packages/turf-helpers/README.md +++ b/packages/turf-helpers/README.md @@ -30,12 +30,12 @@ Wraps a GeoJSON [Geometry][3] in a GeoJSON [Feature][4]. ### Parameters -* `geometry` **[Geometry][3]** input geometry +* `geometry` **[Geometry][5]** input geometry * `properties` **[Object][2]** an Object of key-value pairs to add as properties (optional, default `{}`) * `options` **[Object][2]** Optional Parameters (optional, default `{}`) - * `options.bbox` **[Array][5]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature - * `options.id` **([string][6] | [number][1])?** Identifier associated with the Feature + * `options.bbox` **[Array][6]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature + * `options.id` **([string][7] | [number][1])?** Identifier associated with the Feature ### Examples @@ -50,7 +50,7 @@ var feature = turf.feature(geometry); //=feature ``` -Returns **[Feature][4]** a GeoJSON Feature +Returns **[Feature][8]** a GeoJSON Feature ## geometry @@ -59,8 +59,8 @@ For GeometryCollection type use `helpers.geometryCollection` ### Parameters -* `type` **[string][6]** Geometry Type -* `coordinates` **[Array][5]\** Coordinates +* `type` **[string][7]** Geometry Type +* `coordinates` **[Array][6]\** Coordinates * `options` **[Object][2]** Optional Parameters (optional, default `{}`) ### Examples @@ -72,20 +72,20 @@ var geometry = turf.geometry(type, coordinates); // => geometry ``` -Returns **[Geometry][3]** a GeoJSON Geometry +Returns **[Geometry][5]** a GeoJSON Geometry ## point -Creates a [Point][7] [Feature][4] from a Position. +Creates a [Point][9] [Feature][4] from a Position. ### Parameters -* `coordinates` **[Array][5]<[number][1]>** longitude, latitude position (each in decimal degrees) +* `coordinates` **[Array][6]<[number][1]>** longitude, latitude position (each in decimal degrees) * `properties` **[Object][2]** an Object of key-value pairs to add as properties (optional, default `{}`) * `options` **[Object][2]** Optional Parameters (optional, default `{}`) - * `options.bbox` **[Array][5]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature - * `options.id` **([string][6] | [number][1])?** Identifier associated with the Feature + * `options.bbox` **[Array][6]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature + * `options.id` **([string][7] | [number][1])?** Identifier associated with the Feature ### Examples @@ -95,21 +95,21 @@ var point = turf.point([-75.343, 39.984]); //=point ``` -Returns **[Feature][4]<[Point][7]>** a Point feature +Returns **[Feature][8]<[Point][10]>** a Point feature ## points -Creates a [Point][7] [FeatureCollection][8] from an Array of Point coordinates. +Creates a [Point][9] [FeatureCollection][11] from an Array of Point coordinates. ### Parameters -* `coordinates` **[Array][5]<[Array][5]<[number][1]>>** an array of Points +* `coordinates` **[Array][6]<[Array][6]<[number][1]>>** an array of Points * `properties` **[Object][2]** Translate these properties to each Feature (optional, default `{}`) * `options` **[Object][2]** Optional Parameters (optional, default `{}`) - * `options.bbox` **[Array][5]<[number][1]>?** Bounding Box Array \[west, south, east, north] + * `options.bbox` **[Array][6]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the FeatureCollection - * `options.id` **([string][6] | [number][1])?** Identifier associated with the FeatureCollection + * `options.id` **([string][7] | [number][1])?** Identifier associated with the FeatureCollection ### Examples @@ -123,20 +123,20 @@ var points = turf.points([ //=points ``` -Returns **[FeatureCollection][8]<[Point][7]>** Point Feature +Returns **[FeatureCollection][12]<[Point][10]>** Point Feature ## polygon -Creates a [Polygon][9] [Feature][4] from an Array of LinearRings. +Creates a [Polygon][13] [Feature][4] from an Array of LinearRings. ### Parameters -* `coordinates` **[Array][5]<[Array][5]<[Array][5]<[number][1]>>>** an array of LinearRings +* `coordinates` **[Array][6]<[Array][6]<[Array][6]<[number][1]>>>** an array of LinearRings * `properties` **[Object][2]** an Object of key-value pairs to add as properties (optional, default `{}`) * `options` **[Object][2]** Optional Parameters (optional, default `{}`) - * `options.bbox` **[Array][5]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature - * `options.id` **([string][6] | [number][1])?** Identifier associated with the Feature + * `options.bbox` **[Array][6]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature + * `options.id` **([string][7] | [number][1])?** Identifier associated with the Feature ### Examples @@ -146,20 +146,20 @@ var polygon = turf.polygon([[[-5, 52], [-4, 56], [-2, 51], [-7, 54], [-5, 52]]], //=polygon ``` -Returns **[Feature][4]<[Polygon][9]>** Polygon Feature +Returns **[Feature][8]<[Polygon][14]>** Polygon Feature ## polygons -Creates a [Polygon][9] [FeatureCollection][8] from an Array of Polygon coordinates. +Creates a [Polygon][13] [FeatureCollection][11] from an Array of Polygon coordinates. ### Parameters -* `coordinates` **[Array][5]<[Array][5]<[Array][5]<[Array][5]<[number][1]>>>>** an array of Polygon coordinates +* `coordinates` **[Array][6]<[Array][6]<[Array][6]<[Array][6]<[number][1]>>>>** an array of Polygon coordinates * `properties` **[Object][2]** an Object of key-value pairs to add as properties (optional, default `{}`) * `options` **[Object][2]** Optional Parameters (optional, default `{}`) - * `options.bbox` **[Array][5]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature - * `options.id` **([string][6] | [number][1])?** Identifier associated with the FeatureCollection + * `options.bbox` **[Array][6]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature + * `options.id` **([string][7] | [number][1])?** Identifier associated with the FeatureCollection ### Examples @@ -172,20 +172,20 @@ var polygons = turf.polygons([ //=polygons ``` -Returns **[FeatureCollection][8]<[Polygon][9]>** Polygon FeatureCollection +Returns **[FeatureCollection][12]<[Polygon][14]>** Polygon FeatureCollection ## lineString -Creates a [LineString][10] [Feature][4] from an Array of Positions. +Creates a [LineString][15] [Feature][4] from an Array of Positions. ### Parameters -* `coordinates` **[Array][5]<[Array][5]<[number][1]>>** an array of Positions +* `coordinates` **[Array][6]<[Array][6]<[number][1]>>** an array of Positions * `properties` **[Object][2]** an Object of key-value pairs to add as properties (optional, default `{}`) * `options` **[Object][2]** Optional Parameters (optional, default `{}`) - * `options.bbox` **[Array][5]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature - * `options.id` **([string][6] | [number][1])?** Identifier associated with the Feature + * `options.bbox` **[Array][6]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature + * `options.id` **([string][7] | [number][1])?** Identifier associated with the Feature ### Examples @@ -197,21 +197,21 @@ var linestring2 = turf.lineString([[-14, 43], [-13, 40], [-15, 45], [-10, 49]], //=linestring2 ``` -Returns **[Feature][4]<[LineString][10]>** LineString Feature +Returns **[Feature][8]<[LineString][16]>** LineString Feature ## lineStrings -Creates a [LineString][10] [FeatureCollection][8] from an Array of LineString coordinates. +Creates a [LineString][15] [FeatureCollection][11] from an Array of LineString coordinates. ### Parameters -* `coordinates` **[Array][5]<[Array][5]<[Array][5]<[number][1]>>>** an array of LinearRings +* `coordinates` **[Array][6]<[Array][6]<[Array][6]<[number][1]>>>** an array of LinearRings * `properties` **[Object][2]** an Object of key-value pairs to add as properties (optional, default `{}`) * `options` **[Object][2]** Optional Parameters (optional, default `{}`) - * `options.bbox` **[Array][5]<[number][1]>?** Bounding Box Array \[west, south, east, north] + * `options.bbox` **[Array][6]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the FeatureCollection - * `options.id` **([string][6] | [number][1])?** Identifier associated with the FeatureCollection + * `options.id` **([string][7] | [number][1])?** Identifier associated with the FeatureCollection ### Examples @@ -224,19 +224,19 @@ var linestrings = turf.lineStrings([ //=linestrings ``` -Returns **[FeatureCollection][8]<[LineString][10]>** LineString FeatureCollection +Returns **[FeatureCollection][12]<[LineString][16]>** LineString FeatureCollection ## featureCollection -Takes one or more [Features][4] and creates a [FeatureCollection][8]. +Takes one or more [Features][4] and creates a [FeatureCollection][11]. ### Parameters -* `features` **[Array][5]<[Feature][4]>** input features +* `features` **[Array][6]<[Feature][8]>** input features * `options` **[Object][2]** Optional Parameters (optional, default `{}`) - * `options.bbox` **[Array][5]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature - * `options.id` **([string][6] | [number][1])?** Identifier associated with the Feature + * `options.bbox` **[Array][6]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature + * `options.id` **([string][7] | [number][1])?** Identifier associated with the Feature ### Examples @@ -254,21 +254,21 @@ var collection = turf.featureCollection([ //=collection ``` -Returns **[FeatureCollection][8]** FeatureCollection of Features +Returns **[FeatureCollection][12]** FeatureCollection of Features ## multiLineString -Creates a [Feature\][11] based on a +Creates a [Feature\][17] based on a coordinate array. Properties can be added optionally. ### Parameters -* `coordinates` **[Array][5]<[Array][5]<[Array][5]<[number][1]>>>** an array of LineStrings +* `coordinates` **[Array][6]<[Array][6]<[Array][6]<[number][1]>>>** an array of LineStrings * `properties` **[Object][2]** an Object of key-value pairs to add as properties (optional, default `{}`) * `options` **[Object][2]** Optional Parameters (optional, default `{}`) - * `options.bbox` **[Array][5]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature - * `options.id` **([string][6] | [number][1])?** Identifier associated with the Feature + * `options.bbox` **[Array][6]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature + * `options.id` **([string][7] | [number][1])?** Identifier associated with the Feature ### Examples @@ -278,23 +278,23 @@ var multiLine = turf.multiLineString([[[0,0],[10,10]]]); //=multiLine ``` -* Throws **[Error][12]** if no coordinates are passed +* Throws **[Error][18]** if no coordinates are passed -Returns **[Feature][4]<[MultiLineString][13]>** a MultiLineString feature +Returns **[Feature][8]<[MultiLineString][19]>** a MultiLineString feature ## multiPoint -Creates a [Feature\][14] based on a +Creates a [Feature\][20] based on a coordinate array. Properties can be added optionally. ### Parameters -* `coordinates` **[Array][5]<[Array][5]<[number][1]>>** an array of Positions +* `coordinates` **[Array][6]<[Array][6]<[number][1]>>** an array of Positions * `properties` **[Object][2]** an Object of key-value pairs to add as properties (optional, default `{}`) * `options` **[Object][2]** Optional Parameters (optional, default `{}`) - * `options.bbox` **[Array][5]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature - * `options.id` **([string][6] | [number][1])?** Identifier associated with the Feature + * `options.bbox` **[Array][6]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature + * `options.id` **([string][7] | [number][1])?** Identifier associated with the Feature ### Examples @@ -304,23 +304,23 @@ var multiPt = turf.multiPoint([[0,0],[10,10]]); //=multiPt ``` -* Throws **[Error][12]** if no coordinates are passed +* Throws **[Error][18]** if no coordinates are passed -Returns **[Feature][4]<[MultiPoint][15]>** a MultiPoint feature +Returns **[Feature][8]<[MultiPoint][21]>** a MultiPoint feature ## multiPolygon -Creates a [Feature\][16] based on a +Creates a [Feature\][22] based on a coordinate array. Properties can be added optionally. ### Parameters -* `coordinates` **[Array][5]<[Array][5]<[Array][5]<[Array][5]<[number][1]>>>>** an array of Polygons +* `coordinates` **[Array][6]<[Array][6]<[Array][6]<[Array][6]<[number][1]>>>>** an array of Polygons * `properties` **[Object][2]** an Object of key-value pairs to add as properties (optional, default `{}`) * `options` **[Object][2]** Optional Parameters (optional, default `{}`) - * `options.bbox` **[Array][5]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature - * `options.id` **([string][6] | [number][1])?** Identifier associated with the Feature + * `options.bbox` **[Array][6]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature + * `options.id` **([string][7] | [number][1])?** Identifier associated with the Feature ### Examples @@ -330,23 +330,23 @@ var multiPoly = turf.multiPolygon([[[[0,0],[0,10],[10,10],[10,0],[0,0]]]]); //=multiPoly ``` -* Throws **[Error][12]** if no coordinates are passed +* Throws **[Error][18]** if no coordinates are passed -Returns **[Feature][4]<[MultiPolygon][17]>** a multipolygon feature +Returns **[Feature][8]<[MultiPolygon][23]>** a multipolygon feature ## geometryCollection -Creates a [Feature\][18] based on a +Creates a [Feature\][24] based on a coordinate array. Properties can be added optionally. ### Parameters -* `geometries` **[Array][5]<[Geometry][3]>** an array of GeoJSON Geometries +* `geometries` **[Array][6]<[Geometry][5]>** an array of GeoJSON Geometries * `properties` **[Object][2]** an Object of key-value pairs to add as properties (optional, default `{}`) * `options` **[Object][2]** Optional Parameters (optional, default `{}`) - * `options.bbox` **[Array][5]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature - * `options.id` **([string][6] | [number][1])?** Identifier associated with the Feature + * `options.bbox` **[Array][6]<[number][1]>?** Bounding Box Array \[west, south, east, north] associated with the Feature + * `options.id` **([string][7] | [number][1])?** Identifier associated with the Feature ### Examples @@ -358,7 +358,7 @@ var collection = turf.geometryCollection([pt, line]); // => collection ``` -Returns **[Feature][4]<[GeometryCollection][19]>** a GeoJSON GeometryCollection Feature +Returns **[Feature][8]<[GeometryCollection][25]>** a GeoJSON GeometryCollection Feature ## round @@ -389,7 +389,7 @@ Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, ce ### Parameters * `radians` **[number][1]** in radians across the sphere -* `units` **[string][6]** can be degrees, radians, miles, inches, yards, metres, +* `units` **[string][7]** can be degrees, radians, miles, inches, yards, metres, meters, kilometres, kilometers. (optional, default `"kilometers"`) Returns **[number][1]** distance @@ -402,7 +402,7 @@ Valid units: miles, nauticalmiles, inches, yards, meters, metres, kilometers, ce ### Parameters * `distance` **[number][1]** in real units -* `units` **[string][6]** can be degrees, radians, miles, inches, yards, metres, +* `units` **[string][7]** can be degrees, radians, miles, inches, yards, metres, meters, kilometres, kilometers. (optional, default `"kilometers"`) Returns **[number][1]** radians @@ -415,7 +415,7 @@ Valid units: miles, nauticalmiles, inches, yards, meters, metres, centimeters, k ### Parameters * `distance` **[number][1]** in real units -* `units` **[string][6]** can be degrees, radians, miles, inches, yards, metres, +* `units` **[string][7]** can be degrees, radians, miles, inches, yards, metres, meters, kilometres, kilometers. (optional, default `"kilometers"`) Returns **[number][1]** degrees @@ -494,7 +494,7 @@ turf.isNumber('foo') //=false ``` -Returns **[boolean][20]** true/false +Returns **[boolean][26]** true/false ## isObject @@ -513,7 +513,7 @@ turf.isObject('foo') //=false ``` -Returns **[boolean][20]** true/false, including false for Arrays and Functions +Returns **[boolean][26]** true/false, including false for Arrays and Functions [1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number @@ -523,37 +523,49 @@ Returns **[boolean][20]** true/false, including false for Arrays and Functions [4]: https://tools.ietf.org/html/rfc7946#section-3.2 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array +[5]: https://tools.ietf.org/html/rfc7946#section-3.1 -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array -[7]: https://tools.ietf.org/html/rfc7946#section-3.1.2 +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[8]: https://tools.ietf.org/html/rfc7946#section-3.3 +[8]: https://tools.ietf.org/html/rfc7946#section-3.2 -[9]: https://tools.ietf.org/html/rfc7946#section-3.1.6 +[9]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[10]: https://tools.ietf.org/html/rfc7946#section-3.1.4 +[10]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[11]: Feature +[11]: https://tools.ietf.org/html/rfc7946#section-3.3 -[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error +[12]: https://tools.ietf.org/html/rfc7946#section-3.3 -[13]: https://tools.ietf.org/html/rfc7946#section-3.1.5 +[13]: https://tools.ietf.org/html/rfc7946#section-3.1.6 -[14]: Feature +[14]: https://tools.ietf.org/html/rfc7946#section-3.1.6 -[15]: https://tools.ietf.org/html/rfc7946#section-3.1.3 +[15]: https://tools.ietf.org/html/rfc7946#section-3.1.4 -[16]: Feature +[16]: https://tools.ietf.org/html/rfc7946#section-3.1.4 -[17]: https://tools.ietf.org/html/rfc7946#section-3.1.7 +[17]: Feature -[18]: Feature +[18]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error -[19]: https://tools.ietf.org/html/rfc7946#section-3.1.8 +[19]: https://tools.ietf.org/html/rfc7946#section-3.1.5 -[20]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[20]: Feature + +[21]: https://tools.ietf.org/html/rfc7946#section-3.1.3 + +[22]: Feature + +[23]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + +[24]: Feature + +[25]: https://tools.ietf.org/html/rfc7946#section-3.1.8 + +[26]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean diff --git a/packages/turf-hex-grid/README.md b/packages/turf-hex-grid/README.md index c87c7a1c78..72bee83640 100644 --- a/packages/turf-hex-grid/README.md +++ b/packages/turf-hex-grid/README.md @@ -17,8 +17,8 @@ described in [Hexagonal Grids][3]. * `options.units` **[string][7]** used in calculating cell size, can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) * `options.properties` **[Object][6]** passed to each hexagon or triangle of the grid (optional, default `{}`) - * `options.mask` **[Feature][8]<[Polygon][2]>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it - * `options.triangles` **[boolean][9]** whether to return as triangles instead of hexagons (optional, default `false`) + * `options.mask` **[Feature][8]<[Polygon][9]>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it + * `options.triangles` **[boolean][10]** whether to return as triangles instead of hexagons (optional, default `false`) ### Examples @@ -33,7 +33,7 @@ var hexgrid = turf.hexGrid(bbox, cellSide, options); var addToMap = [hexgrid]; ``` -Returns **[FeatureCollection][1]<[Polygon][2]>** a hexagonal grid +Returns **[FeatureCollection][11]<[Polygon][9]>** a hexagonal grid [1]: https://tools.ietf.org/html/rfc7946#section-3.3 @@ -51,7 +51,11 @@ Returns **[FeatureCollection][1]<[Polygon][2]>** a hexagonal grid [8]: https://tools.ietf.org/html/rfc7946#section-3.2 -[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[9]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + +[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean + +[11]: https://tools.ietf.org/html/rfc7946#section-3.3 diff --git a/packages/turf-intersect/README.md b/packages/turf-intersect/README.md index cfbd2f83b7..e356efd3f2 100644 --- a/packages/turf-intersect/README.md +++ b/packages/turf-intersect/README.md @@ -9,10 +9,10 @@ finds their polygonal intersection. If they don't intersect, returns null. ### Parameters -* `features` **[FeatureCollection][3]<([Polygon][1] | [MultiPolygon][2])>** the features to intersect -* `options` **[Object][4]** Optional Parameters (optional, default `{}`) +* `features` **[FeatureCollection][3]<([Polygon][4] | [MultiPolygon][5])>** the features to intersect +* `options` **[Object][6]** Optional Parameters (optional, default `{}`) - * `options.properties` **[Object][4]** Translate GeoJSON Properties to Feature (optional, default `{}`) + * `options.properties` **[Object][6]** Translate GeoJSON Properties to Feature (optional, default `{}`) ### Examples @@ -42,7 +42,7 @@ var intersection = turf.intersect(turf.featureCollection([poly1, poly2])); var addToMap = [poly1, poly2, intersection]; ``` -Returns **([Feature][5] | null)** returns a feature representing the area they share (either a [Polygon][1] or +Returns **([Feature][7] | null)** returns a feature representing the area they share (either a [Polygon][1] or [MultiPolygon][2]). If they do not share any area, returns `null`. [1]: https://tools.ietf.org/html/rfc7946#section-3.1.6 @@ -51,9 +51,13 @@ Returns **([Feature][5] | null)** returns a feature representing the area they s [3]: https://tools.ietf.org/html/rfc7946#section-3.3 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.6 -[5]: https://tools.ietf.org/html/rfc7946#section-3.2 +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[7]: https://tools.ietf.org/html/rfc7946#section-3.2 diff --git a/packages/turf-invariant/README.md b/packages/turf-invariant/README.md index a885eebbb5..0b9becdbe6 100644 --- a/packages/turf-invariant/README.md +++ b/packages/turf-invariant/README.md @@ -66,8 +66,8 @@ Enforce expectations about types of GeoJSON objects for Turf. ## featureOf -Enforce expectations about types of [Feature][5] inputs for Turf. -Internally this uses [geojsonType][10] to judge geometry types. +Enforce expectations about types of [Feature][10] inputs for Turf. +Internally this uses [geojsonType][11] to judge geometry types. ### Parameters @@ -81,12 +81,12 @@ Internally this uses [geojsonType][10] to judge geometry types. ## collectionOf -Enforce expectations about types of [FeatureCollection][11] inputs for Turf. -Internally this uses [geojsonType][10] to judge geometry types. +Enforce expectations about types of [FeatureCollection][12] inputs for Turf. +Internally this uses [geojsonType][11] to judge geometry types. ### Parameters -* `featureCollection` **[FeatureCollection][11]** a FeatureCollection for which features will be judged +* `featureCollection` **[FeatureCollection][13]** a FeatureCollection for which features will be judged * `type` **[string][8]** expected GeoJSON type * `name` **[string][8]** name of calling function @@ -128,7 +128,7 @@ Get GeoJSON object's type, Geometry type is prioritize. ### Parameters * `geojson` **[GeoJSON][7]** GeoJSON object -* `_name` **[string][8]?** +* `_name` **[string][8]?** * `name` **[string][8]** name of the variable to display in error message (unused) (optional, default `"geojson"`) ### Examples @@ -166,9 +166,13 @@ Returns **[string][8]** GeoJSON type [9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error -[10]: #geojsontype +[10]: https://tools.ietf.org/html/rfc7946#section-3.2 -[11]: https://tools.ietf.org/html/rfc7946#section-3.3 +[11]: #geojsontype + +[12]: https://tools.ietf.org/html/rfc7946#section-3.3 + +[13]: https://tools.ietf.org/html/rfc7946#section-3.3 diff --git a/packages/turf-isobands/README.md b/packages/turf-isobands/README.md index a2397c4d19..a2ebefbc46 100644 --- a/packages/turf-isobands/README.md +++ b/packages/turf-isobands/README.md @@ -9,29 +9,35 @@ value breaks and generates filled contour isobands. ### Parameters -* `pointGrid` **[FeatureCollection][1]<[Point][2]>** input points - must be square or rectangular -* `breaks` **[Array][3]<[number][4]>** where to draw contours -* `options` **[Object][5]** options on output (optional, default `{}`) +* `pointGrid` **[FeatureCollection][3]<[Point][4]>** input points - must be square or rectangular +* `breaks` **[Array][5]<[number][6]>** where to draw contours +* `options` **[Object][7]** options on output (optional, default `{}`) - * `options.zProperty` **[string][6]** the property name in `points` from which z-values will be pulled (optional, default `'elevation'`) - * `options.commonProperties` **[Object][5]** GeoJSON properties passed to ALL isobands (optional, default `{}`) - * `options.breaksProperties` **[Array][3]<[Object][5]>** GeoJSON properties passed, in order, to the correspondent isoband (order defined by breaks) (optional, default `[]`) + * `options.zProperty` **[string][8]** the property name in `points` from which z-values will be pulled (optional, default `'elevation'`) + * `options.commonProperties` **[Object][7]** GeoJSON properties passed to ALL isobands (optional, default `{}`) + * `options.breaksProperties` **[Array][5]<[Object][7]>** GeoJSON properties passed, in order, to the correspondent isoband (order defined by breaks) (optional, default `[]`) -Returns **[FeatureCollection][1]<[MultiPolygon][7]>** a FeatureCollection of [MultiPolygon][7] features representing isobands +Returns **[FeatureCollection][3]<[MultiPolygon][9]>** a FeatureCollection of [MultiPolygon][10] features representing isobands [1]: https://tools.ietf.org/html/rfc7946#section-3.3 [2]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array +[3]: https://tools.ietf.org/html/rfc7946#section-3.3 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7 +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[9]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + +[10]: https://tools.ietf.org/html/rfc7946#section-3.1.7 diff --git a/packages/turf-isolines/README.md b/packages/turf-isolines/README.md index 83c9a60fcd..406606ed04 100644 --- a/packages/turf-isolines/README.md +++ b/packages/turf-isolines/README.md @@ -9,13 +9,13 @@ value breaks and generates [isolines][3]. ### Parameters -* `pointGrid` **[FeatureCollection][1]<[Point][2]>** input points -* `breaks` **[Array][4]<[number][5]>** values of `zProperty` where to draw isolines -* `options` **[Object][6]** Optional parameters (optional, default `{}`) +* `pointGrid` **[FeatureCollection][4]<[Point][5]>** input points +* `breaks` **[Array][6]<[number][7]>** values of `zProperty` where to draw isolines +* `options` **[Object][8]** Optional parameters (optional, default `{}`) - * `options.zProperty` **[string][7]** the property name in `points` from which z-values will be pulled (optional, default `'elevation'`) - * `options.commonProperties` **[Object][6]** GeoJSON properties passed to ALL isolines (optional, default `{}`) - * `options.breaksProperties` **[Array][4]<[Object][6]>** GeoJSON properties passed, in order, to the correspondent isoline; + * `options.zProperty` **[string][9]** the property name in `points` from which z-values will be pulled (optional, default `'elevation'`) + * `options.commonProperties` **[Object][8]** GeoJSON properties passed to ALL isolines (optional, default `{}`) + * `options.breaksProperties` **[Array][6]<[Object][8]>** GeoJSON properties passed, in order, to the correspondent isoline; the breaks array will define the order in which the isolines are created (optional, default `[]`) ### Examples @@ -37,7 +37,7 @@ var lines = turf.isolines(pointGrid, breaks, {zProperty: 'temperature'}); var addToMap = [lines]; ``` -Returns **[FeatureCollection][1]<[MultiLineString][8]>** a FeatureCollection of [MultiLineString][8] features representing isolines +Returns **[FeatureCollection][4]<[MultiLineString][10]>** a FeatureCollection of [MultiLineString][11] features representing isolines [1]: https://tools.ietf.org/html/rfc7946#section-3.3 @@ -45,15 +45,21 @@ Returns **[FeatureCollection][1]<[MultiLineString][8]>** a FeatureCollection of [3]: https://en.wikipedia.org/wiki/Contour_line -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array +[4]: https://tools.ietf.org/html/rfc7946#section-3.3 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array -[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[8]: https://tools.ietf.org/html/rfc7946#section-3.1.5 +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[10]: https://tools.ietf.org/html/rfc7946#section-3.1.5 + +[11]: https://tools.ietf.org/html/rfc7946#section-3.1.5 diff --git a/packages/turf-kinks/README.md b/packages/turf-kinks/README.md index 28316dce36..b1cc8bc5b9 100644 --- a/packages/turf-kinks/README.md +++ b/packages/turf-kinks/README.md @@ -10,7 +10,7 @@ returns [points][5] at all self-intersections. ### Parameters -* `featureIn` **[Feature][6]<([LineString][1] | [MultiLineString][2] | [MultiPolygon][3] | [Polygon][4])>** input feature +* `featureIn` **[Feature][6]<([LineString][7] | [MultiLineString][8] | [MultiPolygon][9] | [Polygon][10])>** input feature ### Examples @@ -29,7 +29,7 @@ var kinks = turf.kinks(poly); var addToMap = [poly, kinks] ``` -Returns **[FeatureCollection][7]<[Point][5]>** self-intersections +Returns **[FeatureCollection][11]<[Point][12]>** self-intersections [1]: https://tools.ietf.org/html/rfc7946#section-3.1.4 @@ -43,7 +43,17 @@ Returns **[FeatureCollection][7]<[Point][5]>** self-intersections [6]: https://tools.ietf.org/html/rfc7946#section-3.2 -[7]: https://tools.ietf.org/html/rfc7946#section-3.3 +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.4 + +[8]: https://tools.ietf.org/html/rfc7946#section-3.1.5 + +[9]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + +[10]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + +[11]: https://tools.ietf.org/html/rfc7946#section-3.3 + +[12]: https://tools.ietf.org/html/rfc7946#section-3.1.2 diff --git a/packages/turf-line-chunk/README.md b/packages/turf-line-chunk/README.md index ef0b74797d..d699d50c14 100644 --- a/packages/turf-line-chunk/README.md +++ b/packages/turf-line-chunk/README.md @@ -9,12 +9,12 @@ If the line is shorter than the segment length then the original line is returne ### Parameters -* `geojson` **([FeatureCollection][2] | [Geometry][3] | [Feature][4]<([LineString][1] | [MultiLineString][5])>)** the lines to split -* `segmentLength` **[number][6]** how long to make each segment -* `options` **[Object][7]** Optional parameters (optional, default `{}`) +* `geojson` **([FeatureCollection][2] | [Geometry][3] | [Feature][4]<([LineString][5] | [MultiLineString][6])>)** the lines to split +* `segmentLength` **[number][7]** how long to make each segment +* `options` **[Object][8]** Optional parameters (optional, default `{}`) - * `options.units` **[string][8]** units can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) - * `options.reverse` **[boolean][9]** reverses coordinates to start the first chunked segment at the end (optional, default `false`) + * `options.units` **[string][9]** units can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) + * `options.reverse` **[boolean][10]** reverses coordinates to start the first chunked segment at the end (optional, default `false`) ### Examples @@ -27,7 +27,7 @@ var chunk = turf.lineChunk(line, 15, {units: 'miles'}); var addToMap = [chunk]; ``` -Returns **[FeatureCollection][2]<[LineString][1]>** collection of line segments +Returns **[FeatureCollection][2]<[LineString][5]>** collection of line segments [1]: https://tools.ietf.org/html/rfc7946#section-3.1.4 @@ -37,15 +37,17 @@ Returns **[FeatureCollection][2]<[LineString][1]>** collection of line segments [4]: https://tools.ietf.org/html/rfc7946#section-3.2 -[5]: https://tools.ietf.org/html/rfc7946#section-3.1.5 +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.4 -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.5 -[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean diff --git a/packages/turf-line-offset/README.md b/packages/turf-line-offset/README.md index 3301253d70..7cb21ebc4d 100644 --- a/packages/turf-line-offset/README.md +++ b/packages/turf-line-offset/README.md @@ -8,11 +8,11 @@ Takes a [line][1] and returns a [line][1] at offset by the specified distance. ### Parameters -* `geojson` **([Geometry][2] | [Feature][3]<([LineString][1] | [MultiLineString][4])>)** input GeoJSON -* `distance` **[number][5]** distance to offset the line (can be of negative value) -* `options` **[Object][6]** Optional parameters (optional, default `{}`) +* `geojson` **([Geometry][2] | [Feature][3]<([LineString][4] | [MultiLineString][5])>)** input GeoJSON +* `distance` **[number][6]** distance to offset the line (can be of negative value) +* `options` **[Object][7]** Optional parameters (optional, default `{}`) - * `options.units` **[string][7]** can be degrees, radians, miles, kilometers, inches, yards, meters (optional, default `'kilometers'`) + * `options.units` **[string][8]** can be degrees, radians, miles, kilometers, inches, yards, meters (optional, default `'kilometers'`) ### Examples @@ -26,7 +26,7 @@ var addToMap = [offsetLine, line] offsetLine.properties.stroke = "#00F" ``` -Returns **[Feature][3]<([LineString][1] | [MultiLineString][4])>** Line offset from the input line +Returns **[Feature][3]<([LineString][4] | [MultiLineString][5])>** Line offset from the input line [1]: https://tools.ietf.org/html/rfc7946#section-3.1.4 @@ -34,13 +34,15 @@ Returns **[Feature][3]<([LineString][1] | [MultiLineString][4])>** Line offset f [3]: https://tools.ietf.org/html/rfc7946#section-3.2 -[4]: https://tools.ietf.org/html/rfc7946#section-3.1.5 +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.4 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.5 -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/packages/turf-line-segment/README.md b/packages/turf-line-segment/README.md index ca191f8f41..b437615965 100644 --- a/packages/turf-line-segment/README.md +++ b/packages/turf-line-segment/README.md @@ -21,7 +21,7 @@ var segments = turf.lineSegment(polygon); var addToMap = [polygon, segments] ``` -Returns **[FeatureCollection][1]<[LineString][2]>** 2-vertex line segments +Returns **[FeatureCollection][5]<[LineString][6]>** 2-vertex line segments [1]: https://tools.ietf.org/html/rfc7946#section-3.3 @@ -31,6 +31,10 @@ Returns **[FeatureCollection][1]<[LineString][2]>** 2-vertex line segments [4]: https://tools.ietf.org/html/rfc7946#section-3 +[5]: https://tools.ietf.org/html/rfc7946#section-3.3 + +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.4 + --- diff --git a/packages/turf-line-slice-along/README.md b/packages/turf-line-slice-along/README.md index 4fddeb597c..c69da0900a 100644 --- a/packages/turf-line-slice-along/README.md +++ b/packages/turf-line-slice-along/README.md @@ -12,12 +12,12 @@ This can be useful for extracting only the part of a route between two distances ### Parameters -* `line` **([Feature][3]<[LineString][1]> | [LineString][1])** input line -* `startDist` **[number][4]** distance along the line to starting point -* `stopDist` **[number][4]** distance along the line to ending point -* `options` **[Object][5]** Optional parameters (optional, default `{}`) +* `line` **([Feature][3]<[LineString][4]> | [LineString][4])** input line +* `startDist` **[number][5]** distance along the line to starting point +* `stopDist` **[number][5]** distance along the line to ending point +* `options` **[Object][6]** Optional parameters (optional, default `{}`) - * `options.units` **[string][6]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) + * `options.units` **[string][7]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) ### Examples @@ -31,7 +31,7 @@ var sliced = turf.lineSliceAlong(line, start, stop, {units: 'miles'}); var addToMap = [line, start, stop, sliced] ``` -Returns **[Feature][3]<[LineString][1]>** sliced line +Returns **[Feature][3]<[LineString][4]>** sliced line [1]: https://tools.ietf.org/html/rfc7946#section-3.1.4 @@ -39,11 +39,13 @@ Returns **[Feature][3]<[LineString][1]>** sliced line [3]: https://tools.ietf.org/html/rfc7946#section-3.2 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.4 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/packages/turf-line-slice/README.md b/packages/turf-line-slice/README.md index 2b5e88cc0a..668efe84c0 100644 --- a/packages/turf-line-slice/README.md +++ b/packages/turf-line-slice/README.md @@ -14,7 +14,7 @@ This can be useful for extracting only the part of a route between waypoints. * `startPt` **[Coord][3]** starting point * `stopPt` **[Coord][3]** stopping point -* `line` **([Feature][4]<[LineString][1]> | [LineString][1])** line to slice +* `line` **([Feature][4]<[LineString][5]> | [LineString][5])** line to slice ### Examples @@ -36,7 +36,7 @@ var sliced = turf.lineSlice(start, stop, line); var addToMap = [start, stop, line] ``` -Returns **[Feature][4]<[LineString][1]>** sliced line +Returns **[Feature][4]<[LineString][5]>** sliced line [1]: https://tools.ietf.org/html/rfc7946#section-3.1.4 @@ -46,6 +46,8 @@ Returns **[Feature][4]<[LineString][1]>** sliced line [4]: https://tools.ietf.org/html/rfc7946#section-3.2 +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.4 + --- diff --git a/packages/turf-mask/README.md b/packages/turf-mask/README.md index 7b369d93ba..cfcfcbb16a 100644 --- a/packages/turf-mask/README.md +++ b/packages/turf-mask/README.md @@ -8,8 +8,8 @@ Takes any type of [polygon][1] and an optional mask and returns a [polygon][1] e ### Parameters -* `polygon` **([FeatureCollection][2] | [Feature][3]<([Polygon][1] | [MultiPolygon][4])>)** GeoJSON Polygon used as interior rings or holes. -* `mask` **[Feature][3]<[Polygon][1]>?** GeoJSON Polygon used as the exterior ring (if undefined, the world extent is used) +* `polygon` **([FeatureCollection][2] | [Feature][3]<([Polygon][4] | [MultiPolygon][5])>)** GeoJSON Polygon used as interior rings or holes. +* `mask` **[Feature][3]<[Polygon][4]>?** GeoJSON Polygon used as the exterior ring (if undefined, the world extent is used) ### Examples @@ -23,7 +23,7 @@ var masked = turf.mask(polygon, mask); var addToMap = [masked] ``` -Returns **[Feature][3]<[Polygon][1]>** Masked Polygon (exterior ring with holes). +Returns **[Feature][3]<[Polygon][4]>** Masked Polygon (exterior ring with holes). [1]: https://tools.ietf.org/html/rfc7946#section-3.1.6 @@ -31,7 +31,9 @@ Returns **[Feature][3]<[Polygon][1]>** Masked Polygon (exterior ring with holes) [3]: https://tools.ietf.org/html/rfc7946#section-3.2 -[4]: https://tools.ietf.org/html/rfc7946#section-3.1.7 +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.7 diff --git a/packages/turf-meta/README.md b/packages/turf-meta/README.md index 13dc60352f..8a8affc2b3 100644 --- a/packages/turf-meta/README.md +++ b/packages/turf-meta/README.md @@ -43,7 +43,7 @@ turf.coordEach(features, function (currentCoord, coordIndex, featureIndex, multi }); ``` -Returns **void** +Returns **void** ## coordReduceCallback @@ -141,7 +141,7 @@ turf.propEach(features, function (currentProperties, featureIndex) { }); ``` -Returns **void** +Returns **void** ## propReduceCallback @@ -234,7 +234,7 @@ turf.featureEach(features, function (currentFeature, featureIndex) { }); ``` -Returns **void** +Returns **void** ## featureReduceCallback @@ -352,7 +352,7 @@ turf.geomEach(features, function (currentGeometry, featureIndex, featureProperti }); ``` -Returns **void** +Returns **void** ## geomReduceCallback @@ -521,7 +521,7 @@ Type: [Function][1] * `geometryIndex` **[number][3]** The current index of the Geometry being processed. * `segmentIndex` **[number][3]** The current index of the Segment being processed. -Returns **void** +Returns **void** ## segmentEach @@ -554,7 +554,7 @@ turf.segmentEach(polygon, function () { }); ``` -Returns **void** +Returns **void** ## segmentReduceCallback @@ -620,7 +620,7 @@ var total = turf.segmentReduce(polygon, function (previousValue) { }, initialValue); ``` -Returns **void** +Returns **void** ## lineEachCallback diff --git a/packages/turf-midpoint/README.md b/packages/turf-midpoint/README.md index 23c524cd1d..3d921ceeb2 100644 --- a/packages/turf-midpoint/README.md +++ b/packages/turf-midpoint/README.md @@ -25,7 +25,7 @@ var addToMap = [point1, point2, midpoint]; midpoint.properties['marker-color'] = '#f00'; ``` -Returns **[Feature][3]<[Point][1]>** a point midway between `pt1` and `pt2` +Returns **[Feature][3]<[Point][4]>** a point midway between `pt1` and `pt2` [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -33,6 +33,8 @@ Returns **[Feature][3]<[Point][1]>** a point midway between `pt1` and `pt2` [3]: https://tools.ietf.org/html/rfc7946#section-3.2 +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2 + --- diff --git a/packages/turf-moran-index/README.md b/packages/turf-moran-index/README.md index ce93589de4..532fc98f0b 100644 --- a/packages/turf-moran-index/README.md +++ b/packages/turf-moran-index/README.md @@ -28,8 +28,8 @@ the z-score can be calculated based on a normal or random assumption. ### Parameters -* `fc` **[FeatureCollection][3]\** -* `options` **[Object][4]** +* `fc` **[FeatureCollection][3]\** +* `options` **[Object][4]** * `options.inputField` **[string][5]** the property name, must contain numeric values * `options.threshold` **[number][6]** the distance threshold (optional, default `100000`) @@ -49,7 +49,7 @@ const result = turf.moranIndex(dataset, { }); ``` -Returns **[MoranIndex][8]** +Returns **[MoranIndex][8]** ## mean @@ -57,9 +57,9 @@ get mean of a list ### Parameters -* `y` **[Array][9]<[number][6]>** +* `y` **[Array][9]<[number][6]>** -Returns **[number][6]** +Returns **[number][6]** ## variance @@ -67,9 +67,9 @@ get variance of a list ### Parameters -* `y` **[Array][9]<[number][6]>** +* `y` **[Array][9]<[number][6]>** -Returns **[number][6]** +Returns **[number][6]** ## MoranIndex diff --git a/packages/turf-nearest-neighbor-analysis/README.md b/packages/turf-nearest-neighbor-analysis/README.md index 5b66701dfd..c13aa226e0 100644 --- a/packages/turf-nearest-neighbor-analysis/README.md +++ b/packages/turf-nearest-neighbor-analysis/README.md @@ -22,16 +22,18 @@ dispersed. **Remarks** * Though the analysis will work on any [FeatureCollection][3] type, it - works best with [Point][4] collections. + +works best with [Point][4] collections. * This analysis is *very* sensitive to the study area provided. - If no [Feature\][1] is passed as the study area, the function draws a box - around the data, which may distort the findings. This analysis works best - with a bounded area of interest within with the data is either clustered, - dispersed, or randomly distributed. For example, a city's subway stops may - look extremely clustered if the study area is an entire state. On the other - hand, they may look rather evenly dispersed if the study area is limited to - the city's downtown. + +If no [Feature\][1] is passed as the study area, the function draws a box +around the data, which may distort the findings. This analysis works best +with a bounded area of interest within with the data is either clustered, +dispersed, or randomly distributed. For example, a city's subway stops may +look extremely clustered if the study area is an entire state. On the other +hand, they may look rather evenly dispersed if the study area is limited to +the city's downtown. **Bibliography** @@ -41,12 +43,12 @@ Measure of Spatial Relationships in Populations,” *Ecology* 35, no. 4 ### Parameters -* `dataset` **[FeatureCollection][3]\** FeatureCollection (pref. of points) to study -* `options` **[Object][6]** Optional parameters (optional, default `{}`) +* `dataset` **[FeatureCollection][6]\** FeatureCollection (pref. of points) to study +* `options` **[Object][7]** Optional parameters (optional, default `{}`) - * `options.studyArea` **[Feature][7]<[Polygon][8]>?** polygon representing the study area - * `options.units` **[string][9]** unit of measurement for distances and, squared, area. (optional, default `'kilometers'`) - * `options.properties` **[Object][6]** properties (optional, default `{}`) + * `options.studyArea` **[Feature][8]<[Polygon][9]>?** polygon representing the study area + * `options.units` **[string][10]** unit of measurement for distances and, squared, area. (optional, default `'kilometers'`) + * `options.properties` **[Object][7]** properties (optional, default `{}`) ### Examples @@ -59,7 +61,7 @@ var nearestNeighborStudyArea = turf.nearestNeighborAnalysis(dataset); var addToMap = [dataset, nearestNeighborStudyArea]; ``` -Returns **[Feature][7]<[Polygon][8]>** A polygon of the study area or an approximation of one. +Returns **[Feature][8]<[Polygon][9]>** A polygon of the study area or an approximation of one. [1]: Feature @@ -71,13 +73,15 @@ Returns **[Feature][7]<[Polygon][8]>** A polygon of the study area or an approxi [5]: http://doi.org/10.2307/1931034 -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[6]: https://tools.ietf.org/html/rfc7946#section-3.3 + +[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[7]: https://tools.ietf.org/html/rfc7946#section-3.2 +[8]: https://tools.ietf.org/html/rfc7946#section-3.2 -[8]: https://tools.ietf.org/html/rfc7946#section-3.1.6 +[9]: https://tools.ietf.org/html/rfc7946#section-3.1.6 -[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/packages/turf-nearest-point-on-line/README.md b/packages/turf-nearest-point-on-line/README.md index b08a461845..5847978a5f 100644 --- a/packages/turf-nearest-point-on-line/README.md +++ b/packages/turf-nearest-point-on-line/README.md @@ -8,11 +8,11 @@ Takes a [Point][1] and a [LineString][2] and calculates the closest Point on the ### Parameters -* `lines` **([Geometry][3] | [Feature][4]<([LineString][2] | [MultiLineString][5])>)** lines to snap to -* `pt` **([Geometry][3] | [Feature][4]<[Point][1]> | [Array][6]<[number][7]>)** point to snap from -* `options` **[Object][8]** Optional parameters (optional, default `{}`) +* `lines` **([Geometry][3] | [Feature][4]<([LineString][5] | [MultiLineString][6])>)** lines to snap to +* `pt` **([Geometry][3] | [Feature][4]<[Point][7]> | [Array][8]<[number][9]>)** point to snap from +* `options` **[Object][10]** Optional parameters (optional, default `{}`) - * `options.units` **[string][9]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) + * `options.units` **[string][11]** can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) ### Examples @@ -34,7 +34,7 @@ var addToMap = [line, pt, snapped]; snapped.properties['marker-color'] = '#00f'; ``` -Returns **[Feature][4]<[Point][1]>** closest point on the `line` to `point`. The properties object will contain three values: `index`: closest point was found on nth line part, `dist`: distance between pt and the closest point, `location`: distance along the line between start and the closest point. +Returns **[Feature][4]<[Point][7]>** closest point on the `line` to `point`. The properties object will contain three values: `index`: closest point was found on nth line part, `dist`: distance between pt and the closest point, `location`: distance along the line between start and the closest point. [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -44,15 +44,19 @@ Returns **[Feature][4]<[Point][1]>** closest point on the `line` to `point`. The [4]: https://tools.ietf.org/html/rfc7946#section-3.2 -[5]: https://tools.ietf.org/html/rfc7946#section-3.1.5 +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.4 -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.5 -[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array -[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number + +[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/packages/turf-nearest-point-to-line/README.md b/packages/turf-nearest-point-to-line/README.md index 5796910411..277fe0dfa6 100644 --- a/packages/turf-nearest-point-to-line/README.md +++ b/packages/turf-nearest-point-to-line/README.md @@ -9,13 +9,13 @@ to a [line][3]. The returned point has a `dist` property indicating its distance ### Parameters -* `points` **([FeatureCollection][2] | [GeometryCollection][4]<[Point][1]>)** Point Collection -* `line` **([Feature][5] | [Geometry][6]<[LineString][3]>)** Line Feature -* `options` **[Object][7]?** Optional parameters +* `points` **([FeatureCollection][4] | [GeometryCollection][5]<[Point][6]>)** Point Collection +* `line` **([Feature][7] | [Geometry][8]<[LineString][9]>)** Line Feature +* `options` **[Object][10]?** Optional parameters - * `options.units` **[string][8]** unit of the output distance property + * `options.units` **[string][11]** unit of the output distance property (eg: degrees, radians, miles, or kilometers) (optional, default `'kilometers'`) - * `options.properties` **[Object][7]** Translate Properties to Point (optional, default `{}`) + * `options.properties` **[Object][10]** Translate Properties to Point (optional, default `{}`) ### Examples @@ -31,7 +31,7 @@ var nearest = turf.nearestPointToLine(points, line); var addToMap = [nearest, line]; ``` -Returns **[Feature][5]<[Point][1]>** the closest point +Returns **[Feature][7]<[Point][6]>** the closest point ## pt @@ -47,15 +47,21 @@ Translate Properties to final Point, priorities: [3]: https://tools.ietf.org/html/rfc7946#section-3.1.4 -[4]: https://tools.ietf.org/html/rfc7946#section-3.1.8 +[4]: https://tools.ietf.org/html/rfc7946#section-3.3 -[5]: https://tools.ietf.org/html/rfc7946#section-3.2 +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.8 -[6]: https://tools.ietf.org/html/rfc7946#section-3.1 +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[7]: https://tools.ietf.org/html/rfc7946#section-3.2 -[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[8]: https://tools.ietf.org/html/rfc7946#section-3.1 + +[9]: https://tools.ietf.org/html/rfc7946#section-3.1.4 + +[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/packages/turf-nearest-point/README.md b/packages/turf-nearest-point/README.md index 818a71afb4..fe152de9b8 100644 --- a/packages/turf-nearest-point/README.md +++ b/packages/turf-nearest-point/README.md @@ -12,10 +12,10 @@ is geodesic. ### Parameters * `targetPoint` **[Coord][2]** the reference point -* `points` **[FeatureCollection][3]<[Point][1]>** against input point set -* `options` **[Object][4]** Optional parameters (optional, default `{}`) +* `points` **[FeatureCollection][3]<[Point][4]>** against input point set +* `options` **[Object][5]** Optional parameters (optional, default `{}`) - * `options.units` **[string][5]** the units of the numeric result (optional, default `'kilometers'`) + * `options.units` **[string][6]** the units of the numeric result (optional, default `'kilometers'`) ### Examples @@ -34,7 +34,7 @@ var addToMap = [targetPoint, points, nearest]; nearest.properties['marker-color'] = '#F00'; ``` -Returns **[Feature][6]<[Point][1]>** the closest point in the set to the reference point +Returns **[Feature][7]<[Point][4]>** the closest point in the set to the reference point [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -42,11 +42,13 @@ Returns **[Feature][6]<[Point][1]>** the closest point in the set to the referen [3]: https://tools.ietf.org/html/rfc7946#section-3.3 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[6]: https://tools.ietf.org/html/rfc7946#section-3.2 +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[7]: https://tools.ietf.org/html/rfc7946#section-3.2 diff --git a/packages/turf-planepoint/README.md b/packages/turf-planepoint/README.md index b4f85afee6..31dddf4324 100644 --- a/packages/turf-planepoint/README.md +++ b/packages/turf-planepoint/README.md @@ -14,7 +14,7 @@ if their values are not provided as properties. ### Parameters * `point` **[Coord][3]** the Point for which a z-value will be calculated -* `triangle` **[Feature][4]<[Polygon][1]>** a Polygon feature with three vertices +* `triangle` **[Feature][4]<[Polygon][5]>** a Polygon feature with three vertices ### Examples @@ -39,7 +39,7 @@ point.properties.zValue = zValue; var addToMap = [triangle, point]; ``` -Returns **[number][5]** the z-value for `interpolatedPoint` +Returns **[number][6]** the z-value for `interpolatedPoint` [1]: https://tools.ietf.org/html/rfc7946#section-3.1.6 @@ -49,7 +49,9 @@ Returns **[number][5]** the z-value for `interpolatedPoint` [4]: https://tools.ietf.org/html/rfc7946#section-3.2 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number diff --git a/packages/turf-point-grid/README.md b/packages/turf-point-grid/README.md index 6c409b727a..249f6201a9 100644 --- a/packages/turf-point-grid/README.md +++ b/packages/turf-point-grid/README.md @@ -13,7 +13,7 @@ Creates a [Point][1] grid from a bounding box, [FeatureCollection][2] or [Featur * `options` **[Object][6]** Optional parameters (optional, default `{}`) * `options.units` **[string][7]** used in calculating cellSide, can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) - * `options.mask` **[Feature][3]<([Polygon][8] | [MultiPolygon][9])>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it + * `options.mask` **[Feature][8]<([Polygon][9] | [MultiPolygon][10])>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it * `options.properties` **[Object][6]** passed to each point of the grid (optional, default `{}`) ### Examples @@ -29,7 +29,7 @@ var grid = turf.pointGrid(extent, cellSide, options); var addToMap = [grid]; ``` -Returns **[FeatureCollection][2]<[Point][1]>** grid of points +Returns **[FeatureCollection][11]<[Point][12]>** grid of points [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -45,9 +45,15 @@ Returns **[FeatureCollection][2]<[Point][1]>** grid of points [7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[8]: https://tools.ietf.org/html/rfc7946#section-3.1.6 +[8]: https://tools.ietf.org/html/rfc7946#section-3.2 -[9]: https://tools.ietf.org/html/rfc7946#section-3.1.7 +[9]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + +[10]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + +[11]: https://tools.ietf.org/html/rfc7946#section-3.3 + +[12]: https://tools.ietf.org/html/rfc7946#section-3.1.2 diff --git a/packages/turf-point-on-feature/README.md b/packages/turf-point-on-feature/README.md index 0db0b5002c..967167398f 100644 --- a/packages/turf-point-on-feature/README.md +++ b/packages/turf-point-on-feature/README.md @@ -33,7 +33,7 @@ var pointOnPolygon = turf.pointOnFeature(polygon); var addToMap = [polygon, pointOnPolygon]; ``` -Returns **[Feature][5]<[Point][1]>** a point on the surface of `input` +Returns **[Feature][5]<[Point][6]>** a point on the surface of `input` [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -45,6 +45,8 @@ Returns **[Feature][5]<[Point][1]>** a point on the surface of `input` [5]: https://tools.ietf.org/html/rfc7946#section-3.2 +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.2 + --- diff --git a/packages/turf-point-to-line-distance/README.md b/packages/turf-point-to-line-distance/README.md index 37d7ce1e34..30be6d7984 100644 --- a/packages/turf-point-to-line-distance/README.md +++ b/packages/turf-point-to-line-distance/README.md @@ -9,13 +9,13 @@ minimum distance between the point and any segment of the `LineString`. ### Parameters -* `pt` **([Feature][3]<[Point][1]> | [Array][4]<[number][5]>)** Feature or Geometry -* `line` **[Feature][3]<[LineString][2]>** GeoJSON Feature or Geometry -* `options` **[Object][6]** Optional parameters (optional, default `{}`) +* `pt` **([Feature][3]<[Point][4]> | [Array][5]<[number][6]>)** Feature or Geometry +* `line` **[Feature][3]<[LineString][7]>** GeoJSON Feature or Geometry +* `options` **[Object][8]** Optional parameters (optional, default `{}`) - * `options.units` **[string][7]** can be anything supported by turf/convertLength + * `options.units` **[string][9]** can be anything supported by turf/convertLength (ex: degrees, radians, miles, or kilometers) (optional, default `"kilometers"`) - * `options.method` **[string][7]** wether to calculate the distance based on geodesic (spheroid) or + * `options.method` **[string][9]** wether to calculate the distance based on geodesic (spheroid) or planar (flat) method. Valid options are 'geodesic' or 'planar'. (optional, default `"geodesic"`) ### Examples @@ -28,7 +28,7 @@ var distance = turf.pointToLineDistance(pt, line, {units: 'miles'}); //=69.11854715938406 ``` -Returns **[number][5]** distance between point and line +Returns **[number][6]** distance between point and line [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -36,13 +36,17 @@ Returns **[number][5]** distance between point and line [3]: https://tools.ietf.org/html/rfc7946#section-3.2 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.4 + +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/packages/turf-points-within-polygon/README.md b/packages/turf-points-within-polygon/README.md index 9cd0fa91a0..4954f7c05e 100644 --- a/packages/turf-points-within-polygon/README.md +++ b/packages/turf-points-within-polygon/README.md @@ -8,8 +8,8 @@ Finds [Points][1] or [MultiPoint][2] coordinate positions that fall within [(Mul ### Parameters -* `points` **([Feature][4] | [FeatureCollection][5]<([Point][1] | [MultiPoint][2])>)** Point(s) or MultiPoint(s) as input search -* `polygons` **([FeatureCollection][5] | [Geometry][6] | [Feature][4]<([Polygon][3] | [MultiPolygon][7])>)** (Multi)Polygon(s) to check if points are within +* `points` **([Feature][4] | [FeatureCollection][5]<([Point][6] | [MultiPoint][7])>)** Point(s) or MultiPoint(s) as input search +* `polygons` **([FeatureCollection][5] | [Geometry][8] | [Feature][4]<([Polygon][9] | [MultiPolygon][10])>)** (Multi)Polygon(s) to check if points are within ### Examples @@ -42,7 +42,7 @@ turf.featureEach(ptsWithin, function (currentFeature) { }); ``` -Returns **[FeatureCollection][5]<([Point][1] | [MultiPoint][2])>** Point(s) or MultiPoint(s) with positions that land within at least one polygon. The geometry type will match what was passsed in +Returns **[FeatureCollection][5]<([Point][6] | [MultiPoint][7])>** Point(s) or MultiPoint(s) with positions that land within at least one polygon. The geometry type will match what was passsed in [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -54,9 +54,15 @@ Returns **[FeatureCollection][5]<([Point][1] | [MultiPoint][2])>** Point(s) or M [5]: https://tools.ietf.org/html/rfc7946#section-3.3 -[6]: https://tools.ietf.org/html/rfc7946#section-3.1 +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7 +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.3 + +[8]: https://tools.ietf.org/html/rfc7946#section-3.1 + +[9]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + +[10]: https://tools.ietf.org/html/rfc7946#section-3.1.7 diff --git a/packages/turf-polygon-smooth/README.md b/packages/turf-polygon-smooth/README.md index 62da5fb0b4..2610dfd82d 100644 --- a/packages/turf-polygon-smooth/README.md +++ b/packages/turf-polygon-smooth/README.md @@ -9,10 +9,10 @@ Warning: may create degenerate polygons. ### Parameters -* `inputPolys` **([FeatureCollection][4] | [Feature][5]<([Polygon][1] | [MultiPolygon][2])>)** (Multi)Polygon(s) to smooth -* `options` **[Object][6]** Optional parameters (optional, default `{}`) +* `inputPolys` **([FeatureCollection][4]<([Polygon][5] | [MultiPolygon][6])> | [Feature][7]<([Polygon][5] | [MultiPolygon][6])> | [Polygon][5] | [MultiPolygon][6])** (Multi)Polygon(s) to smooth +* `options` **[Object][8]** Optional parameters (optional, default `{}`) - * `options.iterations` **[string][7]** The number of times to smooth the polygon. A higher value means a smoother polygon. (optional, default `1`) + * `options.iterations` **[string][9]** The number of times to smooth the polygon. A higher value means a smoother polygon. (optional, default `1`) ### Examples @@ -25,7 +25,7 @@ var smoothed = turf.polygonSmooth(polygon, {iterations: 3}) var addToMap = [smoothed, polygon]; ``` -Returns **[FeatureCollection][4]<[Polygon][1]>** FeatureCollection containing the smoothed polygon/poylgons +Returns **[FeatureCollection][4]<([Polygon][5] | [MultiPolygon][6])>** FeatureCollection containing the smoothed polygon/multipoylgons [1]: https://tools.ietf.org/html/rfc7946#section-3.1.6 @@ -35,11 +35,15 @@ Returns **[FeatureCollection][4]<[Polygon][1]>** FeatureCollection containing th [4]: https://tools.ietf.org/html/rfc7946#section-3.3 -[5]: https://tools.ietf.org/html/rfc7946#section-3.2 +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.6 -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.7 -[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[7]: https://tools.ietf.org/html/rfc7946#section-3.2 + +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/packages/turf-polygon-tangents/README.md b/packages/turf-polygon-tangents/README.md index 9f7c968679..4e9a2a3393 100644 --- a/packages/turf-polygon-tangents/README.md +++ b/packages/turf-polygon-tangents/README.md @@ -9,7 +9,7 @@ Finds the tangents of a [(Multi)Polygon][1] from a [Point][2]. ### Parameters * `pt` **[Coord][3]** to calculate the tangent points from -* `polygon` **[Feature][4]<([Polygon][1] | [MultiPolygon][5])>** to get tangents from +* `polygon` **[Feature][4]<([Polygon][5] | [MultiPolygon][6])>** to get tangents from ### Examples @@ -23,7 +23,7 @@ var tangents = turf.polygonTangents(point, polygon) var addToMap = [tangents, point, polygon]; ``` -Returns **[FeatureCollection][6]<[Point][2]>** Feature Collection containing the two tangent points +Returns **[FeatureCollection][7]<[Point][8]>** Feature Collection containing the two tangent points [1]: https://tools.ietf.org/html/rfc7946#section-3.1.6 @@ -33,9 +33,13 @@ Returns **[FeatureCollection][6]<[Point][2]>** Feature Collection containing the [4]: https://tools.ietf.org/html/rfc7946#section-3.2 -[5]: https://tools.ietf.org/html/rfc7946#section-3.1.7 +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.6 -[6]: https://tools.ietf.org/html/rfc7946#section-3.3 +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + +[7]: https://tools.ietf.org/html/rfc7946#section-3.3 + +[8]: https://tools.ietf.org/html/rfc7946#section-3.1.2 diff --git a/packages/turf-polygon-to-line/README.md b/packages/turf-polygon-to-line/README.md index 0205df3f74..7b6cf7aa99 100644 --- a/packages/turf-polygon-to-line/README.md +++ b/packages/turf-polygon-to-line/README.md @@ -9,10 +9,10 @@ Converts a [Polygon][1] to [(Multi)LineString][2] or [MultiPolygon][3] to a ### Parameters -* `poly` **[Feature][5]<([Polygon][1] | [MultiPolygon][3])>** Feature to convert -* `options` **[Object][6]** Optional parameters (optional, default `{}`) +* `poly` **[Feature][5]<([Polygon][6] | [MultiPolygon][7])>** Feature to convert +* `options` **[Object][8]** Optional parameters (optional, default `{}`) - * `options.properties` **[Object][6]** translates GeoJSON properties to Feature (optional, default `{}`) + * `options.properties` **[Object][8]** translates GeoJSON properties to Feature (optional, default `{}`) ### Examples @@ -25,7 +25,7 @@ var line = turf.polygonToLine(poly); var addToMap = [line]; ``` -Returns **([FeatureCollection][4] | [Feature][5]<([LineString][2] | MultiLinestring)>)** converted (Multi)Polygon to (Multi)LineString +Returns **([FeatureCollection][9] | [Feature][5]<([LineString][10] | MultiLinestring)>)** converted (Multi)Polygon to (Multi)LineString [1]: https://tools.ietf.org/html/rfc7946#section-3.1.6 @@ -37,7 +37,15 @@ Returns **([FeatureCollection][4] | [Feature][5]<([LineString][2] | MultiLinestr [5]: https://tools.ietf.org/html/rfc7946#section-3.2 -[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object + +[9]: https://tools.ietf.org/html/rfc7946#section-3.3 + +[10]: https://tools.ietf.org/html/rfc7946#section-3.1.4 diff --git a/packages/turf-polygonize/README.md b/packages/turf-polygonize/README.md index 48f42a366f..fb292ae8ac 100644 --- a/packages/turf-polygonize/README.md +++ b/packages/turf-polygonize/README.md @@ -18,13 +18,13 @@ The implementation correctly handles: ### Parameters -* `geoJson` **([FeatureCollection][3] | [Geometry][4] | [Feature][5]<([LineString][1] | [MultiLineString][6])>)** Lines in order to polygonize +* `geoJson` **([FeatureCollection][3] | [Geometry][4] | [Feature][5]<([LineString][6] | [MultiLineString][7])>)** Lines in order to polygonize -* Throws **[Error][7]** if geoJson is invalid. +* Throws **[Error][8]** if geoJson is invalid. -Returns **[FeatureCollection][3]<[Polygon][2]>** Polygons created +Returns **[FeatureCollection][3]<[Polygon][9]>** Polygons created [1]: https://tools.ietf.org/html/rfc7946#section-3.1.4 @@ -36,9 +36,13 @@ Returns **[FeatureCollection][3]<[Polygon][2]>** Polygons created [5]: https://tools.ietf.org/html/rfc7946#section-3.2 -[6]: https://tools.ietf.org/html/rfc7946#section-3.1.5 +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.4 -[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.5 + +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error + +[9]: https://tools.ietf.org/html/rfc7946#section-3.1.6 diff --git a/packages/turf-quadrat-analysis/README.md b/packages/turf-quadrat-analysis/README.md index d4802e36e1..8fdadf1f9e 100644 --- a/packages/turf-quadrat-analysis/README.md +++ b/packages/turf-quadrat-analysis/README.md @@ -36,7 +36,7 @@ which is simply the area of the study area divided by the number of features. * `options.studyBbox` **bbox?** bbox representing the study area * `options.confidenceLevel` **[number][4]** a confidence level. - The unit is percentage . 5 means 95%, value must be in [K\_TABLE][5] (optional, default `20`) + The unit is percentage . 5 means 95%, value must be in [K_TABLE][5] (optional, default `20`) ### Examples @@ -48,7 +48,7 @@ var result = turf.quadratAnalysis(dataset); Returns **[Object][3]** result [QuadratAnalysisResult][6] -## K\_TABLE +## K_TABLE the confidence level @@ -56,12 +56,12 @@ Type: [Object][3] ### Properties -* `20` **[number][4]** -* `15` **[number][4]** -* `10` **[number][4]** -* `5` **[number][4]** -* `2` **[number][4]** -* `1` **[number][4]** +* `20` **[number][4]** +* `15` **[number][4]** +* `10` **[number][4]** +* `5` **[number][4]** +* `2` **[number][4]** +* `1` **[number][4]** ## QuadratAnalysisResult @@ -71,9 +71,9 @@ Type: [Object][3] ### Properties -* `criticalValue` **[number][4]** -* `maxAbsoluteDifference` **[number][4]** -* `isRandom` **[boolean][7]** +* `criticalValue` **[number][4]** +* `maxAbsoluteDifference` **[number][4]** +* `isRandom` **[boolean][7]** * `observedDistribution` **[Array][8]<[number][4]>** the cumulative distribution of observed features, the index represents the number of features in the quadrat. diff --git a/packages/turf-rectangle-grid/README.md b/packages/turf-rectangle-grid/README.md index 9ad5c99ff6..97d35946c6 100644 --- a/packages/turf-rectangle-grid/README.md +++ b/packages/turf-rectangle-grid/README.md @@ -15,7 +15,7 @@ Creates a grid of rectangles from a bounding box, [Feature][1] or [FeatureCollec * `options.units` **[string][6]** units ("degrees", "radians", "miles", "kilometers") that the given cellWidth and cellHeight are expressed in. Converted at the southern border. (optional, default `'kilometers'`) - * `options.mask` **[Feature][1]<([Polygon][7] | [MultiPolygon][8])>?** if passed a Polygon or MultiPolygon, + * `options.mask` **[Feature][7]<([Polygon][8] | [MultiPolygon][9])>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it * `options.properties` **[Object][5]** passed to each point of the grid (optional, default `{}`) @@ -33,7 +33,7 @@ var rectangleGrid = turf.rectangleGrid(bbox, cellWidth, cellHeight, options); var addToMap = [rectangleGrid] ``` -Returns **[FeatureCollection][2]<[Polygon][7]>** a grid of polygons +Returns **[FeatureCollection][10]<[Polygon][8]>** a grid of polygons [1]: https://tools.ietf.org/html/rfc7946#section-3.2 @@ -47,9 +47,13 @@ Returns **[FeatureCollection][2]<[Polygon][7]>** a grid of polygons [6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[7]: https://tools.ietf.org/html/rfc7946#section-3.1.6 +[7]: https://tools.ietf.org/html/rfc7946#section-3.2 -[8]: https://tools.ietf.org/html/rfc7946#section-3.1.7 +[8]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + +[9]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + +[10]: https://tools.ietf.org/html/rfc7946#section-3.3 diff --git a/packages/turf-rhumb-destination/README.md b/packages/turf-rhumb-destination/README.md index 001ad5d59b..74e53e22d9 100644 --- a/packages/turf-rhumb-destination/README.md +++ b/packages/turf-rhumb-destination/README.md @@ -32,7 +32,7 @@ var addToMap = [pt, destination] destination.properties['marker-color'] = '#00F'; ``` -Returns **[Feature][6]<[Point][1]>** Destination point. +Returns **[Feature][6]<[Point][7]>** Destination point. [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -46,6 +46,8 @@ Returns **[Feature][6]<[Point][1]>** Destination point. [6]: https://tools.ietf.org/html/rfc7946#section-3.2 +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.2 + --- diff --git a/packages/turf-sample/README.md b/packages/turf-sample/README.md index d853c8b2c3..4d48654357 100644 --- a/packages/turf-sample/README.md +++ b/packages/turf-sample/README.md @@ -8,8 +8,8 @@ Takes a [FeatureCollection][1] and returns a FeatureCollection with given number ### Parameters -* `featurecollection` **[FeatureCollection][1]** set of input features -* `num` **[number][3]** number of features to select +* `featurecollection` **[FeatureCollection][3]** set of input features +* `num` **[number][4]** number of features to select ### Examples @@ -26,13 +26,15 @@ turf.featureEach(sample, function (currentFeature) { }); ``` -Returns **[FeatureCollection][1]** a FeatureCollection with `n` features +Returns **[FeatureCollection][3]** a FeatureCollection with `n` features [1]: https://tools.ietf.org/html/rfc7946#section-3.3 [2]: https://tools.ietf.org/html/rfc7946#section-3.2 -[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[3]: https://tools.ietf.org/html/rfc7946#section-3.3 + +[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number diff --git a/packages/turf-shortest-path/README.md b/packages/turf-shortest-path/README.md index 94047f4246..9fbeae5810 100644 --- a/packages/turf-shortest-path/README.md +++ b/packages/turf-shortest-path/README.md @@ -13,10 +13,9 @@ any [Feature][3] in [ obstacles][4] * `end` **[Coord][5]** point * `options` **[Object][6]** optional parameters (optional, default `{}`) - * `options.obstacles` **([Geometry][7] | [Feature][3] | [FeatureCollection][8]<[Polygon][9]>)?** areas which path cannot travel - * `options.minDistance` **[number][10]?** minimum distance between shortest path and obstacles + * `options.obstacles` **([Geometry][7] | [Feature][8] | [FeatureCollection][9]<[Polygon][10]>)?** areas which path cannot travel * `options.units` **[string][11]** unit in which resolution & minimum distance will be expressed in; it can be degrees, radians, miles, kilometers, ... (optional, default `'kilometers'`) - * `options.resolution` **[number][10]** distance between matrix points on which the path will be calculated (optional, default `100`) + * `options.resolution` **[number][12]** distance between matrix points on which the path will be calculated (optional, default `100`) ### Examples @@ -33,7 +32,7 @@ var path = turf.shortestPath(start, end, options); var addToMap = [start, end, options.obstacles, path]; ``` -Returns **[Feature][3]<[LineString][1]>** shortest path between start and end +Returns **[Feature][8]<[LineString][13]>** shortest path between start and end [1]: https://tools.ietf.org/html/rfc7946#section-3.1.4 @@ -49,14 +48,18 @@ Returns **[Feature][3]<[LineString][1]>** shortest path between start and end [7]: https://tools.ietf.org/html/rfc7946#section-3.1 -[8]: https://tools.ietf.org/html/rfc7946#section-3.3 +[8]: https://tools.ietf.org/html/rfc7946#section-3.2 -[9]: https://tools.ietf.org/html/rfc7946#section-3.1.6 +[9]: https://tools.ietf.org/html/rfc7946#section-3.3 -[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[10]: https://tools.ietf.org/html/rfc7946#section-3.1.6 [11]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[12]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number + +[13]: https://tools.ietf.org/html/rfc7946#section-3.1.4 + --- diff --git a/packages/turf-simplify/README.md b/packages/turf-simplify/README.md index d071781c5d..7f25ae7e0c 100644 --- a/packages/turf-simplify/README.md +++ b/packages/turf-simplify/README.md @@ -9,12 +9,12 @@ Takes a [GeoJSON][1] object and returns a simplified version. Internally uses ### Parameters -* `geojson` **[GeoJSON][1]** object to be simplified -* `options` **[Object][3]** Optional parameters (optional, default `{}`) +* `geojson` **[GeoJSON][3]** object to be simplified +* `options` **[Object][4]** Optional parameters (optional, default `{}`) - * `options.tolerance` **[number][4]** simplification tolerance (optional, default `1`) - * `options.highQuality` **[boolean][5]** whether or not to spend more time to create a higher-quality simplification with a different algorithm (optional, default `false`) - * `options.mutate` **[boolean][5]** allows GeoJSON input to be mutated (significant performance increase if true) (optional, default `false`) + * `options.tolerance` **[number][5]** simplification tolerance (optional, default `1`) + * `options.highQuality` **[boolean][6]** whether or not to spend more time to create a higher-quality simplification with a different algorithm (optional, default `false`) + * `options.mutate` **[boolean][6]** allows GeoJSON input to be mutated (significant performance increase if true) (optional, default `false`) ### Examples @@ -48,17 +48,19 @@ var simplified = turf.simplify(geojson, options); var addToMap = [geojson, simplified] ``` -Returns **[GeoJSON][1]** a simplified GeoJSON +Returns **[GeoJSON][3]** a simplified GeoJSON [1]: https://tools.ietf.org/html/rfc7946#section-3 [2]: http://mourner.github.io/simplify-js/ -[3]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[3]: https://tools.ietf.org/html/rfc7946#section-3 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number + +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean diff --git a/packages/turf-standard-deviational-ellipse/README.md b/packages/turf-standard-deviational-ellipse/README.md index b56b3583bf..14891014f2 100644 --- a/packages/turf-standard-deviational-ellipse/README.md +++ b/packages/turf-standard-deviational-ellipse/README.md @@ -25,12 +25,12 @@ doi:{@link [https://doi.org/10.1086/214336|10.1086/214336}][5]. ### Parameters -* `points` **[FeatureCollection][1]<[Point][6]>** GeoJSON points -* `options` **[Object][7]** Optional parameters (optional, default `{}`) +* `points` **[FeatureCollection][6]<[Point][7]>** GeoJSON points +* `options` **[Object][8]** Optional parameters (optional, default `{}`) - * `options.weight` **[string][8]?** the property name used to weight the center - * `options.steps` **[number][9]** number of steps for the polygon (optional, default `64`) - * `options.properties` **[Object][7]** properties to pass to the resulting ellipse (optional, default `{}`) + * `options.weight` **[string][9]?** the property name used to weight the center + * `options.steps` **[number][10]** number of steps for the polygon (optional, default `64`) + * `options.properties` **[Object][8]** properties to pass to the resulting ellipse (optional, default `{}`) ### Examples @@ -43,7 +43,7 @@ var sdEllipse = turf.standardDeviationalEllipse(points); var addToMap = [points, sdEllipse]; ``` -Returns **[Feature][10]<[Polygon][11]>** an elliptical Polygon that includes approximately 1 SD of the dataset within it. +Returns **[Feature][11]<[Polygon][12]>** an elliptical Polygon that includes approximately 1 SD of the dataset within it. [1]: https://tools.ietf.org/html/rfc7946#section-3.3 @@ -55,17 +55,19 @@ Returns **[Feature][10]<[Polygon][11]>** an elliptical Polygon that includes app [5]: https://doi.org/10.1086/214336|10.1086/214336} -[6]: https://tools.ietf.org/html/rfc7946#section-3.1.2 +[6]: https://tools.ietf.org/html/rfc7946#section-3.3 -[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object -[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number +[9]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String -[10]: https://tools.ietf.org/html/rfc7946#section-3.2 +[10]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number -[11]: https://tools.ietf.org/html/rfc7946#section-3.1.6 +[11]: https://tools.ietf.org/html/rfc7946#section-3.2 + +[12]: https://tools.ietf.org/html/rfc7946#section-3.1.6 diff --git a/packages/turf-tag/README.md b/packages/turf-tag/README.md index c8c82ed6b2..4dda208adf 100644 --- a/packages/turf-tag/README.md +++ b/packages/turf-tag/README.md @@ -8,10 +8,10 @@ Takes a set of [points][1] and a set of [polygons][2] and/or [multipolygons][3] ### Parameters -* `points` **[FeatureCollection][4]<[Point][1]>** input points -* `polygons` **[FeatureCollection][4]<([Polygon][2] | [MultiPolygon][3])>** input (multi)polygons -* `field` **[string][5]** property in `polygons` to add to joined {} features -* `outField` **[string][5]** property in `points` in which to store joined property from `polygons` +* `points` **[FeatureCollection][4]<[Point][5]>** input points +* `polygons` **[FeatureCollection][4]<([Polygon][6] | [MultiPolygon][7])>** input (multi)polygons +* `field` **[string][8]** property in `polygons` to add to joined {} features +* `outField` **[string][8]** property in `points` in which to store joined property from `polygons` ### Examples @@ -42,7 +42,7 @@ var tagged = turf.tag(points, polygons, 'pop', 'population'); var addToMap = [tagged, polygons] ``` -Returns **[FeatureCollection][4]<[Point][1]>** points with `containingPolyId` property containing values from `polyId` +Returns **[FeatureCollection][4]<[Point][5]>** points with `containingPolyId` property containing values from `polyId` [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -52,7 +52,13 @@ Returns **[FeatureCollection][4]<[Point][1]>** points with `containingPolyId` pr [4]: https://tools.ietf.org/html/rfc7946#section-3.3 -[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.2 + +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + +[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String diff --git a/packages/turf-tin/README.md b/packages/turf-tin/README.md index 5ae8f4f70f..109e7b1112 100644 --- a/packages/turf-tin/README.md +++ b/packages/turf-tin/README.md @@ -15,8 +15,8 @@ triangle. ### Parameters -* `points` **[FeatureCollection][3]<[Point][1]>** input points -* `z` **[String][4]?** name of the property from which to pull z values +* `points` **[FeatureCollection][3]<[Point][4]>** input points +* `z` **[String][5]?** name of the property from which to pull z values This is optional: if not given, then there will be no extra data added to the derived triangles. ### Examples @@ -39,7 +39,7 @@ for (var i = 0; i < tin.features.length; i++) { } ``` -Returns **[FeatureCollection][3]<[Polygon][5]>** TIN output +Returns **[FeatureCollection][3]<[Polygon][6]>** TIN output [1]: https://tools.ietf.org/html/rfc7946#section-3.1.2 @@ -47,9 +47,11 @@ Returns **[FeatureCollection][3]<[Polygon][5]>** TIN output [3]: https://tools.ietf.org/html/rfc7946#section-3.3 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.2 -[5]: https://tools.ietf.org/html/rfc7946#section-3.1.6 +[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String + +[6]: https://tools.ietf.org/html/rfc7946#section-3.1.6 diff --git a/packages/turf-triangle-grid/README.md b/packages/turf-triangle-grid/README.md index 10dcd092d5..0e3805aa15 100644 --- a/packages/turf-triangle-grid/README.md +++ b/packages/turf-triangle-grid/README.md @@ -13,7 +13,7 @@ Takes a bounding box and a cell depth and returns a set of triangular [polygons] * `options` **[Object][4]** Optional parameters (optional, default `{}`) * `options.units` **[string][5]** used in calculating cellSide, can be degrees, radians, miles, or kilometers (optional, default `'kilometers'`) - * `options.mask` **[Feature][6]<[Polygon][1]>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it + * `options.mask` **[Feature][6]<[Polygon][7]>?** if passed a Polygon or MultiPolygon, the grid Points will be created only inside it * `options.properties` **[Object][4]** passed to each point of the grid (optional, default `{}`) ### Examples @@ -29,7 +29,7 @@ var triangleGrid = turf.triangleGrid(bbox, cellSide, options); var addToMap = [triangleGrid]; ``` -Returns **[FeatureCollection][7]<[Polygon][1]>** grid of polygons +Returns **[FeatureCollection][8]<[Polygon][7]>** grid of polygons [1]: https://tools.ietf.org/html/rfc7946#section-3.1.6 @@ -43,7 +43,9 @@ Returns **[FeatureCollection][7]<[Polygon][1]>** grid of polygons [6]: https://tools.ietf.org/html/rfc7946#section-3.2 -[7]: https://tools.ietf.org/html/rfc7946#section-3.3 +[7]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + +[8]: https://tools.ietf.org/html/rfc7946#section-3.3 diff --git a/packages/turf-union/README.md b/packages/turf-union/README.md index 42f68d4848..b21344f10e 100644 --- a/packages/turf-union/README.md +++ b/packages/turf-union/README.md @@ -8,10 +8,10 @@ Takes input [(Multi)Polygon(s)][1] and returns a combined polygon. If the input ### Parameters -* `polygon1` **[Feature][3]<([Polygon][1] | [MultiPolygon][2])>** input Polygon features -* `options` **[Object][4]** Optional Parameters (optional, default `{}`) +* `polygon1` **[Feature][3]<([Polygon][4] | [MultiPolygon][5])>** input Polygon features +* `options` **[Object][6]** Optional Parameters (optional, default `{}`) - * `options.properties` **[Object][4]** Translate Properties to output Feature (optional, default `{}`) + * `options.properties` **[Object][6]** Translate Properties to output Feature (optional, default `{}`) ### Examples @@ -37,7 +37,7 @@ var union = turf.union(turf.featureCollection([poly1, poly2])); var addToMap = [poly1, poly2, union]; ``` -Returns **[Feature][3]<([Polygon][1] | [MultiPolygon][2])>** a combined [Polygon][1] or [MultiPolygon][2] feature, or null if the inputs are empty +Returns **[Feature][3]<([Polygon][4] | [MultiPolygon][5])>** a combined [Polygon][1] or [MultiPolygon][2] feature, or null if the inputs are empty [1]: https://tools.ietf.org/html/rfc7946#section-3.1.6 @@ -45,7 +45,11 @@ Returns **[Feature][3]<([Polygon][1] | [MultiPolygon][2])>** a combined [Polygon [3]: https://tools.ietf.org/html/rfc7946#section-3.2 -[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object +[4]: https://tools.ietf.org/html/rfc7946#section-3.1.6 + +[5]: https://tools.ietf.org/html/rfc7946#section-3.1.7 + +[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c7b514006e..90f5436f02 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,18 @@ importers: .: devDependencies: + '@monorepolint/cli': + specifier: 0.5.0-alpha.132 + version: 0.5.0-alpha.132 + '@monorepolint/config': + specifier: 0.5.0-alpha.132 + version: 0.5.0-alpha.132 + '@monorepolint/core': + specifier: 0.5.0-alpha.132 + version: 0.5.0-alpha.132 + '@monorepolint/rules': + specifier: 0.5.0-alpha.132 + version: 0.5.0-alpha.132 '@types/geojson': specifier: 7946.0.8 version: 7946.0.8 @@ -57,8 +69,8 @@ importers: specifier: ^11.1.1 version: 11.2.0 husky: - specifier: ^4.3.8 - version: 4.3.8 + specifier: ^8.0.0 + version: 8.0.3 lerna: specifier: ^7.4.2 version: 7.4.2 @@ -71,9 +83,6 @@ importers: meow: specifier: ^12.1.1 version: 12.1.1 - monorepolint: - specifier: ^0.5.0-alpha.20 - version: 0.5.0-alpha.132 npm-run-all: specifier: ^4.1.5 version: 4.1.5 @@ -7764,7 +7773,7 @@ packages: resolution: {integrity: sha512-je+kkrfcvPcwL5Tg8JRENRqlbzjdlZXyaR88UcnCdNW0AJ1jX9IfHRys1X7AwSroU2ug8ESNC+suoBw1vX833Q==} engines: {node: '>=16.0.0'} dependencies: - chalk: 4.1.0 + chalk: 4.1.2 execa: 5.0.0 strong-log-transformer: 2.1.0 dev: true @@ -7906,17 +7915,6 @@ packages: tslib: 2.6.2 dev: true - /@monorepolint/internal-mrl-config@0.5.0-alpha.132: - resolution: {integrity: sha512-OnJ0nXG8yKut6mf79DtOJq/9sgcYjau9GlLfCJTgWmmKSr5tToLfbXeqHYith9fq6cXStnAmf0ez5PzSl8zvBA==} - engines: {node: '>=18'} - dependencies: - '@monorepolint/config': 0.5.0-alpha.132 - '@monorepolint/core': 0.5.0-alpha.132 - '@monorepolint/rules': 0.5.0-alpha.132 - '@monorepolint/utils': 0.5.0-alpha.132 - tslib: 2.6.2 - dev: true - /@monorepolint/rules@0.5.0-alpha.132: resolution: {integrity: sha512-HxsQUYTeQBKcTQ0WNgASXfwBYGnfht356nxApfCVG26k0iaFgkLb6VN7uxV56y/cS5eNMiGKRIQY1RLhoLn9Hg==} engines: {node: '>=18'} @@ -9810,10 +9808,6 @@ packages: resolution: {integrity: sha512-slVGC45odKFB6KzD/hpXP8XgS/Y+x72X1ckAhxU/9YZecCy8VwCJUSZsn0O4gQUwaTogun6IfrSiK3YuQaADFw==} dev: true - /ci-info@2.0.0: - resolution: {integrity: sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==} - dev: true - /ci-info@3.9.0: resolution: {integrity: sha512-NIxF55hv4nSqQswkAeiOi1r83xy8JldOFDTWiug55KBu9Jnblncd2U6ViHmYgHf01TPZS77NJBhBMKdWj9HQMQ==} engines: {node: '>=8'} @@ -10037,10 +10031,6 @@ packages: dot-prop: 5.3.0 dev: true - /compare-versions@3.6.0: - resolution: {integrity: sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==} - dev: true - /component-emitter@1.3.1: resolution: {integrity: sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==} dev: true @@ -11620,13 +11610,6 @@ packages: unicorn-magic: 0.1.0 dev: true - /find-versions@4.0.0: - resolution: {integrity: sha512-wgpWy002tA+wgmO27buH/9KzyEOQnKsG/R0yrcjPT9BOFm0zRBVQbZ95nRGXWMywS8YR5knRbpohio0bcJABxQ==} - engines: {node: '>=10'} - dependencies: - semver-regex: 3.1.4 - dev: true - /flat-cache@3.2.0: resolution: {integrity: sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==} engines: {node: ^10.12.0 || >=12.0.0} @@ -12045,7 +12028,7 @@ packages: fs.realpath: 1.0.0 inflight: 1.0.6 inherits: 2.0.4 - minimatch: 3.0.5 + minimatch: 3.1.2 once: 1.4.0 path-is-absolute: 1.0.1 dev: true @@ -12391,22 +12374,10 @@ packages: ms: 2.1.3 dev: true - /husky@4.3.8: - resolution: {integrity: sha512-LCqqsB0PzJQ/AlCgfrfzRe3e3+NvmefAdKQhRYpxS4u6clblBoDdzzvHi8fmxKRzvMxPY/1WZWzomPZww0Anow==} - engines: {node: '>=10'} + /husky@8.0.3: + resolution: {integrity: sha512-+dQSyqPh4x1hlO1swXBiNb2HzTDN1I2IGLQx1GrBuiqFJfoMrnZWwVmatvSiO+Iz8fBUnf+lekwNo4c2LlXItg==} + engines: {node: '>=14'} hasBin: true - requiresBuild: true - dependencies: - chalk: 4.1.2 - ci-info: 2.0.0 - compare-versions: 3.6.0 - cosmiconfig: 7.1.0 - find-versions: 4.0.0 - opencollective-postinstall: 2.0.3 - pkg-dir: 5.0.0 - please-upgrade-node: 3.2.0 - slash: 3.0.0 - which-pm-runs: 1.1.0 dev: true /iconv-lite@0.4.24: @@ -13024,7 +12995,7 @@ packages: hasBin: true dependencies: async: 3.2.5 - chalk: 4.1.0 + chalk: 4.1.2 filelist: 1.0.4 minimatch: 3.1.2 dev: true @@ -13033,7 +13004,7 @@ packages: resolution: {integrity: sha512-LMIgiIrhigmPrs03JHpxUh2yISK3vLFPkAodPeo0+BuF7wA2FoQbkEg1u8gBYBThncu7e1oEDUfIXVuTqLRUjw==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - chalk: 4.1.0 + chalk: 4.1.2 diff-sequences: 29.6.3 jest-get-type: 29.6.3 pretty-format: 29.7.0 @@ -14154,18 +14125,6 @@ packages: - supports-color dev: true - /monorepolint@0.5.0-alpha.132: - resolution: {integrity: sha512-f3fyafG/VvbQv5egzZGchUaW8Kfc/fcjCJ6ycOisl0Sa9zBYE0hni5+iI7tRkUCW6zFttQvwIJaoGiE2RKoXLg==} - engines: {node: '>=18'} - dependencies: - '@monorepolint/cli': 0.5.0-alpha.132 - '@monorepolint/config': 0.5.0-alpha.132 - '@monorepolint/core': 0.5.0-alpha.132 - '@monorepolint/internal-mrl-config': 0.5.0-alpha.132 - '@monorepolint/rules': 0.5.0-alpha.132 - '@monorepolint/utils': 0.5.0-alpha.132 - dev: true - /ms@2.0.0: resolution: {integrity: sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==} dev: true @@ -14186,7 +14145,7 @@ packages: array-differ: 3.0.0 array-union: 2.1.0 arrify: 2.0.1 - minimatch: 3.0.5 + minimatch: 3.1.2 dev: true /mute-stream@0.0.8: @@ -14525,7 +14484,7 @@ packages: '@yarnpkg/parsers': 3.0.0-rc.46 '@zkochan/js-yaml': 0.0.6 axios: 1.6.2 - chalk: 4.1.0 + chalk: 4.1.2 cli-cursor: 3.1.0 cli-spinners: 2.6.1 cliui: 8.0.1 @@ -14668,11 +14627,6 @@ packages: is-wsl: 2.2.0 dev: true - /opencollective-postinstall@2.0.3: - resolution: {integrity: sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==} - hasBin: true - dev: true - /optionator@0.9.3: resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} engines: {node: '>= 0.8.0'} @@ -15080,13 +15034,6 @@ packages: find-up: 4.1.0 dev: true - /pkg-dir@5.0.0: - resolution: {integrity: sha512-NPE8TDbzl/3YQYY7CSS228s3g2ollTFnc+Qi3tqmqJp9Vg2ovUpixcJEo2HJScN2Ez+kEaal6y70c0ehqJBJeA==} - engines: {node: '>=10'} - dependencies: - find-up: 5.0.0 - dev: true - /platform@1.3.6: resolution: {integrity: sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==} dev: true @@ -15911,11 +15858,6 @@ packages: resolution: {integrity: sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==} dev: true - /semver-regex@3.1.4: - resolution: {integrity: sha512-6IiqeZNgq01qGf0TId0t3NvKzSvUsjcpdEO3AQNeIjR6A2+ckTnQlDpl4qu1bjRv0RzN3FP9hzFmws3lKqRWkA==} - engines: {node: '>=8'} - dev: true - /semver@5.7.2: resolution: {integrity: sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==} hasBin: true @@ -17511,11 +17453,6 @@ packages: resolution: {integrity: sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==} dev: true - /which-pm-runs@1.1.0: - resolution: {integrity: sha512-n1brCuqClxfFfq/Rb0ICg9giSZqCS+pLtccdag6C2HyufBrh3fBOiy9nb6ggRMvWOVH5GrdJskj5iGTZNxd7SA==} - engines: {node: '>=4'} - dev: true - /which-typed-array@1.1.13: resolution: {integrity: sha512-P5Nra0qjSncduVPEAr7xhoF5guty49ArDTwzJ/yNuPIbZppyRxFQsRCWrocxIY+CnMVG+qfbU2FmDKyvSGClow==} engines: {node: '>= 0.4'} From 01c6a49a3c02d6f2eae6abe481e730740c8cb695 Mon Sep 17 00:00:00 2001 From: Matthew Fedderly Date: Tue, 19 Dec 2023 15:50:02 -0500 Subject: [PATCH 2/4] Remove some unused monorepolint variables --- .monorepolint.config.mjs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.monorepolint.config.mjs b/.monorepolint.config.mjs index 505ae8ab27..b4e165729c 100644 --- a/.monorepolint.config.mjs +++ b/.monorepolint.config.mjs @@ -41,12 +41,6 @@ glob.sync(path.join(__dirname, "packages", "turf-*")).forEach((pk) => { } }); -const TS_BENCH_PACKAGES = BENCH_PACKAGES.filter( - (pkg) => -1 !== TS_PACKAGES.indexOf(pkg) -); -const JS_BENCH_PACKAGES = BENCH_PACKAGES.filter( - (pkg) => -1 !== JS_PACKAGES.indexOf(pkg) -); const TS_TAPE_PACKAGES = TAPE_PACKAGES.filter( (pkg) => -1 !== TS_PACKAGES.indexOf(pkg) ); From 2755f54fbe4ecf386ba45b1bbf74e0d1a856cd4d Mon Sep 17 00:00:00 2001 From: Matthew Fedderly Date: Tue, 19 Dec 2023 15:58:19 -0500 Subject: [PATCH 3/4] Revert dbscan change --- packages/turf-clusters-dbscan/index.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/turf-clusters-dbscan/index.ts b/packages/turf-clusters-dbscan/index.ts index f24a3df534..b307bb64ed 100644 --- a/packages/turf-clusters-dbscan/index.ts +++ b/packages/turf-clusters-dbscan/index.ts @@ -2,6 +2,7 @@ import { GeoJsonProperties, FeatureCollection, Point } from "geojson"; import { clone } from "@turf/clone"; import { distance } from "@turf/distance"; import { degreesToRadians, lengthToDegrees, Units } from "@turf/helpers"; +// @ts-expect-error No types available for rbush. import RBush from "rbush"; type Dbscan = "core" | "edge" | "noise"; From 061df7d6ff32f379f167198bbcde7abd41b84b20 Mon Sep 17 00:00:00 2001 From: Matthew Fedderly Date: Tue, 19 Dec 2023 16:07:55 -0500 Subject: [PATCH 4/4] Add glob explicitly --- package.json | 1 + pnpm-lock.yaml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/package.json b/package.json index 715b6708f9..c395c00fcf 100644 --- a/package.json +++ b/package.json @@ -49,6 +49,7 @@ "eslint-plugin-prettier": "^5.0.1", "esm": "^3.2.25", "fs-extra": "^11.1.1", + "glob": "^10.3.10", "husky": "^8.0.0", "lerna": "^7.4.2", "lint-staged": "^10.5.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 90f5436f02..44ba1cd807 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -68,6 +68,9 @@ importers: fs-extra: specifier: ^11.1.1 version: 11.2.0 + glob: + specifier: ^10.3.10 + version: 10.3.10 husky: specifier: ^8.0.0 version: 8.0.3