From 474e72f713866ca88c75614bdcb29bc96a644488 Mon Sep 17 00:00:00 2001 From: stebogit Date: Mon, 11 Sep 2017 23:34:47 -0700 Subject: [PATCH 01/11] implements new module --- packages/turf-nearest-point-to-line/LICENSE | 20 + packages/turf-nearest-point-to-line/README.md | 51 + packages/turf-nearest-point-to-line/bench.js | 36 + .../turf-nearest-point-to-line/index.d.ts | 12 + packages/turf-nearest-point-to-line/index.js | 45 + .../turf-nearest-point-to-line/package.json | 47 + packages/turf-nearest-point-to-line/test.js | 53 + .../test/in/fiji.geojson | 101 ++ .../test/in/on-line.geojson | 146 ++ .../test/in/one.geojson | 71 + .../test/in/resolute.geojson | 79 + .../test/in/two.geojson | 83 + .../test/out/fiji.geojson | 46 + .../test/out/on-line.geojson | 58 + .../test/out/one.geojson | 46 + .../test/out/resolute.geojson | 46 + .../test/out/two.geojson | 50 + packages/turf-nearest-point-to-line/yarn.lock | 1449 +++++++++++++++++ 18 files changed, 2439 insertions(+) create mode 100644 packages/turf-nearest-point-to-line/LICENSE create mode 100644 packages/turf-nearest-point-to-line/README.md create mode 100644 packages/turf-nearest-point-to-line/bench.js create mode 100644 packages/turf-nearest-point-to-line/index.d.ts create mode 100644 packages/turf-nearest-point-to-line/index.js create mode 100644 packages/turf-nearest-point-to-line/package.json create mode 100644 packages/turf-nearest-point-to-line/test.js create mode 100644 packages/turf-nearest-point-to-line/test/in/fiji.geojson create mode 100644 packages/turf-nearest-point-to-line/test/in/on-line.geojson create mode 100644 packages/turf-nearest-point-to-line/test/in/one.geojson create mode 100644 packages/turf-nearest-point-to-line/test/in/resolute.geojson create mode 100644 packages/turf-nearest-point-to-line/test/in/two.geojson create mode 100644 packages/turf-nearest-point-to-line/test/out/fiji.geojson create mode 100644 packages/turf-nearest-point-to-line/test/out/on-line.geojson create mode 100644 packages/turf-nearest-point-to-line/test/out/one.geojson create mode 100644 packages/turf-nearest-point-to-line/test/out/resolute.geojson create mode 100644 packages/turf-nearest-point-to-line/test/out/two.geojson create mode 100644 packages/turf-nearest-point-to-line/yarn.lock diff --git a/packages/turf-nearest-point-to-line/LICENSE b/packages/turf-nearest-point-to-line/LICENSE new file mode 100644 index 0000000000..96ce51b76f --- /dev/null +++ b/packages/turf-nearest-point-to-line/LICENSE @@ -0,0 +1,20 @@ +The MIT License (MIT) + +Copyright (c) 2017 TurfJS + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR +COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER +IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/packages/turf-nearest-point-to-line/README.md b/packages/turf-nearest-point-to-line/README.md new file mode 100644 index 0000000000..71de0c3003 --- /dev/null +++ b/packages/turf-nearest-point-to-line/README.md @@ -0,0 +1,51 @@ +# @turf/nearest-point-to-line + +# nearestPointToLine + +Returns the closest [point](http://geojson.org/geojson-spec.html#point), of a [collection](http://geojson.org/geojson-spec.html#feature-collection-objects) of points, to a [line](http://geojson.org/geojson-spec.html#linestring). +The returned point has a `dist` property indicating its distance to the line. + +**Parameters** + +- `points` **[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)<[Point](http://geojson.org/geojson-spec.html#point)>** collection +- `line` **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[LineString](http://geojson.org/geojson-spec.html#linestring)>** Feature +- `units` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** can be degrees, radians, miles, or kilometers (optional, default `kilometers`) + +**Examples** + +```javascript +var points = featureCollection([point([0, 0]), point([0.5, 0.5])]); +var line = lineString([[1,1], [-1,1]]); + +var nearest = turf.nearestPointToLine(points, line); + +//addToMap +var addToMap = [nearest, line]; +``` + +Returns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[Point](http://geojson.org/geojson-spec.html#point)>** the closest point + + + +--- + +This module is part of the [Turfjs project](http://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 module individually: + +```sh +$ npm install @turf/nearest-point-to-line +``` + +Or install the Turf module that includes it as a function: + +```sh +$ npm install @turf/turf +``` diff --git a/packages/turf-nearest-point-to-line/bench.js b/packages/turf-nearest-point-to-line/bench.js new file mode 100644 index 0000000000..1ad5026c41 --- /dev/null +++ b/packages/turf-nearest-point-to-line/bench.js @@ -0,0 +1,36 @@ +const path = require('path'); +const glob = require('glob'); +const load = require('load-json-file'); +const Benchmark = require('benchmark'); +const nearestPointToLine = require('./'); + +/** + * Benchmark Results + * + * fiji: 2.973ms + * on-line: 0.758ms + * one: 0.549ms + * resolute: 0.349ms + * two: 0.358ms + * + * fiji x 36,409 ops/sec ±4.14% (69 runs sampled) + * on-line x 14,044 ops/sec ±4.92% (69 runs sampled) + * one x 65,604 ops/sec ±11.55% (64 runs sampled) + * resolute x 44,962 ops/sec ±6.76% (67 runs sampled) + * two x 42,690 ops/sec ±2.34% (76 runs sampled) + */ +const suite = new Benchmark.Suite('turf-nearest-point-to-line'); +glob.sync(path.join(__dirname, 'test', 'in', '*.geojson')).forEach(filepath => { + const {name} = path.parse(filepath); + const geojson = load.sync(filepath); + const [points, line] = geojson.features; + console.time(name); + nearestPointToLine(points, line); + console.timeEnd(name); + suite.add(name, () => nearestPointToLine(points, line)); +}); + +suite + .on('cycle', e => console.log(String(e.target))) + .on('complete', () => {}) + .run(); diff --git a/packages/turf-nearest-point-to-line/index.d.ts b/packages/turf-nearest-point-to-line/index.d.ts new file mode 100644 index 0000000000..fbfea55aad --- /dev/null +++ b/packages/turf-nearest-point-to-line/index.d.ts @@ -0,0 +1,12 @@ +/// + +type Points = GeoJSON.FeatureCollection; +type LineString = GeoJSON.LineString; +type Point = GeoJSON.Feature | GeoJSON.Point; + +/** + * http://turfjs.org/docs/#nearestpointtoline + */ +declare function nearestPointToLine(points: Points, line: LineString): Point; +declare namespace nearestPointToLine { } +export = nearestPointToLine; diff --git a/packages/turf-nearest-point-to-line/index.js b/packages/turf-nearest-point-to-line/index.js new file mode 100644 index 0000000000..bb002dcfee --- /dev/null +++ b/packages/turf-nearest-point-to-line/index.js @@ -0,0 +1,45 @@ +var meta = require('@turf/meta'); +var invariant = require('@turf/invariant'); +var pointToLineDistance = require('@turf/point-to-line-distance'); +var featureOf = invariant.featureOf; +var featureEach = meta.featureEach; +var collectionOf = invariant.collectionOf; + +/** + * Returns the closest {@link Point|point}, of a {@link FeatureCollection|collection} of points, to a {@link LineString|line}. + * The returned point has a `dist` property indicating its distance to the line. + * + * @name nearestPointToLine + * @param {FeatureCollection} points collection + * @param {Feature} line Feature + * @param {string} [units=kilometers] can be degrees, radians, miles, or kilometers + * @returns {Feature} the closest point + * @example + * var points = featureCollection([point([0, 0]), point([0.5, 0.5])]); + * var line = lineString([[1,1], [-1,1]]); + * + * var nearest = turf.nearestPointToLine(points, line); + * + * //addToMap + * var addToMap = [nearest, line]; + */ +module.exports = function (points, line, units) { + // validation + if (!points) throw new Error('points is required'); + else collectionOf(points, 'Point', 'points'); + if (!line) throw new Error('line is required'); + else featureOf(line, 'LineString', 'line'); + + var dist = Infinity; + var pt = null; + featureEach(points, function (point) { + var d = pointToLineDistance(point, line, units); + if (d < dist) { + dist = d; + pt = point; + } + }); + + pt.properties.dist = dist; + return pt; +}; diff --git a/packages/turf-nearest-point-to-line/package.json b/packages/turf-nearest-point-to-line/package.json new file mode 100644 index 0000000000..a0beabc13e --- /dev/null +++ b/packages/turf-nearest-point-to-line/package.json @@ -0,0 +1,47 @@ +{ + "name": "@turf/nearest-point-to-line", + "version": "4.0.0", + "description": "turf nearest-point-to-line module", + "main": "index.js", + "types": "index.d.ts", + "files": [ + "index.js", + "index.d.ts" + ], + "scripts": { + "test": "node test.js", + "bench": "node bench.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/Turfjs/turf.git" + }, + "keywords": [ + "turf", + "geojson", + "gis", + "near", + "nearest-point-to-line" + ], + "author": "Turf Authors", + "contributors": [ + "Stefano Borghi <@stebogit>" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/Turfjs/turf/issues" + }, + "homepage": "https://github.com/Turfjs/turf", + "devDependencies": { + "@turf/helpers": "4.7.1", + "benchmark": "^2.1.4", + "write-json-file": "^2.2.0", + "load-json-file": "^2.0.0", + "tape": "^4.6.3" + }, + "dependencies": { + "@turf/point-to-line-distance": "4.7.1", + "@turf/meta": "4.7.1", + "@turf/invariant": "4.7.1" + } +} diff --git a/packages/turf-nearest-point-to-line/test.js b/packages/turf-nearest-point-to-line/test.js new file mode 100644 index 0000000000..7d0e3b6b6e --- /dev/null +++ b/packages/turf-nearest-point-to-line/test.js @@ -0,0 +1,53 @@ +const fs = require('fs'); +const test = require('tape'); +const path = require('path'); +const load = require('load-json-file'); +const write = require('write-json-file'); +const {featureCollection, point, lineString} = require('@turf/helpers'); +const nearestPointToLine = require('./'); + +const directories = { + in: path.join(__dirname, 'test', 'in') + path.sep, + out: path.join(__dirname, 'test', 'out') + path.sep +}; + +const fixtures = fs.readdirSync(directories.in).map(filename => { + return { + filename, + name: path.parse(filename).name, + geojson: load.sync(directories.in + filename) + }; +}); + +test('turf-nearest-point-to-line', t => { + for (const {filename, name, geojson} of fixtures) { + const [points, line] = geojson.features; + let {units} = geojson.properties || {}; + const nearest = nearestPointToLine(points, line, units); + nearest.properties = Object.assign(nearest.properties, { + 'marker-color': '#F00', + 'marker-size': 'large', + 'marker-symbol': 'star' + }); + const results = featureCollection([nearest, line]); + + if (process.env.REGEN) write.sync(directories.out + filename, results); + t.deepEqual(results, load.sync(directories.out + filename), name); + } + t.end(); +}); + + +test('turf-nearest-point-to-line -- throws', t => { + const points = featureCollection([point([0, 0]), point([0, 1])]); + const line = lineString([[1,1], [-1,1]]); + + t.throws(() => nearestPointToLine(null, line), /points is required/, 'missing points'); + t.throws(() => nearestPointToLine(points, null), /line is required/, 'missing line'); + + t.throws(() => nearestPointToLine(points, line, 'invalid'), /units is invalid/, 'invalid units'); + t.throws(() => nearestPointToLine(points, points), /Invalid input to line, Feature with geometry required/, 'invalid line'); + t.throws(() => nearestPointToLine(line, line), /Invalid input to points, FeatureCollection required/, 'invalid points'); + + t.end(); +}); diff --git a/packages/turf-nearest-point-to-line/test/in/fiji.geojson b/packages/turf-nearest-point-to-line/test/in/fiji.geojson new file mode 100644 index 0000000000..95780bcff6 --- /dev/null +++ b/packages/turf-nearest-point-to-line/test/in/fiji.geojson @@ -0,0 +1,101 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 180.60699462890625, + -16.62303335009946 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 181.0986328125, + -17.027898881942694 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 179.10186767578125, + -17.413546114374437 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 180.516357421875, + -17.287709050621917 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 179.37103271484375, + -16.691447830122993 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 180.25817871093747, + -16.95435146120393 + ] + } + } + ] + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 179.68139648437497, + -16.607241925191516 + ], + [ + 180.6427001953125, + -16.935960102864705 + ], + [ + 179.58251953125, + -17.07253857905758 + ], + [ + 180.29937744140625, + -17.460712710429785 + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/packages/turf-nearest-point-to-line/test/in/on-line.geojson b/packages/turf-nearest-point-to-line/test/in/on-line.geojson new file mode 100644 index 0000000000..f83e1a4b69 --- /dev/null +++ b/packages/turf-nearest-point-to-line/test/in/on-line.geojson @@ -0,0 +1,146 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -23.62060546875, + 15.050905707724771 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -22.813110351562496, + 16.093320185359257 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -23.1646728515625, + 15.220589019578128 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -24.4061279296875, + 14.966013251567164 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -22.93670654296875, + 16.759837823776632 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -24.3182373046875, + 16.609873919524187 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -24.98291015625, + 16.867633616803836 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -25.191650390625, + 17.056784609942554 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -22.818603515625, + 15.31597593426845 + ] + } + } + ] + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -24.10400390625, + 13.864747046142286 + ], + [ + -24.049072265625, + 15.739388446649146 + ], + [ + -23.016357421875, + 14.82799134735208 + ], + [ + -22.818603515625, + 15.31597593426845 + ], + [ + -22.3077392578125, + 16.399200837347113 + ], + [ + -23.510742187499996, + 16.409739933377747 + ], + [ + -24.4500732421875, + 17.528820674552627 + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/packages/turf-nearest-point-to-line/test/in/one.geojson b/packages/turf-nearest-point-to-line/test/in/one.geojson new file mode 100644 index 0000000000..443c1683fa --- /dev/null +++ b/packages/turf-nearest-point-to-line/test/in/one.geojson @@ -0,0 +1,71 @@ +{ + "type": "FeatureCollection", + "properties": { + "units": "miles" + }, + "features": [ + { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 29.7509765625, + 17.5602465032949 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 28.388671875, + 18.323240460443397 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 29.619140624999996, + 19.228176737766262 + ] + } + } + ] + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 27.015380859374996, + 15.008463695004872 + ], + [ + 29.168701171875, + 17.256236314156425 + ], + [ + 32.003173828125, + 16.36230951024085 + ], + [ + 33.2666015625, + 18.999802829053262 + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/packages/turf-nearest-point-to-line/test/in/resolute.geojson b/packages/turf-nearest-point-to-line/test/in/resolute.geojson new file mode 100644 index 0000000000..7d03aabb7d --- /dev/null +++ b/packages/turf-nearest-point-to-line/test/in/resolute.geojson @@ -0,0 +1,79 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -94.04296874999999, + 75.24186616026972 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -75.1025390625, + 74.66001636880338 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -87.2314453125, + 75.50815837230884 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -95.8447265625, + 71.80141030136785 + ] + } + } + ] + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -88.06640625, + 75.397779424116 + ], + [ + -104.6337890625, + 72.69883881004748 + ], + [ + -91.4501953125, + 72.99690914812648 + ], + [ + -89.1650390625, + 71.71888229713917 + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/packages/turf-nearest-point-to-line/test/in/two.geojson b/packages/turf-nearest-point-to-line/test/in/two.geojson new file mode 100644 index 0000000000..74a9aee526 --- /dev/null +++ b/packages/turf-nearest-point-to-line/test/in/two.geojson @@ -0,0 +1,83 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -32.7392578125, + 28.76765910569123 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -36.25488281249999, + 23.36242859340884 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -38.0126953125, + 26.194876675795218 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + -39.90234375, + 27.059125784374068 + ] + } + } + ] + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -45.791015625, + 23.96617587126503 + ], + [ + -42.0556640625, + 27.332735136859146 + ], + [ + -41.572265625, + 23.40276490540795 + ], + [ + -36.474609375, + 28.844673680771795 + ], + [ + -43.1103515625, + 29.267232865200878 + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/packages/turf-nearest-point-to-line/test/out/fiji.geojson b/packages/turf-nearest-point-to-line/test/out/fiji.geojson new file mode 100644 index 0000000000..cab104c448 --- /dev/null +++ b/packages/turf-nearest-point-to-line/test/out/fiji.geojson @@ -0,0 +1,46 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "dist": 3.505316815985152, + "marker-color": "#F00", + "marker-size": "large", + "marker-symbol": "star" + }, + "geometry": { + "type": "Point", + "coordinates": [ + 180.25817871093747, + -16.95435146120393 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 179.68139648437497, + -16.607241925191516 + ], + [ + 180.6427001953125, + -16.935960102864705 + ], + [ + 179.58251953125, + -17.07253857905758 + ], + [ + 180.29937744140625, + -17.460712710429785 + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/packages/turf-nearest-point-to-line/test/out/on-line.geojson b/packages/turf-nearest-point-to-line/test/out/on-line.geojson new file mode 100644 index 0000000000..c077f77192 --- /dev/null +++ b/packages/turf-nearest-point-to-line/test/out/on-line.geojson @@ -0,0 +1,58 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "dist": 0, + "marker-color": "#F00", + "marker-size": "large", + "marker-symbol": "star" + }, + "geometry": { + "type": "Point", + "coordinates": [ + -22.818603515625, + 15.31597593426845 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -24.10400390625, + 13.864747046142286 + ], + [ + -24.049072265625, + 15.739388446649146 + ], + [ + -23.016357421875, + 14.82799134735208 + ], + [ + -22.818603515625, + 15.31597593426845 + ], + [ + -22.3077392578125, + 16.399200837347113 + ], + [ + -23.510742187499996, + 16.409739933377747 + ], + [ + -24.4500732421875, + 17.528820674552627 + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/packages/turf-nearest-point-to-line/test/out/one.geojson b/packages/turf-nearest-point-to-line/test/out/one.geojson new file mode 100644 index 0000000000..d8d5dacc0d --- /dev/null +++ b/packages/turf-nearest-point-to-line/test/out/one.geojson @@ -0,0 +1,46 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "dist": 31.801420214887205, + "marker-color": "#F00", + "marker-size": "large", + "marker-symbol": "star" + }, + "geometry": { + "type": "Point", + "coordinates": [ + 29.7509765625, + 17.5602465032949 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 27.015380859374996, + 15.008463695004872 + ], + [ + 29.168701171875, + 17.256236314156425 + ], + [ + 32.003173828125, + 16.36230951024085 + ], + [ + 33.2666015625, + 18.999802829053262 + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/packages/turf-nearest-point-to-line/test/out/resolute.geojson b/packages/turf-nearest-point-to-line/test/out/resolute.geojson new file mode 100644 index 0000000000..ebf6b667ef --- /dev/null +++ b/packages/turf-nearest-point-to-line/test/out/resolute.geojson @@ -0,0 +1,46 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "dist": 26.36054588905259, + "marker-color": "#F00", + "marker-size": "large", + "marker-symbol": "star" + }, + "geometry": { + "type": "Point", + "coordinates": [ + -87.2314453125, + 75.50815837230884 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -88.06640625, + 75.397779424116 + ], + [ + -104.6337890625, + 72.69883881004748 + ], + [ + -91.4501953125, + 72.99690914812648 + ], + [ + -89.1650390625, + 71.71888229713917 + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/packages/turf-nearest-point-to-line/test/out/two.geojson b/packages/turf-nearest-point-to-line/test/out/two.geojson new file mode 100644 index 0000000000..9ff37352b6 --- /dev/null +++ b/packages/turf-nearest-point-to-line/test/out/two.geojson @@ -0,0 +1,50 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "dist": 78.10416655465308, + "marker-color": "#F00", + "marker-size": "large", + "marker-symbol": "star" + }, + "geometry": { + "type": "Point", + "coordinates": [ + -38.0126953125, + 26.194876675795218 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + -45.791015625, + 23.96617587126503 + ], + [ + -42.0556640625, + 27.332735136859146 + ], + [ + -41.572265625, + 23.40276490540795 + ], + [ + -36.474609375, + 28.844673680771795 + ], + [ + -43.1103515625, + 29.267232865200878 + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/packages/turf-nearest-point-to-line/yarn.lock b/packages/turf-nearest-point-to-line/yarn.lock new file mode 100644 index 0000000000..5c7f091cf7 --- /dev/null +++ b/packages/turf-nearest-point-to-line/yarn.lock @@ -0,0 +1,1449 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@mapbox/geojson-area@^0.2.2": + version "0.2.2" + resolved "https://registry.yarnpkg.com/@mapbox/geojson-area/-/geojson-area-0.2.2.tgz#18d7814aa36bf23fbbcc379f8e26a22927debf10" + dependencies: + wgs84 "0.0.0" + +"@turf/along@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/along/-/along-4.7.1.tgz#1d6af7eec01a0f185ac2a2db95dcf14b3218d086" + dependencies: + "@turf/bearing" "4.7.1" + "@turf/destination" "4.7.1" + "@turf/distance" "4.7.1" + "@turf/helpers" "4.7.1" + +"@turf/area@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/area/-/area-4.7.1.tgz#fd66c85970f24542b831d5b1150fe0882df705c7" + dependencies: + "@mapbox/geojson-area" "^0.2.2" + "@turf/meta" "4.7.1" + +"@turf/area@^3.13.0", "@turf/area@^3.7.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@turf/area/-/area-3.14.0.tgz#f3197ed4e9710d02cd8bbd551b25c476fe47e89b" + dependencies: + "@mapbox/geojson-area" "^0.2.2" + "@turf/meta" "^3.14.0" + +"@turf/bbox-clip@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/bbox-clip/-/bbox-clip-4.7.1.tgz#a02324d0e847ed293970c99cdd9f5f4efe3b3f34" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + lineclip "^1.1.5" + +"@turf/bbox-polygon@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/bbox-polygon/-/bbox-polygon-4.7.1.tgz#3c698de626e8ba4e586940cbb77b7daa03d0a45d" + dependencies: + "@turf/helpers" "4.7.1" + +"@turf/bbox@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/bbox/-/bbox-4.7.1.tgz#c2f05ec2bec10b9a3b4e045400aafab35b2f4cff" + dependencies: + "@turf/meta" "4.7.1" + +"@turf/bbox@^3.14.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@turf/bbox/-/bbox-3.14.0.tgz#cee5f396dde78aca9cede05e1122db18bc504635" + dependencies: + "@turf/meta" "^3.14.0" + +"@turf/bearing@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/bearing/-/bearing-4.7.1.tgz#2b442f76a77e9813fb24f18ea29484018e8fa30d" + dependencies: + "@turf/invariant" "4.7.1" + +"@turf/bezier@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/bezier/-/bezier-4.7.1.tgz#3a91b78edf03dca79878ca7585291437d3918ec3" + dependencies: + "@turf/helpers" "4.7.1" + +"@turf/boolean-clockwise@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/boolean-clockwise/-/boolean-clockwise-4.7.1.tgz#8a6a0db243d6e37c75d99f3fc2272dc3c1847544" + dependencies: + "@turf/invariant" "4.7.1" + +"@turf/boolean-contains@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/boolean-contains/-/boolean-contains-4.7.1.tgz#9c2d32364f6d409fd35ed87a8aff2e9b42c9567c" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/boolean-point-on-line" "4.7.1" + "@turf/inside" "4.7.1" + "@turf/invariant" "4.7.1" + +"@turf/boolean-crosses@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/boolean-crosses/-/boolean-crosses-4.7.1.tgz#87c614f9fb9147486701d2886b1533dcee49cf3e" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/inside" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/line-intersect" "4.7.1" + "@turf/polygon-to-linestring" "4.7.1" + +"@turf/boolean-disjoint@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/boolean-disjoint/-/boolean-disjoint-4.7.1.tgz#9bbc8f391281de6f622622a9836a94f20d7c4413" + dependencies: + "@turf/inside" "4.7.1" + "@turf/line-intersect" "4.7.1" + "@turf/meta" "4.7.1" + "@turf/polygon-to-linestring" "4.7.1" + +"@turf/boolean-equal@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/boolean-equal/-/boolean-equal-4.7.1.tgz#46fc0402943cbf9ce71b4aafe4bde10a69af381d" + dependencies: + "@turf/clean-coords" "4.7.1" + "@turf/invariant" "4.7.1" + geojson-equality "0.1.6" + +"@turf/boolean-overlap@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/boolean-overlap/-/boolean-overlap-4.7.1.tgz#cf9bc4d5cfc7d5630f035f01f75f673625c095cb" + dependencies: + "@turf/invariant" "4.7.1" + "@turf/line-intersect" "4.7.1" + "@turf/line-overlap" "4.7.1" + "@turf/meta" "4.7.1" + geojson-equality "0.1.6" + +"@turf/boolean-point-on-line@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/boolean-point-on-line/-/boolean-point-on-line-4.7.1.tgz#a267f71995da74be1dbc4440eb30e4bbbda49615" + dependencies: + "@turf/invariant" "4.7.1" + +"@turf/boolean-within@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/boolean-within/-/boolean-within-4.7.1.tgz#df65ed855ee48ce371d7ddbaac4c2168cccacdc4" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/boolean-point-on-line" "4.7.1" + "@turf/inside" "4.7.1" + "@turf/invariant" "4.7.1" + +"@turf/buffer@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/buffer/-/buffer-4.7.1.tgz#68350e1aa6c48aa45b44de239869a6410b0400bf" + dependencies: + "@turf/center" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/meta" "4.7.1" + d3-geo "^1.6.3" + jsts "1.3.0" + +"@turf/center-of-mass@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/center-of-mass/-/center-of-mass-4.7.1.tgz#5420a19d608459df0a5b58e2980031883c7afb70" + dependencies: + "@turf/centroid" "4.7.1" + "@turf/convex" "4.7.1" + "@turf/explode" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/meta" "4.7.1" + +"@turf/center@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/center/-/center-4.7.1.tgz#5c66c56144f07c35e26292ca61b4105b1b53a8d2" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/helpers" "4.7.1" + +"@turf/centroid@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/centroid/-/centroid-4.7.1.tgz#7eb0aa4b990f058819b2c755f3ce09471dc9f7de" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/meta" "4.7.1" + +"@turf/circle@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/circle/-/circle-4.7.1.tgz#a54cdd40650015388e42f957fe1cc81703464dd0" + dependencies: + "@turf/destination" "4.7.1" + "@turf/helpers" "4.7.1" + +"@turf/clean-coords@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/clean-coords/-/clean-coords-4.7.1.tgz#c4120f7a4eba47341c49f85d943f6eaea116c5e8" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + +"@turf/clone@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/clone/-/clone-4.7.1.tgz#2198da5895057d0adad91712a8170d78197cf9bb" + +"@turf/clusters-dbscan@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/clusters-dbscan/-/clusters-dbscan-4.7.1.tgz#af2cf4d1336b02e16113b23e105ebbb823ba8222" + dependencies: + "@turf/clone" "4.7.1" + "@turf/distance" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/meta" "4.7.1" + density-clustering "1.3.0" + +"@turf/clusters-kmeans@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/clusters-kmeans/-/clusters-kmeans-4.7.1.tgz#d3b614e71934889fc3cf7056a8e562b7b69e6cb8" + dependencies: + "@turf/clone" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/meta" "4.7.1" + skmeans "0.9.7" + +"@turf/clusters@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/clusters/-/clusters-4.7.1.tgz#5406061dafadcff3dc09ba44938af7ad4d91d149" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/meta" "4.7.1" + +"@turf/collect@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/collect/-/collect-4.7.1.tgz#190a98566b192528d87c992e07213ca592f493f2" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/inside" "4.7.1" + rbush "^2.0.1" + +"@turf/combine@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/combine/-/combine-4.7.1.tgz#aa6e9f82804fcdbc18b45ca30d31991af12d17e5" + dependencies: + "@turf/meta" "4.7.1" + +"@turf/concave@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/concave/-/concave-4.7.1.tgz#99e3ca9520c795b76ac7f9f778261dd4d70bbefd" + dependencies: + "@turf/distance" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/meta" "4.7.1" + "@turf/tin" "4.7.1" + geojson-dissolve "3.1.0" + +"@turf/convex@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/convex/-/convex-4.7.1.tgz#09d76aa697c194d24c5135f496936b8964f8e6dc" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/meta" "4.7.1" + convex-hull "^1.0.3" + +"@turf/destination@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/destination/-/destination-4.7.1.tgz#34691d76e185c7cf1bad94ea843a52a76f2c938f" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + +"@turf/difference@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/difference/-/difference-4.7.1.tgz#e079286359db852f4c0e4af7c15da45accf2dafa" + dependencies: + "@turf/area" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/meta" "4.7.1" + jsts "1.3.0" + +"@turf/dissolve@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/dissolve/-/dissolve-4.7.1.tgz#8d967783ee6a86fef67eed15b3a49dfecc62c651" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/boolean-overlap" "4.7.1" + "@turf/union" "4.7.1" + geojson-utils "^1.1.0" + get-closest "^0.0.4" + rbush "^2.0.1" + +"@turf/distance@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/distance/-/distance-4.7.1.tgz#d8bd48275f7418a98eae2adc0ff3f63548e05bcd" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + +"@turf/envelope@4.7.1", "@turf/envelope@^4.3.0": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/envelope/-/envelope-4.7.1.tgz#22b40595cfb076ef57e0340da098b85e2f42ac0f" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/bbox-polygon" "4.7.1" + +"@turf/explode@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/explode/-/explode-4.7.1.tgz#1635a77ec54b0fb7b0f2e5323c5bc2c517e789a9" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/meta" "4.7.1" + +"@turf/explode@^3.7.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@turf/explode/-/explode-3.14.0.tgz#f2cc1e46a39700d5602466ccd50f59a52341b92c" + dependencies: + "@turf/helpers" "^3.13.0" + "@turf/meta" "^3.14.0" + +"@turf/flatten@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/flatten/-/flatten-4.7.1.tgz#d24e51bb7aa4f46ecd439424de8717bf1c14c8e1" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/meta" "4.7.1" + +"@turf/flip@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/flip/-/flip-4.7.1.tgz#f085bea1614007af9797e36160660e2ed9e6ec1f" + dependencies: + "@turf/meta" "4.7.1" + +"@turf/great-circle@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/great-circle/-/great-circle-4.7.1.tgz#10bafe0658e41c68ca568dc909d037fa8742b7c3" + dependencies: + "@turf/invariant" "4.7.1" + +"@turf/helpers@4.7.1", "@turf/helpers@^4.1.0", "@turf/helpers@^4.3.0": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/helpers/-/helpers-4.7.1.tgz#12cecbfe22b16386338537dae3e3da83de2f3fac" + +"@turf/helpers@^3.13.0", "@turf/helpers@^3.6.3": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@turf/helpers/-/helpers-3.13.0.tgz#d06078a1464cf56cdb7ea624ea1e13a71b88b806" + +"@turf/hex-grid@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/hex-grid/-/hex-grid-4.7.1.tgz#ca4fd064ea34cf5f522786dbdca7eec9e966c9a8" + dependencies: + "@turf/distance" "4.7.1" + "@turf/helpers" "4.7.1" + +"@turf/idw@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/idw/-/idw-4.7.1.tgz#7ccbbf317dc87ffdb8ff3b033312fd2c3aef1d76" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/centroid" "4.7.1" + "@turf/distance" "4.7.1" + "@turf/square-grid" "4.7.1" + +"@turf/inside@4.7.1", "@turf/inside@^4.3.0", "@turf/inside@^4.5.2": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/inside/-/inside-4.7.1.tgz#20676ba125b3c706bb671bced60f8b102162f8fa" + dependencies: + "@turf/invariant" "4.7.1" + +"@turf/inside@^3.14.0", "@turf/inside@^3.7.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@turf/inside/-/inside-3.14.0.tgz#d6b6af55882cbdb8f9a558dca98689c67bd3c590" + dependencies: + "@turf/invariant" "^3.13.0" + +"@turf/interpolate@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/interpolate/-/interpolate-4.7.1.tgz#11fbb822d54c3b05cb63c71bf01e25e96dc455cf" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/centroid" "4.7.1" + "@turf/distance" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/hex-grid" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/meta" "4.7.1" + "@turf/point-grid" "4.7.1" + "@turf/square-grid" "4.7.1" + "@turf/triangle-grid" "4.7.1" + +"@turf/intersect@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/intersect/-/intersect-4.7.1.tgz#096db4f4d688679b869f1637fffa0e55390bb881" + dependencies: + "@turf/truncate" "4.7.1" + jsts "1.3.0" + +"@turf/invariant@4.7.1", "@turf/invariant@^4.1.0", "@turf/invariant@^4.3.0": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/invariant/-/invariant-4.7.1.tgz#b95bc41a3cc7f1319d9a4c51ad5b3582905f81e4" + +"@turf/invariant@^3.13.0": + version "3.13.0" + resolved "https://registry.yarnpkg.com/@turf/invariant/-/invariant-3.13.0.tgz#89243308cd563206e81e5c6162e0d22f61822f90" + +"@turf/isobands@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/isobands/-/isobands-4.7.1.tgz#a1e81ad10e6e9b225369a8eac625510aca7af2d9" + dependencies: + "@turf/area" "^3.7.0" + "@turf/bbox" "^3.14.0" + "@turf/explode" "^3.7.0" + "@turf/helpers" "^3.6.3" + "@turf/inside" "^3.7.0" + "@turf/invariant" "^3.13.0" + grid-to-matrix "^1.2.0" + marchingsquares "^1.2.0" + +"@turf/isolines@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/isolines/-/isolines-4.7.1.tgz#133081e89fca2a51fb672a54bc7f1734fb9c7d29" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/meta" "4.7.1" + grid-to-matrix "1.2.0" + marchingsquares "1.2.0" + +"@turf/kinks@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/kinks/-/kinks-4.7.1.tgz#1d38c28d2aa39d2a3ece4a49f80e788588354a7f" + dependencies: + "@turf/helpers" "4.7.1" + +"@turf/line-arc@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/line-arc/-/line-arc-4.7.1.tgz#51743739af793990237ff0426f98882b393290d5" + dependencies: + "@turf/circle" "4.7.1" + "@turf/destination" "4.7.1" + "@turf/helpers" "4.7.1" + +"@turf/line-chunk@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/line-chunk/-/line-chunk-4.7.1.tgz#80bfd7dc7efa3bfe5b48969d7cc50157de53b1d0" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/line-distance" "4.7.1" + "@turf/line-slice-along" "4.7.1" + "@turf/meta" "4.7.1" + +"@turf/line-distance@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/line-distance/-/line-distance-4.7.1.tgz#a686d8ca4d64f34d282a0c8ca54c1727424fef49" + dependencies: + "@turf/distance" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/meta" "4.7.1" + +"@turf/line-intersect@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/line-intersect/-/line-intersect-4.7.1.tgz#dd1505bed4875dd151fba44e658605a356e5b256" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/line-segment" "4.7.1" + "@turf/meta" "4.7.1" + geojson-rbush "^1.0.1" + +"@turf/line-offset@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/line-offset/-/line-offset-4.7.1.tgz#da003111d6899ce9b95dc3023cf5411014a32935" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/meta" "4.7.1" + +"@turf/line-overlap@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/line-overlap/-/line-overlap-4.7.1.tgz#10b80aa9763583ad9d9151f57f2cf1490c3d8100" + dependencies: + "@turf/boolean-point-on-line" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/line-segment" "4.7.1" + "@turf/meta" "4.7.1" + "@turf/point-on-line" "4.7.1" + deep-equal "^1.0.1" + geojson-rbush "^1.0.1" + +"@turf/line-segment@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/line-segment/-/line-segment-4.7.1.tgz#04ea6e88bd128e4bc80a88fa705ef5e150433b2f" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/meta" "4.7.1" + +"@turf/line-slice-along@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/line-slice-along/-/line-slice-along-4.7.1.tgz#2d5a1ec90a32c5e21665719c15415dc76c94a28b" + dependencies: + "@turf/bearing" "4.7.1" + "@turf/destination" "4.7.1" + "@turf/distance" "4.7.1" + "@turf/helpers" "4.7.1" + +"@turf/line-slice@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/line-slice/-/line-slice-4.7.1.tgz#5f6fc61ea19c997ce24d60688b7de0563f854f51" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/point-on-line" "4.7.1" + +"@turf/line-split@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/line-split/-/line-split-4.7.1.tgz#dea019f11996ca0d01124549116258bfdead07f7" + dependencies: + "@turf/flatten" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/line-intersect" "4.7.1" + "@turf/line-segment" "4.7.1" + "@turf/meta" "4.7.1" + "@turf/point-on-line" "4.7.1" + "@turf/truncate" "4.7.1" + geojson-rbush "^1.0.1" + +"@turf/linestring-to-polygon@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/linestring-to-polygon/-/linestring-to-polygon-4.7.1.tgz#828d0d46c55ec6f14a5c9907ddb0ff3689dcb5a3" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + +"@turf/mask@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/mask/-/mask-4.7.1.tgz#b6ba60cf17289eaf2ec2e574948a43a847d238c2" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/meta" "4.7.1" + "@turf/union" "4.7.1" + rbush "^2.0.1" + +"@turf/meta@4.7.1", "@turf/meta@^4.1.0", "@turf/meta@^4.3.0", "@turf/meta@^4.6.0": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/meta/-/meta-4.7.1.tgz#53a55281ae08a5fa2f414d9ba50a951d38e86ab5" + +"@turf/meta@^3.14.0", "@turf/meta@^3.7.5": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@turf/meta/-/meta-3.14.0.tgz#8d3050c1a0f44bf406a633b6bd28c510f7bcee27" + +"@turf/midpoint@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/midpoint/-/midpoint-4.7.1.tgz#8d111a67ee8797266d73fd33d771d5147b5ecd9d" + dependencies: + "@turf/bearing" "4.7.1" + "@turf/destination" "4.7.1" + "@turf/distance" "4.7.1" + +"@turf/nearest@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/nearest/-/nearest-4.7.1.tgz#a2221fd6ed65a230a40021c1c0f336055e8c5038" + dependencies: + "@turf/distance" "4.7.1" + +"@turf/planepoint@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/planepoint/-/planepoint-4.7.1.tgz#c0e8b21982d3ec9ddb7c7d6418335282ae59c5a4" + dependencies: + "@turf/invariant" "4.7.1" + +"@turf/point-grid@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/point-grid/-/point-grid-4.7.1.tgz#f70c699292971d8629865f68e520f3c4a0c5f669" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/distance" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/inside" "4.7.1" + "@turf/invariant" "4.7.1" + +"@turf/point-on-line@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/point-on-line/-/point-on-line-4.7.1.tgz#f5f379878386afdae3e78f9cf0e481adf403c1f9" + dependencies: + "@turf/bearing" "4.7.1" + "@turf/destination" "4.7.1" + "@turf/distance" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/line-intersect" "4.7.1" + "@turf/meta" "4.7.1" + +"@turf/point-on-surface@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/point-on-surface/-/point-on-surface-4.7.1.tgz#3d599a6218519aaae2db7c57fa52e8a4d36c6682" + dependencies: + "@turf/center" "4.7.1" + "@turf/distance" "4.7.1" + "@turf/explode" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/inside" "4.7.1" + +"@turf/point-to-line-distance@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/point-to-line-distance/-/point-to-line-distance-4.7.1.tgz#1b2991696ca413877624815f4954e7b4134fdd7d" + dependencies: + "@turf/bearing" "4.7.1" + "@turf/distance" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/meta" "4.7.1" + "@turf/rhumb-bearing" "4.7.1" + "@turf/rhumb-distance" "4.7.1" + +"@turf/polygon-tangents@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/polygon-tangents/-/polygon-tangents-4.7.1.tgz#503c61891a40a60ae4422b8a978a32d05b886f36" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + +"@turf/polygon-to-linestring@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/polygon-to-linestring/-/polygon-to-linestring-4.7.1.tgz#67fe4f78f81ef6b4a96d83024a96bda6150103e5" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + +"@turf/polygonize@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/polygonize/-/polygonize-4.7.1.tgz#c9e6e0d3d3c04d38a60bc8a1ce7ad4063462a559" + dependencies: + polygonize "1.0.1" + +"@turf/random@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/random/-/random-4.7.1.tgz#418a1acab9a29cb20033317f43aca65a42e30652" + dependencies: + geojson-random "^0.2.2" + +"@turf/rewind@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/rewind/-/rewind-4.7.1.tgz#032d8db8b3fa236ada3777c8f7ff82640a0dd54d" + dependencies: + "@turf/boolean-clockwise" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/meta" "4.7.1" + +"@turf/rhumb-bearing@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/rhumb-bearing/-/rhumb-bearing-4.7.1.tgz#ea60b12d149a68dfb005a8bef438f11f700ac511" + dependencies: + "@turf/invariant" "4.7.1" + geodesy "1.1.1" + +"@turf/rhumb-destination@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/rhumb-destination/-/rhumb-destination-4.7.1.tgz#adde79ade65cdc5ba22424de817ff337423ddf1f" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + geodesy "1.1.1" + +"@turf/rhumb-distance@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/rhumb-distance/-/rhumb-distance-4.7.1.tgz#33bd3cef070372a471dc1163c08d1ca9a6e486d8" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + geodesy "1.1.1" + +"@turf/sample@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/sample/-/sample-4.7.1.tgz#89d22ede3861586bc3c3e31314fdad8aeea89f6d" + dependencies: + "@turf/helpers" "4.7.1" + +"@turf/sector@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/sector/-/sector-4.7.1.tgz#f9454c8ab013e0af4989f1b73d6b8a1a9b04570c" + dependencies: + "@turf/circle" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/line-arc" "4.7.1" + "@turf/meta" "4.7.1" + +"@turf/simplify@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/simplify/-/simplify-4.7.1.tgz#d144a5a34ab2fcee1aa93738b7cd24b4835505e5" + dependencies: + "@turf/clean-coords" "4.7.1" + "@turf/clone" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/meta" "4.7.1" + simplify-js "^1.2.1" + +"@turf/square-grid@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/square-grid/-/square-grid-4.7.1.tgz#3357f1c0ef3185d630d0279c812d12481212e843" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/distance" "4.7.1" + "@turf/helpers" "4.7.1" + +"@turf/square@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/square/-/square-4.7.1.tgz#1f51326dd8ed0e2f4239bb5fd491885f3e579731" + dependencies: + "@turf/distance" "4.7.1" + +"@turf/tag@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/tag/-/tag-4.7.1.tgz#071d873aed361ce5bb5a28633d562b14af4e699b" + dependencies: + "@turf/inside" "4.7.1" + +"@turf/tesselate@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/tesselate/-/tesselate-4.7.1.tgz#08d8adbacd372ecb2c9e8cab1adbb18a57da0b8a" + dependencies: + "@turf/helpers" "4.7.1" + earcut "^2.0.0" + +"@turf/tin@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/tin/-/tin-4.7.1.tgz#9031bb6c606bd6b244fa4389f3a98ace751eb764" + dependencies: + "@turf/helpers" "4.7.1" + +"@turf/transform-rotate@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/transform-rotate/-/transform-rotate-4.7.1.tgz#4a1e6c5cb54244555c3de3311dd302c7ca4b9b53" + dependencies: + "@turf/centroid" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/meta" "4.7.1" + "@turf/rhumb-bearing" "4.7.1" + "@turf/rhumb-destination" "4.7.1" + "@turf/rhumb-distance" "4.7.1" + +"@turf/transform-scale@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/transform-scale/-/transform-scale-4.7.1.tgz#584271ba9d8e9992ae7f76f3a2a9f662cfa2e199" + dependencies: + "@turf/bbox" "4.7.1" + "@turf/center" "4.7.1" + "@turf/centroid" "4.7.1" + "@turf/clone" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/meta" "4.7.1" + "@turf/rhumb-bearing" "4.7.1" + "@turf/rhumb-destination" "4.7.1" + "@turf/rhumb-distance" "4.7.1" + +"@turf/transform-translate@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/transform-translate/-/transform-translate-4.7.1.tgz#0b25fff40ef87fe1fd53d3f200e8f413474a0f09" + dependencies: + "@turf/invariant" "4.7.1" + "@turf/meta" "4.7.1" + "@turf/rhumb-destination" "4.7.1" + +"@turf/triangle-grid@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/triangle-grid/-/triangle-grid-4.7.1.tgz#468a220a7d38dc4e3ab11d64a9291886992c1704" + dependencies: + "@turf/distance" "4.7.1" + "@turf/helpers" "4.7.1" + +"@turf/truncate@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/truncate/-/truncate-4.7.1.tgz#75fc7cf282e4cb5bf49c8b787f9da1f5c47d5e5d" + dependencies: + "@turf/meta" "4.7.1" + +"@turf/turf@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/turf/-/turf-4.7.1.tgz#9ee210797ec92641edcbcf9422c9fe370c2694fa" + dependencies: + "@turf/along" "4.7.1" + "@turf/area" "4.7.1" + "@turf/bbox" "4.7.1" + "@turf/bbox-clip" "4.7.1" + "@turf/bbox-polygon" "4.7.1" + "@turf/bearing" "4.7.1" + "@turf/bezier" "4.7.1" + "@turf/boolean-clockwise" "4.7.1" + "@turf/boolean-contains" "4.7.1" + "@turf/boolean-crosses" "4.7.1" + "@turf/boolean-disjoint" "4.7.1" + "@turf/boolean-equal" "4.7.1" + "@turf/boolean-overlap" "4.7.1" + "@turf/boolean-point-on-line" "4.7.1" + "@turf/boolean-within" "4.7.1" + "@turf/buffer" "4.7.1" + "@turf/center" "4.7.1" + "@turf/center-of-mass" "4.7.1" + "@turf/centroid" "4.7.1" + "@turf/circle" "4.7.1" + "@turf/clean-coords" "4.7.1" + "@turf/clone" "4.7.1" + "@turf/clusters" "4.7.1" + "@turf/clusters-dbscan" "4.7.1" + "@turf/clusters-kmeans" "4.7.1" + "@turf/collect" "4.7.1" + "@turf/combine" "4.7.1" + "@turf/concave" "4.7.1" + "@turf/convex" "4.7.1" + "@turf/destination" "4.7.1" + "@turf/difference" "4.7.1" + "@turf/dissolve" "4.7.1" + "@turf/distance" "4.7.1" + "@turf/envelope" "4.7.1" + "@turf/explode" "4.7.1" + "@turf/flatten" "4.7.1" + "@turf/flip" "4.7.1" + "@turf/great-circle" "4.7.1" + "@turf/helpers" "4.7.1" + "@turf/hex-grid" "4.7.1" + "@turf/idw" "4.7.1" + "@turf/inside" "4.7.1" + "@turf/interpolate" "4.7.1" + "@turf/intersect" "4.7.1" + "@turf/invariant" "4.7.1" + "@turf/isobands" "4.7.1" + "@turf/isolines" "4.7.1" + "@turf/kinks" "4.7.1" + "@turf/line-arc" "4.7.1" + "@turf/line-chunk" "4.7.1" + "@turf/line-distance" "4.7.1" + "@turf/line-intersect" "4.7.1" + "@turf/line-offset" "4.7.1" + "@turf/line-overlap" "4.7.1" + "@turf/line-segment" "4.7.1" + "@turf/line-slice" "4.7.1" + "@turf/line-slice-along" "4.7.1" + "@turf/line-split" "4.7.1" + "@turf/linestring-to-polygon" "4.7.1" + "@turf/mask" "4.7.1" + "@turf/meta" "4.7.1" + "@turf/midpoint" "4.7.1" + "@turf/nearest" "4.7.1" + "@turf/planepoint" "4.7.1" + "@turf/point-grid" "4.7.1" + "@turf/point-on-line" "4.7.1" + "@turf/point-on-surface" "4.7.1" + "@turf/point-to-line-distance" "4.7.1" + "@turf/polygon-tangents" "4.7.1" + "@turf/polygon-to-linestring" "4.7.1" + "@turf/polygonize" "4.7.1" + "@turf/random" "4.7.1" + "@turf/rewind" "4.7.1" + "@turf/rhumb-bearing" "4.7.1" + "@turf/rhumb-destination" "4.7.1" + "@turf/rhumb-distance" "4.7.1" + "@turf/sample" "4.7.1" + "@turf/sector" "4.7.1" + "@turf/simplify" "4.7.1" + "@turf/square" "4.7.1" + "@turf/square-grid" "4.7.1" + "@turf/tag" "4.7.1" + "@turf/tesselate" "4.7.1" + "@turf/tin" "4.7.1" + "@turf/transform-rotate" "4.7.1" + "@turf/transform-scale" "4.7.1" + "@turf/transform-translate" "4.7.1" + "@turf/triangle-grid" "4.7.1" + "@turf/truncate" "4.7.1" + "@turf/union" "4.7.1" + "@turf/unkink-polygon" "4.7.1" + "@turf/within" "4.7.1" + +"@turf/union@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/union/-/union-4.7.1.tgz#993c6a9efb7880427e331af5a4e9d02381046d03" + dependencies: + jsts "1.3.0" + +"@turf/unkink-polygon@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/unkink-polygon/-/unkink-polygon-4.7.1.tgz#6ef0958a47ade0186b4c88337302ee58134e6984" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/meta" "4.7.1" + simplepolygon "1.2.1" + +"@turf/within@4.7.1": + version "4.7.1" + resolved "https://registry.yarnpkg.com/@turf/within/-/within-4.7.1.tgz#f6027fbc3bc449fe927707a06cf48ba29123098f" + dependencies: + "@turf/helpers" "4.7.1" + "@turf/inside" "4.7.1" + +"@turf/within@^3.13.0": + version "3.14.0" + resolved "https://registry.yarnpkg.com/@turf/within/-/within-3.14.0.tgz#891a578323c292b9792269032dd74870e0e14c53" + dependencies: + "@turf/helpers" "^3.13.0" + "@turf/inside" "^3.14.0" + +affine-hull@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/affine-hull/-/affine-hull-1.0.0.tgz#763ff1d38d063ceb7e272f17ee4d7bbcaf905c5d" + dependencies: + robust-orientation "^1.1.3" + +balanced-match@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" + +base64-js@0.0.2: + version "0.0.2" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.2.tgz#024f0f72afa25b75f9c0ee73cd4f55ec1bed9784" + +benchmark@^2.1.4: + version "2.1.4" + resolved "https://registry.yarnpkg.com/benchmark/-/benchmark-2.1.4.tgz#09f3de31c916425d498cc2ee565a0ebf3c2a5629" + dependencies: + lodash "^4.17.4" + platform "^1.3.3" + +bit-twiddle@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/bit-twiddle/-/bit-twiddle-1.0.2.tgz#0c6c1fabe2b23d17173d9a61b7b7093eb9e1769e" + +bops@0.0.6: + version "0.0.6" + resolved "https://registry.yarnpkg.com/bops/-/bops-0.0.6.tgz#082d1d55fa01e60dbdc2ebc2dba37f659554cf3a" + dependencies: + base64-js "0.0.2" + to-utf8 "0.0.1" + +brace-expansion@^1.1.7: + version "1.1.8" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +commander@2: + version "2.11.0" + resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + +concat-stream@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.2.1.tgz#f35100b6c46378bfba8b6b80f9f0d0ccdf13dc60" + dependencies: + bops "0.0.6" + +convex-hull@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/convex-hull/-/convex-hull-1.0.3.tgz#20a3aa6ce87f4adea2ff7d17971c9fc1c67e1fff" + dependencies: + affine-hull "^1.0.0" + incremental-convex-hull "^1.0.1" + monotone-convex-hull-2d "^1.0.1" + +d3-array@1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-1.2.0.tgz#147d269720e174c4057a7f42be8b0f3f2ba53108" + +d3-geo@^1.6.3: + version "1.6.4" + resolved "https://registry.yarnpkg.com/d3-geo/-/d3-geo-1.6.4.tgz#f20e1e461cb1845f5a8be55ab6f876542a7e3199" + dependencies: + d3-array "1" + +debug@^2.6.3: + version "2.6.8" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" + dependencies: + ms "2.0.0" + +deep-equal@^1.0.0, deep-equal@^1.0.1, deep-equal@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" + +define-properties@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.2.tgz#83a73f2fea569898fb737193c8f873caf6d45c94" + dependencies: + foreach "^2.0.5" + object-keys "^1.0.8" + +defined@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" + +density-clustering@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/density-clustering/-/density-clustering-1.3.0.tgz#dc9f59c8f0ab97e1624ac64930fd3194817dcac5" + +detect-indent@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" + +earcut@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/earcut/-/earcut-2.1.1.tgz#157634e5f3ebb42224e475016e86a5b6ce556b45" + +error-ex@^1.2.0: + version "1.3.1" + resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" + dependencies: + is-arrayish "^0.2.1" + +es-abstract@^1.5.0: + version "1.8.2" + resolved "https://registry.yarnpkg.com/es-abstract/-/es-abstract-1.8.2.tgz#25103263dc4decbda60e0c737ca32313518027ee" + dependencies: + es-to-primitive "^1.1.1" + function-bind "^1.1.1" + has "^1.0.1" + is-callable "^1.1.3" + is-regex "^1.0.4" + +es-to-primitive@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/es-to-primitive/-/es-to-primitive-1.1.1.tgz#45355248a88979034b6792e19bb81f2b7975dd0d" + dependencies: + is-callable "^1.1.1" + is-date-object "^1.0.1" + is-symbol "^1.0.1" + +for-each@~0.3.2: + version "0.3.2" + resolved "https://registry.yarnpkg.com/for-each/-/for-each-0.3.2.tgz#2c40450b9348e97f281322593ba96704b9abd4d4" + dependencies: + is-function "~1.0.0" + +foreach@^2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/foreach/-/foreach-2.0.5.tgz#0bee005018aeb260d0a3af3ae658dd0136ec1b99" + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + +function-bind@^1.0.2, function-bind@^1.1.1, function-bind@~1.1.0: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + +geodesy@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/geodesy/-/geodesy-1.1.1.tgz#918c414a5cc247c8128332b7624050c467e98a5d" + +geojson-dissolve@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/geojson-dissolve/-/geojson-dissolve-3.1.0.tgz#86823271680a1a381f3e72f02648bbcc710ecda1" + dependencies: + "@turf/meta" "^3.7.5" + geojson-flatten "^0.2.1" + geojson-linestring-dissolve "0.0.1" + topojson-client "^3.0.0" + topojson-server "^3.0.0" + +geojson-equality@0.1.6: + version "0.1.6" + resolved "https://registry.yarnpkg.com/geojson-equality/-/geojson-equality-0.1.6.tgz#a171374ef043e5d4797995840bae4648e0752d72" + dependencies: + deep-equal "^1.0.0" + +geojson-flatten@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/geojson-flatten/-/geojson-flatten-0.2.1.tgz#476fc6b041e94d016983ec95400f8777bd60c45c" + dependencies: + concat-stream "~1.2.1" + minimist "0.0.5" + +geojson-linestring-dissolve@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/geojson-linestring-dissolve/-/geojson-linestring-dissolve-0.0.1.tgz#08ab8cdf386e919d35a0eb38fa1c550e020838db" + +geojson-polygon-self-intersections@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/geojson-polygon-self-intersections/-/geojson-polygon-self-intersections-1.1.2.tgz#bc49ce3be2175005802ad6f3c231dbdd7c65777b" + dependencies: + rbush "^2.0.1" + +geojson-random@^0.2.2: + version "0.2.2" + resolved "https://registry.yarnpkg.com/geojson-random/-/geojson-random-0.2.2.tgz#ab4838f126adc5e16f8f94e655def820f9119dbc" + +geojson-rbush@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/geojson-rbush/-/geojson-rbush-1.2.0.tgz#eca3b6a3afb899a453ef82d5e2373092e20d77e5" + dependencies: + "@turf/meta" "^4.6.0" + rbush "^2.0.1" + +geojson-utils@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/geojson-utils/-/geojson-utils-1.1.0.tgz#e8ffb4c81c0a75b3e306f5187265d6f23040f50b" + +get-closest@^0.0.4: + version "0.0.4" + resolved "https://registry.yarnpkg.com/get-closest/-/get-closest-0.0.4.tgz#269ac776d1e6022aa0fd586dd708e8a7d32269af" + +glob@~7.1.2: + version "7.1.2" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.2.tgz#c19c9df9a028702d678612384a6552404c636d15" + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.0.4" + once "^1.3.0" + path-is-absolute "^1.0.0" + +graceful-fs@^4.1.11, graceful-fs@^4.1.2: + version "4.1.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" + +grid-to-matrix@1.2.0, grid-to-matrix@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/grid-to-matrix/-/grid-to-matrix-1.2.0.tgz#b016df4d76f996e6b74663eab9ceb913546657e9" + dependencies: + "@turf/helpers" "^4.1.0" + "@turf/invariant" "^4.1.0" + "@turf/meta" "^4.1.0" + +has@^1.0.1, has@~1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" + dependencies: + function-bind "^1.0.2" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + +incremental-convex-hull@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/incremental-convex-hull/-/incremental-convex-hull-1.0.1.tgz#51428c14cb9d9a6144bfe69b2851fb377334be1e" + dependencies: + robust-orientation "^1.1.2" + simplicial-complex "^1.0.0" + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@~2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + +is-arrayish@^0.2.1: + version "0.2.1" + resolved "https://registry.yarnpkg.com/is-arrayish/-/is-arrayish-0.2.1.tgz#77c99840527aa8ecb1a8ba697b80645a7a926a9d" + +is-callable@^1.1.1, is-callable@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/is-callable/-/is-callable-1.1.3.tgz#86eb75392805ddc33af71c92a0eedf74ee7604b2" + +is-date-object@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-date-object/-/is-date-object-1.0.1.tgz#9aa20eb6aeebbff77fbd33e74ca01b33581d3a16" + +is-function@~1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-function/-/is-function-1.0.1.tgz#12cfb98b65b57dd3d193a3121f5f6e2f437602b5" + +is-plain-obj@^1.0.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e" + +is-regex@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/is-regex/-/is-regex-1.0.4.tgz#5517489b547091b0930e095654ced25ee97e9491" + dependencies: + has "^1.0.1" + +is-symbol@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" + +jsts@1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/jsts/-/jsts-1.3.0.tgz#e93a76f97ac9bda7d4625d9d6470f0d60ac80e45" + +lineclip@^1.1.5: + version "1.1.5" + resolved "https://registry.yarnpkg.com/lineclip/-/lineclip-1.1.5.tgz#2bf26067d94354feabf91e42768236db5616fd13" + +load-json-file@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" + dependencies: + graceful-fs "^4.1.2" + parse-json "^2.2.0" + pify "^2.0.0" + strip-bom "^3.0.0" + +lodash@^4.17.4: + version "4.17.4" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae" + +make-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-1.0.0.tgz#97a011751e91dd87cfadef58832ebb04936de978" + dependencies: + pify "^2.3.0" + +marchingsquares@1.2.0, marchingsquares@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/marchingsquares/-/marchingsquares-1.2.0.tgz#36ae2dcc170be576d42579aac3c46da89ab650e6" + +minimatch@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" + dependencies: + brace-expansion "^1.1.7" + +minimist@0.0.5: + version "0.0.5" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.5.tgz#d7aa327bcecf518f9106ac6b8f003fa3bcea8566" + +minimist@~1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" + +monotone-convex-hull-2d@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/monotone-convex-hull-2d/-/monotone-convex-hull-2d-1.0.1.tgz#47f5daeadf3c4afd37764baa1aa8787a40eee08c" + dependencies: + robust-orientation "^1.1.3" + +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + +object-inspect@~1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.3.0.tgz#5b1eb8e6742e2ee83342a637034d844928ba2f6d" + +object-keys@^1.0.8: + version "1.0.11" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.0.11.tgz#c54601778ad560f1142ce0e01bcca8b56d13426d" + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + dependencies: + wrappy "1" + +parse-json@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9" + dependencies: + error-ex "^1.2.0" + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + +path-parse@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1" + +pify@^2.0.0, pify@^2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/pify/-/pify-2.3.0.tgz#ed141a6ac043a849ea588498e7dca8b15330e90c" + +platform@^1.3.3: + version "1.3.4" + resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.4.tgz#6f0fb17edaaa48f21442b3a975c063130f1c3ebd" + +polygonize@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/polygonize/-/polygonize-1.0.1.tgz#51fb7040914be0fbc43b0bd54d421d75fc2ae7a6" + dependencies: + "@turf/envelope" "^4.3.0" + "@turf/helpers" "^4.3.0" + "@turf/inside" "^4.3.0" + "@turf/invariant" "^4.3.0" + "@turf/meta" "^4.3.0" + +quickselect@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/quickselect/-/quickselect-1.0.0.tgz#02630818f9aae4ecab26f0103f98d061c17c58f3" + +rbush@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/rbush/-/rbush-2.0.1.tgz#4cfaca28c3064bc0ee75431a1b79990e875eefa9" + dependencies: + quickselect "^1.0.0" + +resolve@~1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" + dependencies: + path-parse "^1.0.5" + +resumer@~0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/resumer/-/resumer-0.0.0.tgz#f1e8f461e4064ba39e82af3cdc2a8c893d076759" + dependencies: + through "~2.3.4" + +robust-orientation@^1.1.2, robust-orientation@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/robust-orientation/-/robust-orientation-1.1.3.tgz#daff5b00d3be4e60722f0e9c0156ef967f1c2049" + dependencies: + robust-scale "^1.0.2" + robust-subtract "^1.0.0" + robust-sum "^1.0.0" + two-product "^1.0.2" + +robust-scale@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/robust-scale/-/robust-scale-1.0.2.tgz#775132ed09542d028e58b2cc79c06290bcf78c32" + dependencies: + two-product "^1.0.2" + two-sum "^1.0.0" + +robust-subtract@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/robust-subtract/-/robust-subtract-1.0.0.tgz#e0b164e1ed8ba4e3a5dda45a12038348dbed3e9a" + +robust-sum@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/robust-sum/-/robust-sum-1.0.0.tgz#16646e525292b4d25d82757a286955e0bbfa53d9" + +signal-exit@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" + +simplepolygon@1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/simplepolygon/-/simplepolygon-1.2.1.tgz#48250a6a853275e96e42c7105f507da00dc67d64" + dependencies: + "@turf/area" "^3.13.0" + "@turf/helpers" "^3.13.0" + "@turf/inside" "^4.5.2" + "@turf/within" "^3.13.0" + debug "^2.6.3" + geojson-polygon-self-intersections "^1.1.2" + rbush "^2.0.1" + +simplicial-complex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/simplicial-complex/-/simplicial-complex-1.0.0.tgz#6c33a4ed69fcd4d91b7bcadd3b30b63683eae241" + dependencies: + bit-twiddle "^1.0.0" + union-find "^1.0.0" + +simplify-js@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/simplify-js/-/simplify-js-1.2.1.tgz#fa216b40454f48175450e0fea1bd1e6ab39fcbc0" + +skmeans@0.9.7: + version "0.9.7" + resolved "https://registry.yarnpkg.com/skmeans/-/skmeans-0.9.7.tgz#72670cebb728508f56e29c0e10d11e623529ce5d" + +sort-keys@^1.1.1: + version "1.1.2" + resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" + dependencies: + is-plain-obj "^1.0.0" + +string.prototype.trim@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/string.prototype.trim/-/string.prototype.trim-1.1.2.tgz#d04de2c89e137f4d7d206f086b5ed2fae6be8cea" + dependencies: + define-properties "^1.1.2" + es-abstract "^1.5.0" + function-bind "^1.0.2" + +strip-bom@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/strip-bom/-/strip-bom-3.0.0.tgz#2334c18e9c759f7bdd56fdef7e9ae3d588e68ed3" + +tape@^4.6.3: + version "4.8.0" + resolved "https://registry.yarnpkg.com/tape/-/tape-4.8.0.tgz#f6a9fec41cc50a1de50fa33603ab580991f6068e" + dependencies: + deep-equal "~1.0.1" + defined "~1.0.0" + for-each "~0.3.2" + function-bind "~1.1.0" + glob "~7.1.2" + has "~1.0.1" + inherits "~2.0.3" + minimist "~1.2.0" + object-inspect "~1.3.0" + resolve "~1.4.0" + resumer "~0.0.0" + string.prototype.trim "~1.1.2" + through "~2.3.8" + +through@~2.3.4, through@~2.3.8: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + +to-utf8@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/to-utf8/-/to-utf8-0.0.1.tgz#d17aea72ff2fba39b9e43601be7b3ff72e089852" + +topojson-client@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/topojson-client/-/topojson-client-3.0.0.tgz#1f99293a77ef42a448d032a81aa982b73f360d2f" + dependencies: + commander "2" + +topojson-server@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/topojson-server/-/topojson-server-3.0.0.tgz#378e78e87c3972a7b5be2c5d604369b6bae69c5e" + dependencies: + commander "2" + +two-product@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/two-product/-/two-product-1.0.2.tgz#67d95d4b257a921e2cb4bd7af9511f9088522eaa" + +two-sum@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/two-sum/-/two-sum-1.0.0.tgz#31d3f32239e4f731eca9df9155e2b297f008ab64" + +union-find@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/union-find/-/union-find-1.0.2.tgz#292bac415e6ad3a89535d237010db4a536284e58" + +wgs84@0.0.0: + version "0.0.0" + resolved "https://registry.yarnpkg.com/wgs84/-/wgs84-0.0.0.tgz#34fdc555917b6e57cf2a282ed043710c049cdc76" + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + +write-file-atomic@^2.0.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-2.3.0.tgz#1ff61575c2e2a4e8e510d6fa4e243cce183999ab" + dependencies: + graceful-fs "^4.1.11" + imurmurhash "^0.1.4" + signal-exit "^3.0.2" + +write-json-file@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/write-json-file/-/write-json-file-2.2.0.tgz#51862506bbb3b619eefab7859f1fd6c6d0530876" + dependencies: + detect-indent "^5.0.0" + graceful-fs "^4.1.2" + make-dir "^1.0.0" + pify "^2.0.0" + sort-keys "^1.1.1" + write-file-atomic "^2.0.0" From 4a12e50bcb7ea20f55442b03a4ba305c43d83e61 Mon Sep 17 00:00:00 2001 From: stebogit Date: Mon, 11 Sep 2017 23:50:18 -0700 Subject: [PATCH 02/11] adds segment test --- .../test/in/segment.geojson | 63 +++++++++++++++++++ .../test/out/segment.geojson | 38 +++++++++++ 2 files changed, 101 insertions(+) create mode 100644 packages/turf-nearest-point-to-line/test/in/segment.geojson create mode 100644 packages/turf-nearest-point-to-line/test/out/segment.geojson diff --git a/packages/turf-nearest-point-to-line/test/in/segment.geojson b/packages/turf-nearest-point-to-line/test/in/segment.geojson new file mode 100644 index 0000000000..8e343906fc --- /dev/null +++ b/packages/turf-nearest-point-to-line/test/in/segment.geojson @@ -0,0 +1,63 @@ +{ + "type": "FeatureCollection", + "properties": { + "units": "miles" + }, + "features": [ + { + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 27.26806640625, + 14.243086862716888 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 28.388671875, + 18.323240460443397 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "Point", + "coordinates": [ + 29.619140624999996, + 19.228176737766262 + ] + } + } + ] + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 27.015380859374996, + 15.008463695004872 + ], + [ + 29.168701171875, + 17.256236314156425 + ] + ] + } + } + ] +} \ No newline at end of file diff --git a/packages/turf-nearest-point-to-line/test/out/segment.geojson b/packages/turf-nearest-point-to-line/test/out/segment.geojson new file mode 100644 index 0000000000..f217fe66a4 --- /dev/null +++ b/packages/turf-nearest-point-to-line/test/out/segment.geojson @@ -0,0 +1,38 @@ +{ + "type": "FeatureCollection", + "features": [ + { + "type": "Feature", + "properties": { + "dist": 55.53252986079311, + "marker-color": "#F00", + "marker-size": "large", + "marker-symbol": "star" + }, + "geometry": { + "type": "Point", + "coordinates": [ + 27.26806640625, + 14.243086862716888 + ] + } + }, + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "LineString", + "coordinates": [ + [ + 27.015380859374996, + 15.008463695004872 + ], + [ + 29.168701171875, + 17.256236314156425 + ] + ] + } + } + ] +} \ No newline at end of file From 2867e836ebee6cc37d4747b94b1d295cfb37824c Mon Sep 17 00:00:00 2001 From: stebogit Date: Tue, 12 Sep 2017 00:01:54 -0700 Subject: [PATCH 03/11] fixes rounding issue --- packages/turf-nearest-point-to-line/test.js | 3 ++- packages/turf-nearest-point-to-line/test/out/fiji.geojson | 2 +- packages/turf-nearest-point-to-line/test/out/one.geojson | 2 +- packages/turf-nearest-point-to-line/test/out/resolute.geojson | 2 +- packages/turf-nearest-point-to-line/test/out/segment.geojson | 2 +- packages/turf-nearest-point-to-line/test/out/two.geojson | 2 +- 6 files changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/turf-nearest-point-to-line/test.js b/packages/turf-nearest-point-to-line/test.js index 7d0e3b6b6e..c6c8b1c92f 100644 --- a/packages/turf-nearest-point-to-line/test.js +++ b/packages/turf-nearest-point-to-line/test.js @@ -3,7 +3,7 @@ const test = require('tape'); const path = require('path'); const load = require('load-json-file'); const write = require('write-json-file'); -const {featureCollection, point, lineString} = require('@turf/helpers'); +const {featureCollection, point, lineString, round} = require('@turf/helpers'); const nearestPointToLine = require('./'); const directories = { @@ -24,6 +24,7 @@ test('turf-nearest-point-to-line', t => { const [points, line] = geojson.features; let {units} = geojson.properties || {}; const nearest = nearestPointToLine(points, line, units); + nearest.properties.dist = round(nearest.properties.dist, 13); nearest.properties = Object.assign(nearest.properties, { 'marker-color': '#F00', 'marker-size': 'large', diff --git a/packages/turf-nearest-point-to-line/test/out/fiji.geojson b/packages/turf-nearest-point-to-line/test/out/fiji.geojson index cab104c448..734fa93d4f 100644 --- a/packages/turf-nearest-point-to-line/test/out/fiji.geojson +++ b/packages/turf-nearest-point-to-line/test/out/fiji.geojson @@ -4,7 +4,7 @@ { "type": "Feature", "properties": { - "dist": 3.505316815985152, + "dist": 3.5053168159852, "marker-color": "#F00", "marker-size": "large", "marker-symbol": "star" diff --git a/packages/turf-nearest-point-to-line/test/out/one.geojson b/packages/turf-nearest-point-to-line/test/out/one.geojson index d8d5dacc0d..51a4b416cc 100644 --- a/packages/turf-nearest-point-to-line/test/out/one.geojson +++ b/packages/turf-nearest-point-to-line/test/out/one.geojson @@ -4,7 +4,7 @@ { "type": "Feature", "properties": { - "dist": 31.801420214887205, + "dist": 31.8014202148872, "marker-color": "#F00", "marker-size": "large", "marker-symbol": "star" diff --git a/packages/turf-nearest-point-to-line/test/out/resolute.geojson b/packages/turf-nearest-point-to-line/test/out/resolute.geojson index ebf6b667ef..e125acd73e 100644 --- a/packages/turf-nearest-point-to-line/test/out/resolute.geojson +++ b/packages/turf-nearest-point-to-line/test/out/resolute.geojson @@ -4,7 +4,7 @@ { "type": "Feature", "properties": { - "dist": 26.36054588905259, + "dist": 26.3605458890526, "marker-color": "#F00", "marker-size": "large", "marker-symbol": "star" diff --git a/packages/turf-nearest-point-to-line/test/out/segment.geojson b/packages/turf-nearest-point-to-line/test/out/segment.geojson index f217fe66a4..8420089830 100644 --- a/packages/turf-nearest-point-to-line/test/out/segment.geojson +++ b/packages/turf-nearest-point-to-line/test/out/segment.geojson @@ -4,7 +4,7 @@ { "type": "Feature", "properties": { - "dist": 55.53252986079311, + "dist": 55.5325298607931, "marker-color": "#F00", "marker-size": "large", "marker-symbol": "star" diff --git a/packages/turf-nearest-point-to-line/test/out/two.geojson b/packages/turf-nearest-point-to-line/test/out/two.geojson index 9ff37352b6..d93892d43f 100644 --- a/packages/turf-nearest-point-to-line/test/out/two.geojson +++ b/packages/turf-nearest-point-to-line/test/out/two.geojson @@ -4,7 +4,7 @@ { "type": "Feature", "properties": { - "dist": 78.10416655465308, + "dist": 78.1041665546531, "marker-color": "#F00", "marker-size": "large", "marker-symbol": "star" From 6fbe42fccd91d2ca0eb7e5ba6e5d6fe6f4ab8c0f Mon Sep 17 00:00:00 2001 From: Denis Date: Sat, 16 Sep 2017 12:04:46 -0400 Subject: [PATCH 04/11] Update typescript definition --- packages/turf-nearest-point-to-line/README.md | 6 +++--- packages/turf-nearest-point-to-line/index.d.ts | 4 ++-- packages/turf-nearest-point-to-line/index.js | 6 +++--- packages/turf-nearest-point-to-line/types.ts | 7 +++++++ 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 packages/turf-nearest-point-to-line/types.ts diff --git a/packages/turf-nearest-point-to-line/README.md b/packages/turf-nearest-point-to-line/README.md index 71de0c3003..09bbcdcb7d 100644 --- a/packages/turf-nearest-point-to-line/README.md +++ b/packages/turf-nearest-point-to-line/README.md @@ -7,9 +7,9 @@ The returned point has a `dist` property indicating its distance to the line. **Parameters** -- `points` **[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)<[Point](http://geojson.org/geojson-spec.html#point)>** collection -- `line` **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[LineString](http://geojson.org/geojson-spec.html#linestring)>** Feature -- `units` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** can be degrees, radians, miles, or kilometers (optional, default `kilometers`) +- `points` **[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)<[Point](http://geojson.org/geojson-spec.html#point)>** Point Collection +- `line` **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[LineString](http://geojson.org/geojson-spec.html#linestring)>** Line Feature +- `units` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** unit of the output distance property, can be degrees, radians, miles, or kilometer (optional, default `kilometers`) **Examples** diff --git a/packages/turf-nearest-point-to-line/index.d.ts b/packages/turf-nearest-point-to-line/index.d.ts index fbfea55aad..51e7e16f40 100644 --- a/packages/turf-nearest-point-to-line/index.d.ts +++ b/packages/turf-nearest-point-to-line/index.d.ts @@ -1,8 +1,8 @@ /// type Points = GeoJSON.FeatureCollection; -type LineString = GeoJSON.LineString; -type Point = GeoJSON.Feature | GeoJSON.Point; +type LineString = GeoJSON.Feature | GeoJSON.LineString; +type Point = GeoJSON.Feature; /** * http://turfjs.org/docs/#nearestpointtoline diff --git a/packages/turf-nearest-point-to-line/index.js b/packages/turf-nearest-point-to-line/index.js index bb002dcfee..f1cb6092ac 100644 --- a/packages/turf-nearest-point-to-line/index.js +++ b/packages/turf-nearest-point-to-line/index.js @@ -10,9 +10,9 @@ var collectionOf = invariant.collectionOf; * The returned point has a `dist` property indicating its distance to the line. * * @name nearestPointToLine - * @param {FeatureCollection} points collection - * @param {Feature} line Feature - * @param {string} [units=kilometers] can be degrees, radians, miles, or kilometers + * @param {FeatureCollection} points Point Collection + * @param {Feature|LineString} line Line Feature + * @param {string} [units=kilometers] unit of the output distance property, can be degrees, radians, miles, or kilometer * @returns {Feature} the closest point * @example * var points = featureCollection([point([0, 0]), point([0.5, 0.5])]); diff --git a/packages/turf-nearest-point-to-line/types.ts b/packages/turf-nearest-point-to-line/types.ts new file mode 100644 index 0000000000..13352ac7a9 --- /dev/null +++ b/packages/turf-nearest-point-to-line/types.ts @@ -0,0 +1,7 @@ +import { featureCollection, point, lineString } from '@turf/helpers' +import * as nearestPointToLine from './' + +const points = featureCollection([point([0, 0]), point([0.5, 0.5])]); +const line = lineString([[1,1], [-1,1]]); + +const nearest: GeoJSON.Feature = nearestPointToLine(points, line) From 63e4969e22d58d1e929cecee887dccc7190557bc Mon Sep 17 00:00:00 2001 From: Denis Date: Sat, 16 Sep 2017 12:13:26 -0400 Subject: [PATCH 05/11] Extend properties to TypeScript definition --- packages/turf-nearest-point-to-line/index.d.ts | 11 +++++++++-- packages/turf-nearest-point-to-line/types.ts | 4 +++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/packages/turf-nearest-point-to-line/index.d.ts b/packages/turf-nearest-point-to-line/index.d.ts index 51e7e16f40..3ddfe0b897 100644 --- a/packages/turf-nearest-point-to-line/index.d.ts +++ b/packages/turf-nearest-point-to-line/index.d.ts @@ -1,12 +1,19 @@ /// +import { Units } from '@turf/helpers' + type Points = GeoJSON.FeatureCollection; type LineString = GeoJSON.Feature | GeoJSON.LineString; -type Point = GeoJSON.Feature; +interface Point extends GeoJSON.Feature { + properties: { + dist: number + [key: string]: any + } +} /** * http://turfjs.org/docs/#nearestpointtoline */ -declare function nearestPointToLine(points: Points, line: LineString): Point; +declare function nearestPointToLine(points: Points, line: LineString, units?: Units): Point; declare namespace nearestPointToLine { } export = nearestPointToLine; diff --git a/packages/turf-nearest-point-to-line/types.ts b/packages/turf-nearest-point-to-line/types.ts index 13352ac7a9..11ed0a0113 100644 --- a/packages/turf-nearest-point-to-line/types.ts +++ b/packages/turf-nearest-point-to-line/types.ts @@ -4,4 +4,6 @@ import * as nearestPointToLine from './' const points = featureCollection([point([0, 0]), point([0.5, 0.5])]); const line = lineString([[1,1], [-1,1]]); -const nearest: GeoJSON.Feature = nearestPointToLine(points, line) +const nearest = nearestPointToLine(points, line) +nearest.properties.dist +nearest.properties.foo From b681ff64be26e2bcc2fe74163be649330fa216ca Mon Sep 17 00:00:00 2001 From: Denis Date: Sat, 16 Sep 2017 13:24:45 -0400 Subject: [PATCH 06/11] Support Geometry input --- packages/turf-nearest-point-to-line/index.js | 2 + packages/turf-nearest-point-to-line/test.js | 10 ++++- .../turf-point-to-line-distance/index.d.ts | 2 +- packages/turf-point-to-line-distance/index.js | 30 ++++++-------- packages/turf-point-to-line-distance/test.js | 24 +++++++---- .../test/out/distances.json | 40 +++++++++---------- packages/turf-point-to-line-distance/types.ts | 10 +++++ 7 files changed, 72 insertions(+), 46 deletions(-) create mode 100644 packages/turf-point-to-line-distance/types.ts diff --git a/packages/turf-nearest-point-to-line/index.js b/packages/turf-nearest-point-to-line/index.js index f1cb6092ac..21c29ad409 100644 --- a/packages/turf-nearest-point-to-line/index.js +++ b/packages/turf-nearest-point-to-line/index.js @@ -27,7 +27,9 @@ module.exports = function (points, line, units) { // validation if (!points) throw new Error('points is required'); else collectionOf(points, 'Point', 'points'); + if (!line) throw new Error('line is required'); + else if (line.type === 'LineString') line = {type: 'Feature', geometry: line}; else featureOf(line, 'LineString', 'line'); var dist = Infinity; diff --git a/packages/turf-nearest-point-to-line/test.js b/packages/turf-nearest-point-to-line/test.js index c6c8b1c92f..4f5182a20d 100644 --- a/packages/turf-nearest-point-to-line/test.js +++ b/packages/turf-nearest-point-to-line/test.js @@ -41,7 +41,7 @@ test('turf-nearest-point-to-line', t => { test('turf-nearest-point-to-line -- throws', t => { const points = featureCollection([point([0, 0]), point([0, 1])]); - const line = lineString([[1,1], [-1,1]]); + const line = lineString([[1, 1], [-1, 1]]); t.throws(() => nearestPointToLine(null, line), /points is required/, 'missing points'); t.throws(() => nearestPointToLine(points, null), /line is required/, 'missing line'); @@ -52,3 +52,11 @@ test('turf-nearest-point-to-line -- throws', t => { t.end(); }); + +test('turf-nearest-point-to-line -- Geometry', t => { + const points = featureCollection([point([0, 0]), point([0, 1])]); + const line = lineString([[1, 1], [-1, 1]]); + + t.assert(nearestPointToLine(points, line.geometry)); + t.end(); +}); diff --git a/packages/turf-point-to-line-distance/index.d.ts b/packages/turf-point-to-line-distance/index.d.ts index 5bf3c17185..3a5cfaed4b 100644 --- a/packages/turf-point-to-line-distance/index.d.ts +++ b/packages/turf-point-to-line-distance/index.d.ts @@ -3,7 +3,7 @@ import {Units} from '@turf/helpers' type Point = GeoJSON.Feature | GeoJSON.Point | number[]; -type LineString = GeoJSON.LineString; +type LineString = GeoJSON.Feature | GeoJSON.LineString; /** * http://turfjs.org/docs/#pointto-line-distance diff --git a/packages/turf-point-to-line-distance/index.js b/packages/turf-point-to-line-distance/index.js index f6ef1dd391..aee9bd35fa 100644 --- a/packages/turf-point-to-line-distance/index.js +++ b/packages/turf-point-to-line-distance/index.js @@ -1,20 +1,13 @@ // (logic of computation inspired by: // https://stackoverflow.com/questions/32771458/distance-from-lat-lng-point-to-minor-arc-segment) -var meta = require('@turf/meta'); +var segmentEach = require('@turf/meta').segmentEach; var bearing = require('@turf/bearing'); var helpers = require('@turf/helpers'); var distance = require('@turf/distance'); -var invariant = require('@turf/invariant'); +var featureOf = require('@turf/invariant').featureOf; var rhumbBearing = require('@turf/rhumb-bearing'); var rhumbDistance = require('@turf/rhumb-distance'); -var turfLine = helpers.lineString; -var featureOf = invariant.featureOf; -var turfPoint = helpers.point; -var segmentEach = meta.segmentEach; -var bearingToAngle = helpers.bearingToAngle; -var convertDistance = helpers.convertDistance; -var degrees2radians = helpers.degrees2radians; /** * Returns the minimum distance between a {@link Point} and a {@link LineString}, being the distance from a line the @@ -36,10 +29,13 @@ var degrees2radians = helpers.degrees2radians; module.exports = function (point, line, units, mercator) { // validation if (!point) throw new Error('point is required'); - if (Array.isArray(point)) point = turfPoint(point); + if (Array.isArray(point)) point = helpers.point(point); + else if (point.type === 'Point') point = {type: 'Feature', geometry: point}; else featureOf(point, 'Point', 'point'); + if (!line) throw new Error('line is required'); - if (Array.isArray(line)) line = turfLine(line); + if (Array.isArray(line)) line = helpers.lineString(line); + else if (line.type === 'LineString') line = {type: 'Feature', geometry: line}; else featureOf(line, 'LineString', 'line'); var distance = Infinity; @@ -68,8 +64,8 @@ module.exports = function (point, line, units, mercator) { function distanceToSegment(p, a, b, units, mercator) { var distanceAP = (mercator !== true) ? distance(a, p, units) : euclideanDistance(a, p, units); - var azimuthAP = bearingToAngle((mercator !== true) ? bearing(a, p) : rhumbBearing(a, p)); - var azimuthAB = bearingToAngle((mercator !== true) ? bearing(a, b) : rhumbBearing(a, b)); + var azimuthAP = helpers.bearingToAngle((mercator !== true) ? bearing(a, p) : rhumbBearing(a, p)); + var azimuthAB = helpers.bearingToAngle((mercator !== true) ? bearing(a, b) : rhumbBearing(a, b)); var angleA = Math.abs(azimuthAP - azimuthAB); // if (angleA > 180) angleA = Math.abs(angleA - 360); // if the angle PAB is obtuse its projection on the line extending the segment falls outside the segment @@ -85,7 +81,7 @@ function distanceToSegment(p, a, b, units, mercator) { if (angleA > 90) return distanceAP; var azimuthBA = (azimuthAB + 180) % 360; - var azimuthBP = bearingToAngle((mercator !== true) ? bearing(b, p) : rhumbBearing(b, p)); + var azimuthBP = helpers.bearingToAngle((mercator !== true) ? bearing(b, p) : rhumbBearing(b, p)); var angleB = Math.abs(azimuthBP - azimuthBA); if (angleB > 180) angleB = Math.abs(angleB - 360); // also if the angle ABP is acute the projection of P falls outside the segment, on the other side @@ -110,7 +106,7 @@ function distanceToSegment(p, a, b, units, mercator) { /____________|____\ A H B */ - if (mercator !== true) return distanceAP * Math.sin(degrees2radians(angleA)); + if (mercator !== true) return distanceAP * Math.sin(helpers.degrees2radians(angleA)); return mercatorPH(a, b, p, units); } @@ -131,7 +127,7 @@ function mercatorPH(a, b, p, units) { delta = (a[0] > 0 || b[0] > 0 || p[0] > 0) ? -180 : 180; } - var origin = turfPoint(p); + var origin = helpers.point(p); var A = toMercator([a[0] + delta, a[1]]); var B = toMercator([b[0] + delta, b[1]]); var P = toMercator([p[0] + delta, p[1]]); @@ -194,7 +190,7 @@ function euclideanDistance(from, to, units) { var sqr = function (n) { return n * n; }; var squareD = sqr(p1[0] - p2[0]) + sqr(p1[1] - p2[1]); var d = Math.sqrt(squareD); - return convertDistance(d, 'meters', units); + return helpers.convertDistance(d, 'meters', units); } /** diff --git a/packages/turf-point-to-line-distance/test.js b/packages/turf-point-to-line-distance/test.js index 62d6989225..229c524a92 100644 --- a/packages/turf-point-to-line-distance/test.js +++ b/packages/turf-point-to-line-distance/test.js @@ -21,26 +21,28 @@ const fixtures = fs.readdirSync(directories.in).map(filename => { }); test('turf-point-to-line-distance', t => { + const results = {}; for (const {filename, name, geojson} of fixtures) { const [point, line] = geojson.features; let {units, mercator} = geojson.properties || {}; if (!units) units = 'kilometers'; const distance = pointToLineDistance(point, line, units, mercator); - // debug - var c = circle(point, distance, 200, units); - geojson.features.push(c); + // Store results + results[name] = round(distance, 10); - if (process.env.REGEN) write.sync(directories.out + filename, results); - const expected = load.sync(directories.out + 'distances.json'); - t.deepEqual(round(distance, 10), round(expected[name], 10), name); + // debug purposes + geojson.features.push(circle(point, distance, 200, units)); + if (process.env.REGEN) write.sync(directories.out + filename, geojson); } + if (process.env.REGEN) write.sync(directories.out + 'distances.json', results); + t.deepEqual(load.sync(directories.out + 'distances.json'), results); t.end(); }); test('turf-point-to-line-distance -- throws', t => { const pt = point([0, 0]); - const line = lineString([[1,1], [-1,1]]); + const line = lineString([[1, 1], [-1, 1]]); t.throws(() => pointToLineDistance(null, line), /point is required/, 'missing point'); t.throws(() => pointToLineDistance(pt, null), /line is required/, 'missing line'); @@ -50,3 +52,11 @@ test('turf-point-to-line-distance -- throws', t => { t.end(); }); + +test('turf-point-to-line-distance -- Geometry', t => { + const pt = point([0, 0]); + const line = lineString([[1, 1], [-1, 1]]); + + t.assert(pointToLineDistance(pt.geometry, line.geometry)); + t.end(); +}); diff --git a/packages/turf-point-to-line-distance/test/out/distances.json b/packages/turf-point-to-line-distance/test/out/distances.json index 18aab3dcfe..13106914d5 100644 --- a/packages/turf-point-to-line-distance/test/out/distances.json +++ b/packages/turf-point-to-line-distance/test/out/distances.json @@ -1,21 +1,21 @@ { - "segment1": 69.09334842498865, - "segment1a": 69.09334842498865, - "segment2": 69.09334842498865, - "segment3": 69.17074902579057, - "segment4": 333.73911452247074, - "segment-fiji": 27.556466166676397, - "line1": 23.616870857680677, - "line2": 188.02212276470638, - "line-fiji": 27.016029431060844, - "line-resolute-bay": 424.56987879032073, - "city-line1": 0.9997112294789969, - "city-line2": 3.583891652669501, - "city-segment-inside1": 1.1447896287675474, - "city-segment-inside2": 0.9977971634304259, - "city-segment-inside3": 3.4981840220723557, - "city-segment-obtuse1": 2.8582176667031516, - "city-segment-obtuse2": 3.35493956118816, - "city-segment-projected1": 3.589782772179696, - "city-segment-projected2": 4.1647711521094095 -} \ No newline at end of file + "city-line1": 0.9997112295, + "city-line2": 3.5838916527, + "city-segment-inside1": 1.1447896288, + "city-segment-inside2": 0.9977971634, + "city-segment-inside3": 3.4981840221, + "city-segment-obtuse1": 2.8582176667, + "city-segment-obtuse2": 3.3549395612, + "city-segment-projected1": 3.5897827722, + "city-segment-projected2": 4.1647711521, + "line-fiji": 27.0160294311, + "line-resolute-bay": 424.5698787903, + "line1": 23.6168708577, + "line2": 188.0221227647, + "segment-fiji": 27.5564661667, + "segment1": 69.093348425, + "segment1a": 69.093348425, + "segment2": 69.093348425, + "segment3": 69.1707490258, + "segment4": 333.7391145225 +} diff --git a/packages/turf-point-to-line-distance/types.ts b/packages/turf-point-to-line-distance/types.ts new file mode 100644 index 0000000000..241c526f4e --- /dev/null +++ b/packages/turf-point-to-line-distance/types.ts @@ -0,0 +1,10 @@ +import { point, lineString } from '@turf/helpers' +import * as pointToLineDistance from './' + +const pt = point([0, 0]) +const line = lineString([[1, 1],[-1, 1]]) +const distance: number = pointToLineDistance(pt, line, 'miles') + +pointToLineDistance(pt, line) +pointToLineDistance(pt, line, 'miles') +pointToLineDistance(pt, line, 'miles', true) From 0e24609ba9890637a225603b378eb011b4cb72e3 Mon Sep 17 00:00:00 2001 From: Denis Date: Sat, 16 Sep 2017 15:07:25 -0400 Subject: [PATCH 07/11] Support GeometryCollection --- packages/turf-nearest-point-to-line/README.md | 4 +- .../turf-nearest-point-to-line/index.d.ts | 4 +- packages/turf-nearest-point-to-line/index.js | 41 +++++++++++++++---- .../turf-nearest-point-to-line/package.json | 9 ++-- packages/turf-nearest-point-to-line/test.js | 16 ++++++-- packages/turf-nearest-point-to-line/types.ts | 6 ++- packages/turf-point-to-line-distance/index.js | 2 +- 7 files changed, 60 insertions(+), 22 deletions(-) diff --git a/packages/turf-nearest-point-to-line/README.md b/packages/turf-nearest-point-to-line/README.md index 09bbcdcb7d..a20789de5a 100644 --- a/packages/turf-nearest-point-to-line/README.md +++ b/packages/turf-nearest-point-to-line/README.md @@ -7,8 +7,8 @@ The returned point has a `dist` property indicating its distance to the line. **Parameters** -- `points` **[FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects)<[Point](http://geojson.org/geojson-spec.html#point)>** Point Collection -- `line` **[Feature](http://geojson.org/geojson-spec.html#feature-objects)<[LineString](http://geojson.org/geojson-spec.html#linestring)>** Line Feature +- `points` **([FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [GeometryCollection](http://geojson.org/geojson-spec.html#geometrycollection)<[Point](http://geojson.org/geojson-spec.html#point)>)** Point Collection +- `line` **([Feature](http://geojson.org/geojson-spec.html#feature-objects)<[LineString](http://geojson.org/geojson-spec.html#linestring)> | [LineString](http://geojson.org/geojson-spec.html#linestring))** Line Feature - `units` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** unit of the output distance property, can be degrees, radians, miles, or kilometer (optional, default `kilometers`) **Examples** diff --git a/packages/turf-nearest-point-to-line/index.d.ts b/packages/turf-nearest-point-to-line/index.d.ts index 3ddfe0b897..0496d2a05e 100644 --- a/packages/turf-nearest-point-to-line/index.d.ts +++ b/packages/turf-nearest-point-to-line/index.d.ts @@ -1,8 +1,8 @@ /// -import { Units } from '@turf/helpers' +import { Units, FeatureGeometryCollection } from '@turf/helpers' -type Points = GeoJSON.FeatureCollection; +type Points = GeoJSON.FeatureCollection | FeatureGeometryCollection; type LineString = GeoJSON.Feature | GeoJSON.LineString; interface Point extends GeoJSON.Feature { properties: { diff --git a/packages/turf-nearest-point-to-line/index.js b/packages/turf-nearest-point-to-line/index.js index 21c29ad409..1dc5221676 100644 --- a/packages/turf-nearest-point-to-line/index.js +++ b/packages/turf-nearest-point-to-line/index.js @@ -1,16 +1,14 @@ var meta = require('@turf/meta'); -var invariant = require('@turf/invariant'); var pointToLineDistance = require('@turf/point-to-line-distance'); -var featureOf = invariant.featureOf; var featureEach = meta.featureEach; -var collectionOf = invariant.collectionOf; +var geomEach = meta.geomEach; /** * Returns the closest {@link Point|point}, of a {@link FeatureCollection|collection} of points, to a {@link LineString|line}. * The returned point has a `dist` property indicating its distance to the line. * * @name nearestPointToLine - * @param {FeatureCollection} points Point Collection + * @param {FeatureCollection|GeometryCollection} points Point Collection * @param {Feature|LineString} line Line Feature * @param {string} [units=kilometers] unit of the output distance property, can be degrees, radians, miles, or kilometer * @returns {Feature} the closest point @@ -26,14 +24,16 @@ var collectionOf = invariant.collectionOf; module.exports = function (points, line, units) { // validation if (!points) throw new Error('points is required'); - else collectionOf(points, 'Point', 'points'); + points = handleCollection(points); + if (!points.features.length) throw new Error('points must contain features'); if (!line) throw new Error('line is required'); - else if (line.type === 'LineString') line = {type: 'Feature', geometry: line}; - else featureOf(line, 'LineString', 'line'); + var type = line.geometry ? line.geometry.type : line.type; + if (type !== 'LineString') throw new Error('line must be a LineString'); var dist = Infinity; var pt = null; + featureEach(points, function (point) { var d = pointToLineDistance(point, line, units); if (d < dist) { @@ -41,7 +41,32 @@ module.exports = function (points, line, units) { pt = point; } }); - pt.properties.dist = dist; return pt; }; + +/** + * Convert Collection to FeatureCollection + * + * @private + * @param {FeatureCollection|GeometryCollection} points Points + * @returns {FeatureCollection} points + */ +function handleCollection(points) { + var features = []; + var type = points.geometry ? points.geometry.type : points.type; + switch (type) { + case 'GeometryCollection': + geomEach(points, function (geom) { + if (geom.type === 'Point') features.push({type: 'Feature', properties: {}, geometry: geom}); + }); + return {type: 'FeatureCollection', features: features}; + case 'FeatureCollection': + points.features = points.features.filter(function (feature) { + return feature.geometry.type === 'Point'; + }); + return points; + default: + throw new Error('points must be a Point Collection'); + } +} diff --git a/packages/turf-nearest-point-to-line/package.json b/packages/turf-nearest-point-to-line/package.json index a0beabc13e..137ba24f87 100644 --- a/packages/turf-nearest-point-to-line/package.json +++ b/packages/turf-nearest-point-to-line/package.json @@ -35,13 +35,12 @@ "devDependencies": { "@turf/helpers": "4.7.1", "benchmark": "^2.1.4", - "write-json-file": "^2.2.0", "load-json-file": "^2.0.0", - "tape": "^4.6.3" + "tape": "^4.6.3", + "write-json-file": "^2.2.0" }, "dependencies": { - "@turf/point-to-line-distance": "4.7.1", - "@turf/meta": "4.7.1", - "@turf/invariant": "4.7.1" + "@turf/meta": "^4.7.3", + "@turf/point-to-line-distance": "^4.7.3" } } diff --git a/packages/turf-nearest-point-to-line/test.js b/packages/turf-nearest-point-to-line/test.js index 4f5182a20d..d4e878eb54 100644 --- a/packages/turf-nearest-point-to-line/test.js +++ b/packages/turf-nearest-point-to-line/test.js @@ -3,7 +3,7 @@ const test = require('tape'); const path = require('path'); const load = require('load-json-file'); const write = require('write-json-file'); -const {featureCollection, point, lineString, round} = require('@turf/helpers'); +const {geometryCollection, featureCollection, point, lineString, round} = require('@turf/helpers'); const nearestPointToLine = require('./'); const directories = { @@ -47,16 +47,26 @@ test('turf-nearest-point-to-line -- throws', t => { t.throws(() => nearestPointToLine(points, null), /line is required/, 'missing line'); t.throws(() => nearestPointToLine(points, line, 'invalid'), /units is invalid/, 'invalid units'); - t.throws(() => nearestPointToLine(points, points), /Invalid input to line, Feature with geometry required/, 'invalid line'); - t.throws(() => nearestPointToLine(line, line), /Invalid input to points, FeatureCollection required/, 'invalid points'); + t.throws(() => nearestPointToLine(points, points), /line must be a LineString/, 'invalid line'); + t.throws(() => nearestPointToLine(line, line), /points must be a Point Collection/, 'invalid points'); t.end(); }); test('turf-nearest-point-to-line -- Geometry', t => { const points = featureCollection([point([0, 0]), point([0, 1])]); + const geomPoints = geometryCollection([point([0, 0]).geometry, point([0, 1]).geometry]); const line = lineString([[1, 1], [-1, 1]]); t.assert(nearestPointToLine(points, line.geometry)); + t.assert(nearestPointToLine(geomPoints, line.geometry)); + t.end(); +}); + +test('turf-nearest-point-to-line -- Empty FeatureCollection', t => { + const points = featureCollection([]); + const line = lineString([[1, 1], [-1, 1]]); + + t.throws(() => nearestPointToLine(points, line), /points must contain features/, 'points must contain features'); t.end(); }); diff --git a/packages/turf-nearest-point-to-line/types.ts b/packages/turf-nearest-point-to-line/types.ts index 11ed0a0113..1d21fd8b5a 100644 --- a/packages/turf-nearest-point-to-line/types.ts +++ b/packages/turf-nearest-point-to-line/types.ts @@ -1,4 +1,4 @@ -import { featureCollection, point, lineString } from '@turf/helpers' +import { geometryCollection, featureCollection, point, lineString } from '@turf/helpers' import * as nearestPointToLine from './' const points = featureCollection([point([0, 0]), point([0.5, 0.5])]); @@ -7,3 +7,7 @@ const line = lineString([[1,1], [-1,1]]); const nearest = nearestPointToLine(points, line) nearest.properties.dist nearest.properties.foo + +// GeometryCollection +const geomPoints = geometryCollection([point([0, 0]).geometry, point([0.5, 0.5]).geometry]); +nearestPointToLine(geomPoints, line) \ No newline at end of file diff --git a/packages/turf-point-to-line-distance/index.js b/packages/turf-point-to-line-distance/index.js index aee9bd35fa..d228e8622d 100644 --- a/packages/turf-point-to-line-distance/index.js +++ b/packages/turf-point-to-line-distance/index.js @@ -35,7 +35,7 @@ module.exports = function (point, line, units, mercator) { if (!line) throw new Error('line is required'); if (Array.isArray(line)) line = helpers.lineString(line); - else if (line.type === 'LineString') line = {type: 'Feature', geometry: line}; + else if (line.type === 'LineString') line = {type: 'Feature', properties: {}, geometry: line}; else featureOf(line, 'LineString', 'line'); var distance = Infinity; From a6238d9c05df08d3e333c82bc9bebae2b5dde1df Mon Sep 17 00:00:00 2001 From: Denis Date: Sat, 16 Sep 2017 15:09:21 -0400 Subject: [PATCH 08/11] Update JSDocs --- packages/turf-nearest-point-to-line/README.md | 2 +- packages/turf-nearest-point-to-line/index.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/turf-nearest-point-to-line/README.md b/packages/turf-nearest-point-to-line/README.md index a20789de5a..009add3109 100644 --- a/packages/turf-nearest-point-to-line/README.md +++ b/packages/turf-nearest-point-to-line/README.md @@ -8,7 +8,7 @@ The returned point has a `dist` property indicating its distance to the line. **Parameters** - `points` **([FeatureCollection](http://geojson.org/geojson-spec.html#feature-collection-objects) \| [GeometryCollection](http://geojson.org/geojson-spec.html#geometrycollection)<[Point](http://geojson.org/geojson-spec.html#point)>)** Point Collection -- `line` **([Feature](http://geojson.org/geojson-spec.html#feature-objects)<[LineString](http://geojson.org/geojson-spec.html#linestring)> | [LineString](http://geojson.org/geojson-spec.html#linestring))** Line Feature +- `line` **([Feature](http://geojson.org/geojson-spec.html#feature-objects) \| [Geometry](http://geojson.org/geojson-spec.html#geometry)<[LineString](http://geojson.org/geojson-spec.html#linestring)>)** Line Feature - `units` **\[[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)]** unit of the output distance property, can be degrees, radians, miles, or kilometer (optional, default `kilometers`) **Examples** diff --git a/packages/turf-nearest-point-to-line/index.js b/packages/turf-nearest-point-to-line/index.js index 1dc5221676..e750b3915e 100644 --- a/packages/turf-nearest-point-to-line/index.js +++ b/packages/turf-nearest-point-to-line/index.js @@ -9,7 +9,7 @@ var geomEach = meta.geomEach; * * @name nearestPointToLine * @param {FeatureCollection|GeometryCollection} points Point Collection - * @param {Feature|LineString} line Line Feature + * @param {Feature|Geometry} line Line Feature * @param {string} [units=kilometers] unit of the output distance property, can be degrees, radians, miles, or kilometer * @returns {Feature} the closest point * @example From c04ccd5585723ee1f85b99f897418e50e8479b92 Mon Sep 17 00:00:00 2001 From: Denis Date: Sat, 16 Sep 2017 15:34:28 -0400 Subject: [PATCH 09/11] Convert test/in to GeometryCollection --- packages/turf-nearest-point-to-line/test.js | 2 +- .../test/in/fiji.geojson | 58 +++++-------- .../test/in/on-line.geojson | 82 ++++++------------- .../test/in/one.geojson | 34 +++----- .../test/in/resolute.geojson | 42 ++++------ .../test/in/segment.geojson | 36 ++++---- .../test/in/two.geojson | 42 ++++------ .../test/out/fiji.geojson | 53 +++++++++++- .../test/out/on-line.geojson | 74 ++++++++++++++++- .../test/out/one.geojson | 34 +++++++- .../test/out/resolute.geojson | 39 ++++++++- .../test/out/segment.geojson | 34 +++++++- .../test/out/two.geojson | 39 ++++++++- 13 files changed, 367 insertions(+), 202 deletions(-) diff --git a/packages/turf-nearest-point-to-line/test.js b/packages/turf-nearest-point-to-line/test.js index d4e878eb54..fc30bcfae6 100644 --- a/packages/turf-nearest-point-to-line/test.js +++ b/packages/turf-nearest-point-to-line/test.js @@ -30,7 +30,7 @@ test('turf-nearest-point-to-line', t => { 'marker-size': 'large', 'marker-symbol': 'star' }); - const results = featureCollection([nearest, line]); + const results = featureCollection([points, nearest, line]); if (process.env.REGEN) write.sync(directories.out + filename, results); t.deepEqual(results, load.sync(directories.out + filename), name); diff --git a/packages/turf-nearest-point-to-line/test/in/fiji.geojson b/packages/turf-nearest-point-to-line/test/in/fiji.geojson index 95780bcff6..6011d663bf 100644 --- a/packages/turf-nearest-point-to-line/test/in/fiji.geojson +++ b/packages/turf-nearest-point-to-line/test/in/fiji.geojson @@ -2,75 +2,55 @@ "type": "FeatureCollection", "features": [ { - "type": "FeatureCollection", - "features": [ - { - "type": "Feature", - "properties": {}, - "geometry": { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "GeometryCollection", + "geometries": [ + { "type": "Point", "coordinates": [ 180.60699462890625, -16.62303335009946 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ 181.0986328125, -17.027898881942694 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ 179.10186767578125, -17.413546114374437 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ 180.516357421875, -17.287709050621917 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ 179.37103271484375, -16.691447830122993 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ 180.25817871093747, -16.95435146120393 ] } - } - ] + ] + } }, { "type": "Feature", @@ -98,4 +78,4 @@ } } ] -} \ No newline at end of file +} diff --git a/packages/turf-nearest-point-to-line/test/in/on-line.geojson b/packages/turf-nearest-point-to-line/test/in/on-line.geojson index f83e1a4b69..ee5997be2b 100644 --- a/packages/turf-nearest-point-to-line/test/in/on-line.geojson +++ b/packages/turf-nearest-point-to-line/test/in/on-line.geojson @@ -2,108 +2,76 @@ "type": "FeatureCollection", "features": [ { - "type": "FeatureCollection", - "features": [ - { - "type": "Feature", - "properties": {}, - "geometry": { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "GeometryCollection", + "geometries": [ + { "type": "Point", "coordinates": [ -23.62060546875, 15.050905707724771 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -22.813110351562496, 16.093320185359257 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -23.1646728515625, 15.220589019578128 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -24.4061279296875, 14.966013251567164 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -22.93670654296875, 16.759837823776632 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -24.3182373046875, 16.609873919524187 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -24.98291015625, 16.867633616803836 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -25.191650390625, 17.056784609942554 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -22.818603515625, 15.31597593426845 ] } - } - ] + ] + } }, { "type": "Feature", @@ -143,4 +111,4 @@ } } ] -} \ No newline at end of file +} diff --git a/packages/turf-nearest-point-to-line/test/in/one.geojson b/packages/turf-nearest-point-to-line/test/in/one.geojson index 443c1683fa..34c5c6479c 100644 --- a/packages/turf-nearest-point-to-line/test/in/one.geojson +++ b/packages/turf-nearest-point-to-line/test/in/one.geojson @@ -5,42 +5,34 @@ }, "features": [ { - "type": "FeatureCollection", - "features": [ - { - "type": "Feature", - "properties": {}, - "geometry": { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "GeometryCollection", + "geometries": [ + { "type": "Point", "coordinates": [ 29.7509765625, 17.5602465032949 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ 28.388671875, 18.323240460443397 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ 29.619140624999996, 19.228176737766262 ] } - } - ] + ] + } }, { "type": "Feature", @@ -68,4 +60,4 @@ } } ] -} \ No newline at end of file +} diff --git a/packages/turf-nearest-point-to-line/test/in/resolute.geojson b/packages/turf-nearest-point-to-line/test/in/resolute.geojson index 7d03aabb7d..a6ac3ab342 100644 --- a/packages/turf-nearest-point-to-line/test/in/resolute.geojson +++ b/packages/turf-nearest-point-to-line/test/in/resolute.geojson @@ -2,53 +2,41 @@ "type": "FeatureCollection", "features": [ { - "type": "FeatureCollection", - "features": [ - { - "type": "Feature", - "properties": {}, - "geometry": { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "GeometryCollection", + "geometries": [ + { "type": "Point", "coordinates": [ -94.04296874999999, 75.24186616026972 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -75.1025390625, 74.66001636880338 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -87.2314453125, 75.50815837230884 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -95.8447265625, 71.80141030136785 ] } - } - ] + ] + } }, { "type": "Feature", @@ -76,4 +64,4 @@ } } ] -} \ No newline at end of file +} diff --git a/packages/turf-nearest-point-to-line/test/in/segment.geojson b/packages/turf-nearest-point-to-line/test/in/segment.geojson index 8e343906fc..906cd8e973 100644 --- a/packages/turf-nearest-point-to-line/test/in/segment.geojson +++ b/packages/turf-nearest-point-to-line/test/in/segment.geojson @@ -1,46 +1,38 @@ { "type": "FeatureCollection", - "properties": { + "properties": { "units": "miles" }, "features": [ { - "type": "FeatureCollection", - "features": [ - { - "type": "Feature", - "properties": {}, - "geometry": { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "GeometryCollection", + "geometries": [ + { "type": "Point", "coordinates": [ 27.26806640625, 14.243086862716888 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ 28.388671875, 18.323240460443397 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ 29.619140624999996, 19.228176737766262 ] } - } - ] + ] + } }, { "type": "Feature", @@ -60,4 +52,4 @@ } } ] -} \ No newline at end of file +} diff --git a/packages/turf-nearest-point-to-line/test/in/two.geojson b/packages/turf-nearest-point-to-line/test/in/two.geojson index 74a9aee526..4c70ec6d46 100644 --- a/packages/turf-nearest-point-to-line/test/in/two.geojson +++ b/packages/turf-nearest-point-to-line/test/in/two.geojson @@ -2,53 +2,41 @@ "type": "FeatureCollection", "features": [ { - "type": "FeatureCollection", - "features": [ - { - "type": "Feature", - "properties": {}, - "geometry": { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "GeometryCollection", + "geometries": [ + { "type": "Point", "coordinates": [ -32.7392578125, 28.76765910569123 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -36.25488281249999, 23.36242859340884 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -38.0126953125, 26.194876675795218 ] - } - }, - { - "type": "Feature", - "properties": {}, - "geometry": { + }, + { "type": "Point", "coordinates": [ -39.90234375, 27.059125784374068 ] } - } - ] + ] + } }, { "type": "Feature", @@ -80,4 +68,4 @@ } } ] -} \ No newline at end of file +} diff --git a/packages/turf-nearest-point-to-line/test/out/fiji.geojson b/packages/turf-nearest-point-to-line/test/out/fiji.geojson index 734fa93d4f..c706f0da57 100644 --- a/packages/turf-nearest-point-to-line/test/out/fiji.geojson +++ b/packages/turf-nearest-point-to-line/test/out/fiji.geojson @@ -1,6 +1,57 @@ { "type": "FeatureCollection", "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "GeometryCollection", + "geometries": [ + { + "type": "Point", + "coordinates": [ + 180.60699462890625, + -16.62303335009946 + ] + }, + { + "type": "Point", + "coordinates": [ + 181.0986328125, + -17.027898881942694 + ] + }, + { + "type": "Point", + "coordinates": [ + 179.10186767578125, + -17.413546114374437 + ] + }, + { + "type": "Point", + "coordinates": [ + 180.516357421875, + -17.287709050621917 + ] + }, + { + "type": "Point", + "coordinates": [ + 179.37103271484375, + -16.691447830122993 + ] + }, + { + "type": "Point", + "coordinates": [ + 180.25817871093747, + -16.95435146120393 + ] + } + ] + } + }, { "type": "Feature", "properties": { @@ -43,4 +94,4 @@ } } ] -} \ No newline at end of file +} diff --git a/packages/turf-nearest-point-to-line/test/out/on-line.geojson b/packages/turf-nearest-point-to-line/test/out/on-line.geojson index c077f77192..fa48f9e1d1 100644 --- a/packages/turf-nearest-point-to-line/test/out/on-line.geojson +++ b/packages/turf-nearest-point-to-line/test/out/on-line.geojson @@ -1,6 +1,78 @@ { "type": "FeatureCollection", "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "GeometryCollection", + "geometries": [ + { + "type": "Point", + "coordinates": [ + -23.62060546875, + 15.050905707724771 + ] + }, + { + "type": "Point", + "coordinates": [ + -22.813110351562496, + 16.093320185359257 + ] + }, + { + "type": "Point", + "coordinates": [ + -23.1646728515625, + 15.220589019578128 + ] + }, + { + "type": "Point", + "coordinates": [ + -24.4061279296875, + 14.966013251567164 + ] + }, + { + "type": "Point", + "coordinates": [ + -22.93670654296875, + 16.759837823776632 + ] + }, + { + "type": "Point", + "coordinates": [ + -24.3182373046875, + 16.609873919524187 + ] + }, + { + "type": "Point", + "coordinates": [ + -24.98291015625, + 16.867633616803836 + ] + }, + { + "type": "Point", + "coordinates": [ + -25.191650390625, + 17.056784609942554 + ] + }, + { + "type": "Point", + "coordinates": [ + -22.818603515625, + 15.31597593426845 + ] + } + ] + } + }, { "type": "Feature", "properties": { @@ -55,4 +127,4 @@ } } ] -} \ No newline at end of file +} diff --git a/packages/turf-nearest-point-to-line/test/out/one.geojson b/packages/turf-nearest-point-to-line/test/out/one.geojson index 51a4b416cc..a8cd4222db 100644 --- a/packages/turf-nearest-point-to-line/test/out/one.geojson +++ b/packages/turf-nearest-point-to-line/test/out/one.geojson @@ -1,10 +1,40 @@ { "type": "FeatureCollection", "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "GeometryCollection", + "geometries": [ + { + "type": "Point", + "coordinates": [ + 29.7509765625, + 17.5602465032949 + ] + }, + { + "type": "Point", + "coordinates": [ + 28.388671875, + 18.323240460443397 + ] + }, + { + "type": "Point", + "coordinates": [ + 29.619140624999996, + 19.228176737766262 + ] + } + ] + } + }, { "type": "Feature", "properties": { - "dist": 31.8014202148872, + "dist": 51.1794068256253, "marker-color": "#F00", "marker-size": "large", "marker-symbol": "star" @@ -43,4 +73,4 @@ } } ] -} \ No newline at end of file +} diff --git a/packages/turf-nearest-point-to-line/test/out/resolute.geojson b/packages/turf-nearest-point-to-line/test/out/resolute.geojson index e125acd73e..f32b8535d1 100644 --- a/packages/turf-nearest-point-to-line/test/out/resolute.geojson +++ b/packages/turf-nearest-point-to-line/test/out/resolute.geojson @@ -1,6 +1,43 @@ { "type": "FeatureCollection", "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "GeometryCollection", + "geometries": [ + { + "type": "Point", + "coordinates": [ + -94.04296874999999, + 75.24186616026972 + ] + }, + { + "type": "Point", + "coordinates": [ + -75.1025390625, + 74.66001636880338 + ] + }, + { + "type": "Point", + "coordinates": [ + -87.2314453125, + 75.50815837230884 + ] + }, + { + "type": "Point", + "coordinates": [ + -95.8447265625, + 71.80141030136785 + ] + } + ] + } + }, { "type": "Feature", "properties": { @@ -43,4 +80,4 @@ } } ] -} \ No newline at end of file +} diff --git a/packages/turf-nearest-point-to-line/test/out/segment.geojson b/packages/turf-nearest-point-to-line/test/out/segment.geojson index 8420089830..ca606de741 100644 --- a/packages/turf-nearest-point-to-line/test/out/segment.geojson +++ b/packages/turf-nearest-point-to-line/test/out/segment.geojson @@ -1,10 +1,40 @@ { "type": "FeatureCollection", "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "GeometryCollection", + "geometries": [ + { + "type": "Point", + "coordinates": [ + 27.26806640625, + 14.243086862716888 + ] + }, + { + "type": "Point", + "coordinates": [ + 28.388671875, + 18.323240460443397 + ] + }, + { + "type": "Point", + "coordinates": [ + 29.619140624999996, + 19.228176737766262 + ] + } + ] + } + }, { "type": "Feature", "properties": { - "dist": 55.5325298607931, + "dist": 89.3709123239481, "marker-color": "#F00", "marker-size": "large", "marker-symbol": "star" @@ -35,4 +65,4 @@ } } ] -} \ No newline at end of file +} diff --git a/packages/turf-nearest-point-to-line/test/out/two.geojson b/packages/turf-nearest-point-to-line/test/out/two.geojson index d93892d43f..b7fe56baf2 100644 --- a/packages/turf-nearest-point-to-line/test/out/two.geojson +++ b/packages/turf-nearest-point-to-line/test/out/two.geojson @@ -1,6 +1,43 @@ { "type": "FeatureCollection", "features": [ + { + "type": "Feature", + "properties": {}, + "geometry": { + "type": "GeometryCollection", + "geometries": [ + { + "type": "Point", + "coordinates": [ + -32.7392578125, + 28.76765910569123 + ] + }, + { + "type": "Point", + "coordinates": [ + -36.25488281249999, + 23.36242859340884 + ] + }, + { + "type": "Point", + "coordinates": [ + -38.0126953125, + 26.194876675795218 + ] + }, + { + "type": "Point", + "coordinates": [ + -39.90234375, + 27.059125784374068 + ] + } + ] + } + }, { "type": "Feature", "properties": { @@ -47,4 +84,4 @@ } } ] -} \ No newline at end of file +} From 162b94d734d11d2f8ac6cdc4a8f4fe60ed88bfb7 Mon Sep 17 00:00:00 2001 From: Denis Date: Sat, 16 Sep 2017 15:55:33 -0400 Subject: [PATCH 10/11] Add Circle to test debug --- .../turf-nearest-point-to-line/package.json | 1 + packages/turf-nearest-point-to-line/test.js | 7 +- .../test/out/fiji.geojson | 273 ++++ .../test/out/on-line.geojson | 273 ++++ .../test/out/one.geojson | 275 +++- .../test/out/resolute.geojson | 273 ++++ .../test/out/segment.geojson | 275 +++- .../test/out/two.geojson | 273 ++++ packages/turf-nearest-point-to-line/yarn.lock | 1185 +---------------- 9 files changed, 1699 insertions(+), 1136 deletions(-) diff --git a/packages/turf-nearest-point-to-line/package.json b/packages/turf-nearest-point-to-line/package.json index 137ba24f87..23b4b8f1e8 100644 --- a/packages/turf-nearest-point-to-line/package.json +++ b/packages/turf-nearest-point-to-line/package.json @@ -33,6 +33,7 @@ }, "homepage": "https://github.com/Turfjs/turf", "devDependencies": { + "@turf/circle": "^4.7.3", "@turf/helpers": "4.7.1", "benchmark": "^2.1.4", "load-json-file": "^2.0.0", diff --git a/packages/turf-nearest-point-to-line/test.js b/packages/turf-nearest-point-to-line/test.js index fc30bcfae6..a00b99f5e7 100644 --- a/packages/turf-nearest-point-to-line/test.js +++ b/packages/turf-nearest-point-to-line/test.js @@ -3,6 +3,7 @@ const test = require('tape'); const path = require('path'); const load = require('load-json-file'); const write = require('write-json-file'); +const circle = require('@turf/circle'); const {geometryCollection, featureCollection, point, lineString, round} = require('@turf/helpers'); const nearestPointToLine = require('./'); @@ -24,13 +25,15 @@ test('turf-nearest-point-to-line', t => { const [points, line] = geojson.features; let {units} = geojson.properties || {}; const nearest = nearestPointToLine(points, line, units); - nearest.properties.dist = round(nearest.properties.dist, 13); + const distance = round(nearest.properties.dist, 13); + nearest.properties.dist = distance; nearest.properties = Object.assign(nearest.properties, { 'marker-color': '#F00', 'marker-size': 'large', 'marker-symbol': 'star' }); - const results = featureCollection([points, nearest, line]); + const distanceCircle = circle(nearest, distance || 1, null, units, {fill: '#F00'}); + const results = featureCollection([points, nearest, line, distanceCircle]); if (process.env.REGEN) write.sync(directories.out + filename, results); t.deepEqual(results, load.sync(directories.out + filename), name); diff --git a/packages/turf-nearest-point-to-line/test/out/fiji.geojson b/packages/turf-nearest-point-to-line/test/out/fiji.geojson index c706f0da57..0964c957c2 100644 --- a/packages/turf-nearest-point-to-line/test/out/fiji.geojson +++ b/packages/turf-nearest-point-to-line/test/out/fiji.geojson @@ -92,6 +92,279 @@ ] ] } + }, + { + "type": "Feature", + "properties": { + "fill": "#F00" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 180.25817871093747, + -16.92283728273034 + ], + [ + 180.26140745517685, + -16.922989006748615 + ], + [ + 180.2646051203381, + -16.923442718347573 + ], + [ + 180.26774092605737, + -16.924194050196636 + ], + [ + 180.27078468654537, + -16.925235770067523 + ], + [ + 180.27370710076607, + -16.926557850350097 + ], + [ + 180.27648003415976, + -16.928147564442767 + ], + [ + 180.27907678921423, + -16.929989609096015 + ], + [ + 180.28147236229424, + -16.932066251539226 + ], + [ + 180.28364368426517, + -16.934357499983644 + ], + [ + 180.28556984260155, + -16.93684129586978 + ], + [ + 180.28723228284287, + -16.93949372601873 + ], + [ + 180.2886149874553, + -16.942289252655215 + ], + [ + 180.28970463036944, + -16.945200959097615 + ], + [ + 180.29049070569587, + -16.948200808758514 + ], + [ + 180.2909656293636, + -16.951259914970034 + ], + [ + 180.2911248126863, + -16.954348819042398 + ], + [ + 180.29096670712613, + -16.957437773883147 + ], + [ + 180.29049281980318, + -16.960497030448806 + ], + [ + 180.2897076995777, + -16.963497124271584 + ], + [ + 180.28861889381645, + -16.966409159300607 + ], + [ + 180.28723687623776, + -16.969205086321065 + ], + [ + 180.28557494650863, + -16.97185797326481 + ], + [ + 180.28364910254425, + -16.974342264802207 + ], + [ + 180.28147788672385, + -16.97663402870676 + ], + [ + 180.27908220749367, + -16.978711186610127 + ], + [ + 180.27648513806756, + -16.980553726914707 + ], + [ + 180.2737116941619, + -16.982143897802292 + ], + [ + 180.27078859290754, + -16.98346637846897 + ], + [ + 180.2677439952665, + -16.984508426926606 + ], + [ + 180.26460723444615, + -16.98526000293766 + ], + [ + 180.2614085329398, + -16.985713864890837 + ], + [ + 180.25817871093747, + -16.98586563967752 + ], + [ + 180.25494888893516, + -16.985713864890837 + ], + [ + 180.25175018742883, + -16.98526000293766 + ], + [ + 180.24861342660847, + -16.984508426926606 + ], + [ + 180.24556882896744, + -16.98346637846897 + ], + [ + 180.24264572771307, + -16.982143897802292 + ], + [ + 180.23987228380741, + -16.980553726914707 + ], + [ + 180.2372752143813, + -16.978711186610127 + ], + [ + 180.23487953515112, + -16.97663402870676 + ], + [ + 180.23270831933073, + -16.974342264802207 + ], + [ + 180.23078247536634, + -16.97185797326481 + ], + [ + 180.2291205456372, + -16.969205086321065 + ], + [ + 180.2277385280585, + -16.966409159300607 + ], + [ + 180.22664972229728, + -16.963497124271584 + ], + [ + 180.2258646020718, + -16.960497030448806 + ], + [ + 180.22539071474884, + -16.957437773883147 + ], + [ + 180.22523260918868, + -16.954348819042398 + ], + [ + 180.22539179251137, + -16.951259914970034 + ], + [ + 180.2258667161791, + -16.948200808758514 + ], + [ + 180.2266527915055, + -16.945200959097615 + ], + [ + 180.22774243441967, + -16.942289252655215 + ], + [ + 180.2291251390321, + -16.93949372601873 + ], + [ + 180.23078757927343, + -16.93684129586978 + ], + [ + 180.2327137376098, + -16.934357499983644 + ], + [ + 180.23488505958073, + -16.932066251539226 + ], + [ + 180.23728063266074, + -16.929989609096015 + ], + [ + 180.2398773877152, + -16.928147564442767 + ], + [ + 180.24265032110887, + -16.926557850350097 + ], + [ + 180.2455727353296, + -16.925235770067523 + ], + [ + 180.2486164958176, + -16.924194050196636 + ], + [ + 180.25175230153687, + -16.923442718347573 + ], + [ + 180.2549499666981, + -16.922989006748615 + ], + [ + 180.25817871093747, + -16.92283728273034 + ] + ] + ] + } } ] } diff --git a/packages/turf-nearest-point-to-line/test/out/on-line.geojson b/packages/turf-nearest-point-to-line/test/out/on-line.geojson index fa48f9e1d1..c7a7bddd67 100644 --- a/packages/turf-nearest-point-to-line/test/out/on-line.geojson +++ b/packages/turf-nearest-point-to-line/test/out/on-line.geojson @@ -125,6 +125,279 @@ ] ] } + }, + { + "type": "Feature", + "properties": { + "fill": "#F00" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -22.818603515625, + 15.324966328041096 + ], + [ + -22.817689814037777, + 15.324923034981438 + ], + [ + -22.816784913022158, + 15.32479357279178 + ], + [ + -22.815897528352142, + 15.324579188422172 + ], + [ + -22.81503620702483, + 15.324281946768512 + ], + [ + -22.8142092449098, + 15.323904710776553 + ], + [ + -22.813424606821755, + 15.323451113856875 + ], + [ + -22.812689849787404, + 15.322925524876926 + ], + [ + -22.812012050246686, + 15.32233300606795 + ], + [ + -22.81139773589021, + 15.321679264252845 + ], + [ + -22.810852822789766, + 15.320970595865477 + ], + [ + -22.810382558427623, + 15.320213826291695 + ], + [ + -22.809991471173092, + 15.319416244117111 + ], + [ + -22.80968332669234, + 15.318585530915522 + ], + [ + -22.809461091710627, + 15.317729687254959 + ], + [ + -22.80932690547472, + 15.31685695563459 + ], + [ + -22.809282059189137, + 15.315975741095059 + ], + [ + -22.809326983622757, + 15.3150945302673 + ], + [ + -22.809461245003522, + 15.314221809639605 + ], + [ + -22.80968354923913, + 15.313365983830181 + ], + [ + -22.80999175442142, + 15.31253529465218 + ], + [ + -22.810382891492427, + 15.311737741750424 + ], + [ + -22.810853192871548, + 15.310981005573773 + ], + [ + -22.81139812876694, + 15.310272373424402 + ], + [ + -22.812012450820323, + 15.309618669295554 + ], + [ + -22.81269024266413, + 15.309026188172842 + ], + [ + -22.813424976903544, + 15.308500635430889 + ], + [ + -22.81420957797461, + 15.308047071908343 + ], + [ + -22.81503649027317, + 15.30766986518921 + ], + [ + -22.815897750898937, + 15.307372647559141 + ], + [ + -22.816785066315056, + 15.307158281040671 + ], + [ + -22.817689892185818, + 15.30702882984369 + ], + [ + -22.818603515625, + 15.306985540495802 + ], + [ + -22.819517139064185, + 15.30702882984369 + ], + [ + -22.820421964934948, + 15.307158281040671 + ], + [ + -22.821309280351066, + 15.307372647559141 + ], + [ + -22.822170540976835, + 15.30766986518921 + ], + [ + -22.822997453275395, + 15.308047071908343 + ], + [ + -22.82378205434646, + 15.308500635430889 + ], + [ + -22.824516788585875, + 15.309026188172842 + ], + [ + -22.82519458042968, + 15.309618669295554 + ], + [ + -22.825808902483065, + 15.310272373424402 + ], + [ + -22.826353838378456, + 15.310981005573773 + ], + [ + -22.826824139757573, + 15.311737741750424 + ], + [ + -22.827215276828582, + 15.31253529465218 + ], + [ + -22.827523482010875, + 15.313365983830181 + ], + [ + -22.82774578624648, + 15.314221809639605 + ], + [ + -22.827880047627243, + 15.3150945302673 + ], + [ + -22.827924972060867, + 15.315975741095059 + ], + [ + -22.827880125775284, + 15.31685695563459 + ], + [ + -22.827745939539373, + 15.317729687254959 + ], + [ + -22.827523704557663, + 15.318585530915522 + ], + [ + -22.82721556007691, + 15.319416244117111 + ], + [ + -22.82682447282238, + 15.320213826291695 + ], + [ + -22.826354208460238, + 15.320970595865477 + ], + [ + -22.82580929535979, + 15.321679264252845 + ], + [ + -22.825194981003317, + 15.32233300606795 + ], + [ + -22.8245171814626, + 15.322925524876926 + ], + [ + -22.82378242442825, + 15.323451113856875 + ], + [ + -22.822997786340203, + 15.323904710776553 + ], + [ + -22.822170824225175, + 15.324281946768512 + ], + [ + -22.821309502897858, + 15.324579188422172 + ], + [ + -22.820422118227846, + 15.32479357279178 + ], + [ + -22.819517217212226, + 15.324923034981438 + ], + [ + -22.818603515625, + 15.324966328041096 + ] + ] + ] + } } ] } diff --git a/packages/turf-nearest-point-to-line/test/out/one.geojson b/packages/turf-nearest-point-to-line/test/out/one.geojson index a8cd4222db..170e3a79db 100644 --- a/packages/turf-nearest-point-to-line/test/out/one.geojson +++ b/packages/turf-nearest-point-to-line/test/out/one.geojson @@ -34,7 +34,7 @@ { "type": "Feature", "properties": { - "dist": 51.1794068256253, + "dist": 31.8014202148872, "marker-color": "#F00", "marker-size": "large", "marker-symbol": "star" @@ -71,6 +71,279 @@ ] ] } + }, + { + "type": "Feature", + "properties": { + "fill": "#F00" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 29.7509765625, + 18.020369523707792 + ], + [ + 29.798401827482373, + 18.0181482267381 + ], + [ + 29.845366834454154, + 18.011505895238997 + ], + [ + 29.89141589739495, + 18.000506993132046 + ], + [ + 29.936102424532006, + 17.98525824826815 + ], + [ + 29.97899334186073, + 17.965907592565877 + ], + [ + 30.01967337036126, + 17.94264269441037 + ], + [ + 30.05774911145306, + 17.91568909922797 + ], + [ + 30.092852897954906, + 17.88530799829273 + ], + [ + 30.124646371091774, + 17.851793649673876 + ], + [ + 30.152823747832677, + 17.81547047874912 + ], + [ + 30.17711474696761, + 17.776689888849123 + ], + [ + 30.19728714674601, + 17.735826815332185 + ], + [ + 30.21314895151163, + 17.69327605869468 + ], + [ + 30.22455014949058, + 17.649448434189697 + ], + [ + 30.231384048636933, + 17.604766776848717 + ], + [ + 30.23358818213892, + 17.55966184178362 + ], + [ + 30.231144779771462, + 17.51456814019756 + ], + [ + 30.224080805694253, + 17.469919751668844 + ], + [ + 30.212467567493327, + 17.426146153011082 + ], + [ + 30.19641990521581, + 17.383668103377314 + ], + [ + 30.176094972829894, + 17.342893624290557 + ], + [ + 30.151690627939942, + 17.30421411197222 + ], + [ + 30.123443448695813, + 17.26800061773043 + ], + [ + 30.091626399654885, + 17.23460033028599 + ], + [ + 30.056546170890677, + 17.204333291781133 + ], + [ + 30.018540216901354, + 17.17748937685841 + ], + [ + 29.977973523865394, + 17.15432556163748 + ], + [ + 29.935235135530665, + 17.135063506679593 + ], + [ + 29.89073446951902, + 17.119887475133638 + ], + [ + 29.84489745709067, + 17.108942604226822 + ], + [ + 29.798162540450477, + 17.102333545116693 + ], + [ + 29.7509765625, + 17.100123482882008 + ], + [ + 29.703790584549523, + 17.102333545116693 + ], + [ + 29.65705566790933, + 17.108942604226822 + ], + [ + 29.611218655480975, + 17.119887475133638 + ], + [ + 29.566717989469335, + 17.135063506679593 + ], + [ + 29.523979601134602, + 17.15432556163748 + ], + [ + 29.483412908098643, + 17.17748937685841 + ], + [ + 29.445406954109323, + 17.204333291781133 + ], + [ + 29.41032672534511, + 17.23460033028599 + ], + [ + 29.378509676304184, + 17.26800061773043 + ], + [ + 29.350262497060054, + 17.30421411197222 + ], + [ + 29.325858152170106, + 17.342893624290557 + ], + [ + 29.305533219784188, + 17.383668103377314 + ], + [ + 29.289485557506673, + 17.426146153011082 + ], + [ + 29.277872319305743, + 17.469919751668844 + ], + [ + 29.270808345228538, + 17.51456814019756 + ], + [ + 29.268364942861076, + 17.55966184178362 + ], + [ + 29.270569076363067, + 17.604766776848717 + ], + [ + 29.27740297550942, + 17.649448434189697 + ], + [ + 29.28880417348837, + 17.69327605869468 + ], + [ + 29.304665978253986, + 17.735826815332185 + ], + [ + 29.324838378032386, + 17.776689888849123 + ], + [ + 29.349129377167323, + 17.81547047874912 + ], + [ + 29.377306753908226, + 17.851793649673876 + ], + [ + 29.40910022704509, + 17.88530799829273 + ], + [ + 29.444204013546937, + 17.91568909922797 + ], + [ + 29.482279754638736, + 17.94264269441037 + ], + [ + 29.522959783139267, + 17.965907592565877 + ], + [ + 29.565850700467994, + 17.98525824826815 + ], + [ + 29.61053722760505, + 18.000506993132046 + ], + [ + 29.656586290545846, + 18.011505895238997 + ], + [ + 29.703551297517627, + 18.0181482267381 + ], + [ + 29.7509765625, + 18.020369523707792 + ] + ] + ] + } } ] } diff --git a/packages/turf-nearest-point-to-line/test/out/resolute.geojson b/packages/turf-nearest-point-to-line/test/out/resolute.geojson index f32b8535d1..58a94f7299 100644 --- a/packages/turf-nearest-point-to-line/test/out/resolute.geojson +++ b/packages/turf-nearest-point-to-line/test/out/resolute.geojson @@ -78,6 +78,279 @@ ] ] } + }, + { + "type": "Feature", + "properties": { + "fill": "#F00" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -87.2314453125, + 75.74515005991336 + ], + [ + -87.13711546640516, + 75.74399036006236 + ], + [ + -87.04373852535383, + 75.74052298011723 + ], + [ + -86.95225641538097, + 75.7347829435378 + ], + [ + -86.86358928800111, + 75.72682817383318 + ], + [ + -86.77862508612732, + 75.71673882911684 + ], + [ + -86.69820963851318, + 75.70461638611047 + ], + [ + -86.62313743422634, + 75.69058248864654 + ], + [ + -86.5541432091043, + 75.67477757922566 + ], + [ + -86.49189445353588, + 75.6573593351559 + ], + [ + -86.43698492629511, + 75.63850093317049 + ], + [ + -86.38992923359613, + 75.61838916815753 + ], + [ + -86.35115850708308, + 75.59722245272981 + ], + [ + -86.32101719007805, + 75.57520872483734 + ], + [ + -86.29976091890596, + 75.55256329051855 + ], + [ + -86.28755546616019, + 75.52950662825931 + ], + [ + -86.28447669584223, + 75.5062621803556 + ], + [ + -86.29051146669086, + 75.48305415523733 + ], + [ + -86.30555940981604, + 75.46010536299346 + ], + [ + -86.32943549991796, + 75.43763510442683 + ], + [ + -86.3618733357048, + 75.4158571319414 + ], + [ + -86.40252904432666, + 75.3949776984985 + ], + [ + -86.45098572633513, + 75.37519370883514 + ], + [ + -86.50675836143384, + 75.3566909851694 + ], + [ + -86.56929910065334, + 75.33964265776739 + ], + [ + -86.63800287711936, + 75.32420768904333 + ], + [ + -86.71221327485428, + 75.310529538328 + ], + [ + -86.79122860266388, + 75.2987349730824 + ], + [ + -86.87430812775848, + 75.2889330311531 + ], + [ + -86.9606784310271, + 75.28121413765774 + ], + [ + -87.04953985256526, + 75.27564937924163 + ], + [ + -87.1400730019311, + 75.27228993774082 + ], + [ + -87.2314453125, + 75.27116668470433 + ], + [ + -87.3228176230689, + 75.27228993774082 + ], + [ + -87.41335077243474, + 75.27564937924163 + ], + [ + -87.5022121939729, + 75.28121413765774 + ], + [ + -87.58858249724152, + 75.2889330311531 + ], + [ + -87.67166202233614, + 75.2987349730824 + ], + [ + -87.75067735014574, + 75.310529538328 + ], + [ + -87.82488774788064, + 75.32420768904333 + ], + [ + -87.89359152434668, + 75.33964265776739 + ], + [ + -87.95613226356616, + 75.3566909851694 + ], + [ + -88.01190489866487, + 75.37519370883514 + ], + [ + -88.06036158067334, + 75.3949776984985 + ], + [ + -88.1010172892952, + 75.4158571319414 + ], + [ + -88.13345512508204, + 75.43763510442683 + ], + [ + -88.15733121518396, + 75.46010536299346 + ], + [ + -88.17237915830916, + 75.48305415523733 + ], + [ + -88.17841392915777, + 75.5062621803556 + ], + [ + -88.17533515883981, + 75.52950662825931 + ], + [ + -88.16312970609404, + 75.55256329051855 + ], + [ + -88.14187343492195, + 75.57520872483734 + ], + [ + -88.11173211791692, + 75.59722245272981 + ], + [ + -88.07296139140387, + 75.61838916815753 + ], + [ + -88.02590569870489, + 75.63850093317049 + ], + [ + -87.97099617146412, + 75.6573593351559 + ], + [ + -87.9087474158957, + 75.67477757922566 + ], + [ + -87.83975319077366, + 75.69058248864654 + ], + [ + -87.76468098648682, + 75.70461638611047 + ], + [ + -87.68426553887268, + 75.71673882911684 + ], + [ + -87.59930133699889, + 75.72682817383318 + ], + [ + -87.51063420961903, + 75.7347829435378 + ], + [ + -87.41915209964617, + 75.74052298011723 + ], + [ + -87.32577515859484, + 75.74399036006236 + ], + [ + -87.2314453125, + 75.74515005991336 + ] + ] + ] + } } ] } diff --git a/packages/turf-nearest-point-to-line/test/out/segment.geojson b/packages/turf-nearest-point-to-line/test/out/segment.geojson index ca606de741..e46f3a930a 100644 --- a/packages/turf-nearest-point-to-line/test/out/segment.geojson +++ b/packages/turf-nearest-point-to-line/test/out/segment.geojson @@ -34,7 +34,7 @@ { "type": "Feature", "properties": { - "dist": 89.3709123239481, + "dist": 55.5325298607931, "marker-color": "#F00", "marker-size": "large", "marker-symbol": "star" @@ -63,6 +63,279 @@ ] ] } + }, + { + "type": "Feature", + "properties": { + "fill": "#F00" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + 27.268066406250004, + 15.046566556329937 + ], + [ + 27.34961301171175, + 15.04268354039556 + ], + [ + 27.43036560509869, + 15.031072310022385 + ], + [ + 27.509538173049005, + 15.01184593581434 + ], + [ + 27.5863606074305, + 14.985191600951385 + ], + [ + 27.660086429082174, + 14.951368714975777 + ], + [ + 27.730000241379773, + 14.910706303849164 + ], + [ + 27.795424830851758, + 14.863599706357817 + ], + [ + 27.85572783799104, + 14.81050661459659 + ], + [ + 27.91032792842231, + 14.751942503259729 + ], + [ + 27.95870040247301, + 14.688475498713954 + ], + [ + 28.000382189720955, + 14.620720744257305 + ], + [ + 28.034976184014795, + 14.549334322532511 + ], + [ + 28.06215488355595, + 14.475006799748384 + ], + [ + 28.081663309682863, + 14.398456459170907 + ], + [ + 28.09332118682831, + 14.32042229330184 + ], + [ + 28.097024374579817, + 14.241656825306483 + ], + [ + 28.09274555074808, + 14.162918830634434 + ], + [ + 28.080534151762517, + 14.084966029456634 + ], + [ + 28.060515583523284, + 14.008547819579189 + ], + [ + 28.032889722032387, + 13.934398117950755 + ], + [ + 27.997928728714665, + 13.863228376812856 + ], + [ + 27.95597421035276, + 13.795720838003911 + ], + [ + 27.907433758040774, + 13.732522085964083 + ], + [ + 27.852776903557245, + 13.674236956639005 + ], + [ + 27.79253053511818, + 13.621422855779503 + ], + [ + 27.727273817639144, + 13.574584536110509 + ], + [ + 27.65763266544927, + 13.534169378520284 + ], + [ + 27.584273817887407, + 13.500563217824318 + ], + [ + 27.50789857038972, + 13.474086748809798 + ], + [ + 27.42923621555796, + 13.45499254319047 + ], + [ + 27.349037250279473, + 13.443462702824968 + ], + [ + 27.268066406250004, + 13.439607169103843 + ], + [ + 27.18709556222053, + 13.443462702824968 + ], + [ + 27.106896596942043, + 13.45499254319047 + ], + [ + 27.028234242110283, + 13.474086748809798 + ], + [ + 26.9518589946126, + 13.500563217824318 + ], + [ + 26.878500147050733, + 13.534169378520284 + ], + [ + 26.80885899486086, + 13.574584536110509 + ], + [ + 26.743602277381825, + 13.621422855779503 + ], + [ + 26.683355908942758, + 13.674236956639005 + ], + [ + 26.62869905445923, + 13.732522085964083 + ], + [ + 26.580158602147243, + 13.795720838003911 + ], + [ + 26.53820408378534, + 13.863228376812856 + ], + [ + 26.503243090467617, + 13.934398117950755 + ], + [ + 26.47561722897672, + 14.008547819579189 + ], + [ + 26.455598660737486, + 14.084966029456634 + ], + [ + 26.443387261751923, + 14.162918830634434 + ], + [ + 26.439108437920186, + 14.241656825306483 + ], + [ + 26.442811625671695, + 14.32042229330184 + ], + [ + 26.45446950281714, + 14.398456459170907 + ], + [ + 26.473977928944052, + 14.475006799748384 + ], + [ + 26.50115662848521, + 14.549334322532511 + ], + [ + 26.535750622779048, + 14.620720744257305 + ], + [ + 26.577432410026994, + 14.688475498713954 + ], + [ + 26.625804884077695, + 14.751942503259729 + ], + [ + 26.680404974508964, + 14.810506614596587 + ], + [ + 26.740707981648246, + 14.863599706357817 + ], + [ + 26.80613257112023, + 14.910706303849164 + ], + [ + 26.87604638341783, + 14.951368714975777 + ], + [ + 26.949772205069504, + 14.985191600951385 + ], + [ + 27.026594639450998, + 15.01184593581434 + ], + [ + 27.10576720740131, + 15.031072310022385 + ], + [ + 27.186519800788254, + 15.04268354039556 + ], + [ + 27.268066406250004, + 15.046566556329937 + ] + ] + ] + } } ] } diff --git a/packages/turf-nearest-point-to-line/test/out/two.geojson b/packages/turf-nearest-point-to-line/test/out/two.geojson index b7fe56baf2..7299626af9 100644 --- a/packages/turf-nearest-point-to-line/test/out/two.geojson +++ b/packages/turf-nearest-point-to-line/test/out/two.geojson @@ -82,6 +82,279 @@ ] ] } + }, + { + "type": "Feature", + "properties": { + "fill": "#F00" + }, + "geometry": { + "type": "Polygon", + "coordinates": [ + [ + [ + -38.0126953125, + 26.89706388840599 + ], + [ + -37.93552441172803, + 26.893662035598062 + ], + [ + -37.85911039862827, + 26.883489849979018 + ], + [ + -37.784202324290746, + 26.866647103835728 + ], + [ + -37.71153366503345, + 26.84329893494962 + ], + [ + -37.641814778996846, + 26.81367413783948 + ], + [ + -37.57572564999091, + 26.7780628017451 + ], + [ + -37.513909005361654, + 26.736813324835175 + ], + [ + -37.456963887376354, + 26.69032884149463 + ], + [ + -37.40543974905283, + 26.63906310618754 + ], + [ + -37.35983113577391, + 26.583515883199183 + ], + [ + -37.32057300375018, + 26.52422789646192 + ], + [ + -37.288036715741825, + 26.461775397622354 + ], + [ + -37.262526743730376, + 26.396764413500016 + ], + [ + -37.244278097726884, + 26.32982473613523 + ], + [ + -37.23345448986008, + 26.261603719765624 + ], + [ + -37.23014723350783, + 26.192759949365364 + ], + [ + -37.23437486867239, + 26.123956844902548 + ], + [ + -37.2460834971584, + 26.05585626430064 + ], + [ + -37.26514780444807, + 25.98911216631813 + ], + [ + -37.29137273949325, + 25.924364392274782 + ], + [ + -37.32449581893367, + 25.862232622838107 + ], + [ + -37.36419001844701, + 25.80331056301978 + ], + [ + -37.41006721096029, + 25.74816040518909 + ], + [ + -37.46168210920786, + 25.697307616351463 + ], + [ + -37.5185366685034, + 25.651236092216436 + ], + [ + -37.5800849044965, + 25.610383716733395 + ], + [ + -37.6457380800029, + 25.57513836183868 + ], + [ + -37.71487021463542, + 25.545834358159915 + ], + [ + -37.786823870831, + 25.522749463381285 + ], + [ + -37.86091616989228, + 25.506102350900992 + ], + [ + -37.93644499177463, + 25.496050637318874 + ], + [ + -38.0126953125, + 25.492689463184444 + ], + [ + -38.08894563322538, + 25.496050637318874 + ], + [ + -38.16447445510772, + 25.506102350900992 + ], + [ + -38.238566754169, + 25.522749463381285 + ], + [ + -38.31052041036459, + 25.545834358159915 + ], + [ + -38.37965254499711, + 25.57513836183868 + ], + [ + -38.445305720503505, + 25.610383716733395 + ], + [ + -38.506853956496606, + 25.651236092216436 + ], + [ + -38.56370851579215, + 25.697307616351463 + ], + [ + -38.61532341403971, + 25.74816040518909 + ], + [ + -38.66120060655299, + 25.80331056301978 + ], + [ + -38.70089480606633, + 25.862232622838107 + ], + [ + -38.73401788550676, + 25.924364392274782 + ], + [ + -38.76024282055194, + 25.98911216631813 + ], + [ + -38.7793071278416, + 26.05585626430064 + ], + [ + -38.79101575632762, + 26.123956844902548 + ], + [ + -38.79524339149218, + 26.192759949365364 + ], + [ + -38.79193613513993, + 26.261603719765624 + ], + [ + -38.78111252727312, + 26.32982473613523 + ], + [ + -38.76286388126963, + 26.396764413500016 + ], + [ + -38.73735390925818, + 26.461775397622354 + ], + [ + -38.70481762124983, + 26.52422789646192 + ], + [ + -38.6655594892261, + 26.583515883199183 + ], + [ + -38.61995087594717, + 26.63906310618754 + ], + [ + -38.56842673762365, + 26.69032884149463 + ], + [ + -38.51148161963835, + 26.736813324835175 + ], + [ + -38.44966497500909, + 26.7780628017451 + ], + [ + -38.38357584600316, + 26.81367413783948 + ], + [ + -38.31385695996656, + 26.84329893494962 + ], + [ + -38.24118830070926, + 26.866647103835728 + ], + [ + -38.16628022637174, + 26.883489849979018 + ], + [ + -38.089866213271975, + 26.893662035598062 + ], + [ + -38.0126953125, + 26.89706388840599 + ] + ] + ] + } } ] } diff --git a/packages/turf-nearest-point-to-line/yarn.lock b/packages/turf-nearest-point-to-line/yarn.lock index 5c7f091cf7..da3a09ba45 100644 --- a/packages/turf-nearest-point-to-line/yarn.lock +++ b/packages/turf-nearest-point-to-line/yarn.lock @@ -2,910 +2,80 @@ # yarn lockfile v1 -"@mapbox/geojson-area@^0.2.2": - version "0.2.2" - resolved "https://registry.yarnpkg.com/@mapbox/geojson-area/-/geojson-area-0.2.2.tgz#18d7814aa36bf23fbbcc379f8e26a22927debf10" +"@turf/bearing@^4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@turf/bearing/-/bearing-4.7.3.tgz#efd1a8a5c8ca0cdbecbcc02172c41ed216dff8f9" dependencies: - wgs84 "0.0.0" + "@turf/invariant" "^4.7.3" -"@turf/along@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/along/-/along-4.7.1.tgz#1d6af7eec01a0f185ac2a2db95dcf14b3218d086" - dependencies: - "@turf/bearing" "4.7.1" - "@turf/destination" "4.7.1" - "@turf/distance" "4.7.1" - "@turf/helpers" "4.7.1" - -"@turf/area@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/area/-/area-4.7.1.tgz#fd66c85970f24542b831d5b1150fe0882df705c7" - dependencies: - "@mapbox/geojson-area" "^0.2.2" - "@turf/meta" "4.7.1" - -"@turf/area@^3.13.0", "@turf/area@^3.7.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@turf/area/-/area-3.14.0.tgz#f3197ed4e9710d02cd8bbd551b25c476fe47e89b" +"@turf/circle@^4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@turf/circle/-/circle-4.7.3.tgz#e8f996ff87b0ca8e3e6b74b60f6ab5daf9086713" dependencies: - "@mapbox/geojson-area" "^0.2.2" - "@turf/meta" "^3.14.0" + "@turf/destination" "^4.7.3" + "@turf/helpers" "^4.7.3" -"@turf/bbox-clip@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/bbox-clip/-/bbox-clip-4.7.1.tgz#a02324d0e847ed293970c99cdd9f5f4efe3b3f34" +"@turf/destination@^4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@turf/destination/-/destination-4.7.3.tgz#f1ea3bb3705cf52fed135a7917d49336e47b8d2e" dependencies: - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - lineclip "^1.1.5" + "@turf/helpers" "^4.7.3" + "@turf/invariant" "^4.7.3" -"@turf/bbox-polygon@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/bbox-polygon/-/bbox-polygon-4.7.1.tgz#3c698de626e8ba4e586940cbb77b7daa03d0a45d" +"@turf/distance@^4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@turf/distance/-/distance-4.7.3.tgz#b5ab48a09a642706d65c39b919433d5d2cc571b1" dependencies: - "@turf/helpers" "4.7.1" + "@turf/helpers" "^4.7.3" + "@turf/invariant" "^4.7.3" -"@turf/bbox@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/bbox/-/bbox-4.7.1.tgz#c2f05ec2bec10b9a3b4e045400aafab35b2f4cff" - dependencies: - "@turf/meta" "4.7.1" - -"@turf/bbox@^3.14.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@turf/bbox/-/bbox-3.14.0.tgz#cee5f396dde78aca9cede05e1122db18bc504635" - dependencies: - "@turf/meta" "^3.14.0" - -"@turf/bearing@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/bearing/-/bearing-4.7.1.tgz#2b442f76a77e9813fb24f18ea29484018e8fa30d" - dependencies: - "@turf/invariant" "4.7.1" - -"@turf/bezier@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/bezier/-/bezier-4.7.1.tgz#3a91b78edf03dca79878ca7585291437d3918ec3" - dependencies: - "@turf/helpers" "4.7.1" - -"@turf/boolean-clockwise@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/boolean-clockwise/-/boolean-clockwise-4.7.1.tgz#8a6a0db243d6e37c75d99f3fc2272dc3c1847544" - dependencies: - "@turf/invariant" "4.7.1" - -"@turf/boolean-contains@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/boolean-contains/-/boolean-contains-4.7.1.tgz#9c2d32364f6d409fd35ed87a8aff2e9b42c9567c" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/boolean-point-on-line" "4.7.1" - "@turf/inside" "4.7.1" - "@turf/invariant" "4.7.1" - -"@turf/boolean-crosses@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/boolean-crosses/-/boolean-crosses-4.7.1.tgz#87c614f9fb9147486701d2886b1533dcee49cf3e" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/inside" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/line-intersect" "4.7.1" - "@turf/polygon-to-linestring" "4.7.1" - -"@turf/boolean-disjoint@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/boolean-disjoint/-/boolean-disjoint-4.7.1.tgz#9bbc8f391281de6f622622a9836a94f20d7c4413" - dependencies: - "@turf/inside" "4.7.1" - "@turf/line-intersect" "4.7.1" - "@turf/meta" "4.7.1" - "@turf/polygon-to-linestring" "4.7.1" - -"@turf/boolean-equal@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/boolean-equal/-/boolean-equal-4.7.1.tgz#46fc0402943cbf9ce71b4aafe4bde10a69af381d" - dependencies: - "@turf/clean-coords" "4.7.1" - "@turf/invariant" "4.7.1" - geojson-equality "0.1.6" - -"@turf/boolean-overlap@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/boolean-overlap/-/boolean-overlap-4.7.1.tgz#cf9bc4d5cfc7d5630f035f01f75f673625c095cb" - dependencies: - "@turf/invariant" "4.7.1" - "@turf/line-intersect" "4.7.1" - "@turf/line-overlap" "4.7.1" - "@turf/meta" "4.7.1" - geojson-equality "0.1.6" - -"@turf/boolean-point-on-line@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/boolean-point-on-line/-/boolean-point-on-line-4.7.1.tgz#a267f71995da74be1dbc4440eb30e4bbbda49615" - dependencies: - "@turf/invariant" "4.7.1" - -"@turf/boolean-within@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/boolean-within/-/boolean-within-4.7.1.tgz#df65ed855ee48ce371d7ddbaac4c2168cccacdc4" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/boolean-point-on-line" "4.7.1" - "@turf/inside" "4.7.1" - "@turf/invariant" "4.7.1" - -"@turf/buffer@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/buffer/-/buffer-4.7.1.tgz#68350e1aa6c48aa45b44de239869a6410b0400bf" - dependencies: - "@turf/center" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/meta" "4.7.1" - d3-geo "^1.6.3" - jsts "1.3.0" - -"@turf/center-of-mass@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/center-of-mass/-/center-of-mass-4.7.1.tgz#5420a19d608459df0a5b58e2980031883c7afb70" - dependencies: - "@turf/centroid" "4.7.1" - "@turf/convex" "4.7.1" - "@turf/explode" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/meta" "4.7.1" - -"@turf/center@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/center/-/center-4.7.1.tgz#5c66c56144f07c35e26292ca61b4105b1b53a8d2" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/helpers" "4.7.1" - -"@turf/centroid@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/centroid/-/centroid-4.7.1.tgz#7eb0aa4b990f058819b2c755f3ce09471dc9f7de" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/meta" "4.7.1" - -"@turf/circle@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/circle/-/circle-4.7.1.tgz#a54cdd40650015388e42f957fe1cc81703464dd0" - dependencies: - "@turf/destination" "4.7.1" - "@turf/helpers" "4.7.1" - -"@turf/clean-coords@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/clean-coords/-/clean-coords-4.7.1.tgz#c4120f7a4eba47341c49f85d943f6eaea116c5e8" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - -"@turf/clone@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/clone/-/clone-4.7.1.tgz#2198da5895057d0adad91712a8170d78197cf9bb" - -"@turf/clusters-dbscan@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/clusters-dbscan/-/clusters-dbscan-4.7.1.tgz#af2cf4d1336b02e16113b23e105ebbb823ba8222" - dependencies: - "@turf/clone" "4.7.1" - "@turf/distance" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/meta" "4.7.1" - density-clustering "1.3.0" - -"@turf/clusters-kmeans@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/clusters-kmeans/-/clusters-kmeans-4.7.1.tgz#d3b614e71934889fc3cf7056a8e562b7b69e6cb8" - dependencies: - "@turf/clone" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/meta" "4.7.1" - skmeans "0.9.7" - -"@turf/clusters@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/clusters/-/clusters-4.7.1.tgz#5406061dafadcff3dc09ba44938af7ad4d91d149" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/meta" "4.7.1" - -"@turf/collect@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/collect/-/collect-4.7.1.tgz#190a98566b192528d87c992e07213ca592f493f2" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/inside" "4.7.1" - rbush "^2.0.1" - -"@turf/combine@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/combine/-/combine-4.7.1.tgz#aa6e9f82804fcdbc18b45ca30d31991af12d17e5" - dependencies: - "@turf/meta" "4.7.1" - -"@turf/concave@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/concave/-/concave-4.7.1.tgz#99e3ca9520c795b76ac7f9f778261dd4d70bbefd" - dependencies: - "@turf/distance" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/meta" "4.7.1" - "@turf/tin" "4.7.1" - geojson-dissolve "3.1.0" - -"@turf/convex@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/convex/-/convex-4.7.1.tgz#09d76aa697c194d24c5135f496936b8964f8e6dc" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/meta" "4.7.1" - convex-hull "^1.0.3" - -"@turf/destination@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/destination/-/destination-4.7.1.tgz#34691d76e185c7cf1bad94ea843a52a76f2c938f" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - -"@turf/difference@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/difference/-/difference-4.7.1.tgz#e079286359db852f4c0e4af7c15da45accf2dafa" - dependencies: - "@turf/area" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/meta" "4.7.1" - jsts "1.3.0" - -"@turf/dissolve@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/dissolve/-/dissolve-4.7.1.tgz#8d967783ee6a86fef67eed15b3a49dfecc62c651" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/boolean-overlap" "4.7.1" - "@turf/union" "4.7.1" - geojson-utils "^1.1.0" - get-closest "^0.0.4" - rbush "^2.0.1" - -"@turf/distance@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/distance/-/distance-4.7.1.tgz#d8bd48275f7418a98eae2adc0ff3f63548e05bcd" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - -"@turf/envelope@4.7.1", "@turf/envelope@^4.3.0": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/envelope/-/envelope-4.7.1.tgz#22b40595cfb076ef57e0340da098b85e2f42ac0f" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/bbox-polygon" "4.7.1" - -"@turf/explode@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/explode/-/explode-4.7.1.tgz#1635a77ec54b0fb7b0f2e5323c5bc2c517e789a9" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/meta" "4.7.1" - -"@turf/explode@^3.7.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@turf/explode/-/explode-3.14.0.tgz#f2cc1e46a39700d5602466ccd50f59a52341b92c" - dependencies: - "@turf/helpers" "^3.13.0" - "@turf/meta" "^3.14.0" - -"@turf/flatten@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/flatten/-/flatten-4.7.1.tgz#d24e51bb7aa4f46ecd439424de8717bf1c14c8e1" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/meta" "4.7.1" - -"@turf/flip@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/flip/-/flip-4.7.1.tgz#f085bea1614007af9797e36160660e2ed9e6ec1f" - dependencies: - "@turf/meta" "4.7.1" - -"@turf/great-circle@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/great-circle/-/great-circle-4.7.1.tgz#10bafe0658e41c68ca568dc909d037fa8742b7c3" - dependencies: - "@turf/invariant" "4.7.1" - -"@turf/helpers@4.7.1", "@turf/helpers@^4.1.0", "@turf/helpers@^4.3.0": +"@turf/helpers@4.7.1": version "4.7.1" resolved "https://registry.yarnpkg.com/@turf/helpers/-/helpers-4.7.1.tgz#12cecbfe22b16386338537dae3e3da83de2f3fac" -"@turf/helpers@^3.13.0", "@turf/helpers@^3.6.3": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@turf/helpers/-/helpers-3.13.0.tgz#d06078a1464cf56cdb7ea624ea1e13a71b88b806" - -"@turf/hex-grid@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/hex-grid/-/hex-grid-4.7.1.tgz#ca4fd064ea34cf5f522786dbdca7eec9e966c9a8" - dependencies: - "@turf/distance" "4.7.1" - "@turf/helpers" "4.7.1" - -"@turf/idw@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/idw/-/idw-4.7.1.tgz#7ccbbf317dc87ffdb8ff3b033312fd2c3aef1d76" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/centroid" "4.7.1" - "@turf/distance" "4.7.1" - "@turf/square-grid" "4.7.1" - -"@turf/inside@4.7.1", "@turf/inside@^4.3.0", "@turf/inside@^4.5.2": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/inside/-/inside-4.7.1.tgz#20676ba125b3c706bb671bced60f8b102162f8fa" - dependencies: - "@turf/invariant" "4.7.1" - -"@turf/inside@^3.14.0", "@turf/inside@^3.7.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@turf/inside/-/inside-3.14.0.tgz#d6b6af55882cbdb8f9a558dca98689c67bd3c590" - dependencies: - "@turf/invariant" "^3.13.0" - -"@turf/interpolate@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/interpolate/-/interpolate-4.7.1.tgz#11fbb822d54c3b05cb63c71bf01e25e96dc455cf" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/centroid" "4.7.1" - "@turf/distance" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/hex-grid" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/meta" "4.7.1" - "@turf/point-grid" "4.7.1" - "@turf/square-grid" "4.7.1" - "@turf/triangle-grid" "4.7.1" - -"@turf/intersect@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/intersect/-/intersect-4.7.1.tgz#096db4f4d688679b869f1637fffa0e55390bb881" - dependencies: - "@turf/truncate" "4.7.1" - jsts "1.3.0" - -"@turf/invariant@4.7.1", "@turf/invariant@^4.1.0", "@turf/invariant@^4.3.0": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/invariant/-/invariant-4.7.1.tgz#b95bc41a3cc7f1319d9a4c51ad5b3582905f81e4" - -"@turf/invariant@^3.13.0": - version "3.13.0" - resolved "https://registry.yarnpkg.com/@turf/invariant/-/invariant-3.13.0.tgz#89243308cd563206e81e5c6162e0d22f61822f90" - -"@turf/isobands@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/isobands/-/isobands-4.7.1.tgz#a1e81ad10e6e9b225369a8eac625510aca7af2d9" - dependencies: - "@turf/area" "^3.7.0" - "@turf/bbox" "^3.14.0" - "@turf/explode" "^3.7.0" - "@turf/helpers" "^3.6.3" - "@turf/inside" "^3.7.0" - "@turf/invariant" "^3.13.0" - grid-to-matrix "^1.2.0" - marchingsquares "^1.2.0" - -"@turf/isolines@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/isolines/-/isolines-4.7.1.tgz#133081e89fca2a51fb672a54bc7f1734fb9c7d29" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/meta" "4.7.1" - grid-to-matrix "1.2.0" - marchingsquares "1.2.0" - -"@turf/kinks@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/kinks/-/kinks-4.7.1.tgz#1d38c28d2aa39d2a3ece4a49f80e788588354a7f" - dependencies: - "@turf/helpers" "4.7.1" - -"@turf/line-arc@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/line-arc/-/line-arc-4.7.1.tgz#51743739af793990237ff0426f98882b393290d5" - dependencies: - "@turf/circle" "4.7.1" - "@turf/destination" "4.7.1" - "@turf/helpers" "4.7.1" - -"@turf/line-chunk@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/line-chunk/-/line-chunk-4.7.1.tgz#80bfd7dc7efa3bfe5b48969d7cc50157de53b1d0" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/line-distance" "4.7.1" - "@turf/line-slice-along" "4.7.1" - "@turf/meta" "4.7.1" - -"@turf/line-distance@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/line-distance/-/line-distance-4.7.1.tgz#a686d8ca4d64f34d282a0c8ca54c1727424fef49" - dependencies: - "@turf/distance" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/meta" "4.7.1" - -"@turf/line-intersect@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/line-intersect/-/line-intersect-4.7.1.tgz#dd1505bed4875dd151fba44e658605a356e5b256" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/line-segment" "4.7.1" - "@turf/meta" "4.7.1" - geojson-rbush "^1.0.1" - -"@turf/line-offset@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/line-offset/-/line-offset-4.7.1.tgz#da003111d6899ce9b95dc3023cf5411014a32935" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/meta" "4.7.1" - -"@turf/line-overlap@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/line-overlap/-/line-overlap-4.7.1.tgz#10b80aa9763583ad9d9151f57f2cf1490c3d8100" - dependencies: - "@turf/boolean-point-on-line" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/line-segment" "4.7.1" - "@turf/meta" "4.7.1" - "@turf/point-on-line" "4.7.1" - deep-equal "^1.0.1" - geojson-rbush "^1.0.1" - -"@turf/line-segment@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/line-segment/-/line-segment-4.7.1.tgz#04ea6e88bd128e4bc80a88fa705ef5e150433b2f" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/meta" "4.7.1" - -"@turf/line-slice-along@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/line-slice-along/-/line-slice-along-4.7.1.tgz#2d5a1ec90a32c5e21665719c15415dc76c94a28b" - dependencies: - "@turf/bearing" "4.7.1" - "@turf/destination" "4.7.1" - "@turf/distance" "4.7.1" - "@turf/helpers" "4.7.1" - -"@turf/line-slice@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/line-slice/-/line-slice-4.7.1.tgz#5f6fc61ea19c997ce24d60688b7de0563f854f51" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/point-on-line" "4.7.1" - -"@turf/line-split@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/line-split/-/line-split-4.7.1.tgz#dea019f11996ca0d01124549116258bfdead07f7" - dependencies: - "@turf/flatten" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/line-intersect" "4.7.1" - "@turf/line-segment" "4.7.1" - "@turf/meta" "4.7.1" - "@turf/point-on-line" "4.7.1" - "@turf/truncate" "4.7.1" - geojson-rbush "^1.0.1" - -"@turf/linestring-to-polygon@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/linestring-to-polygon/-/linestring-to-polygon-4.7.1.tgz#828d0d46c55ec6f14a5c9907ddb0ff3689dcb5a3" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - -"@turf/mask@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/mask/-/mask-4.7.1.tgz#b6ba60cf17289eaf2ec2e574948a43a847d238c2" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/meta" "4.7.1" - "@turf/union" "4.7.1" - rbush "^2.0.1" - -"@turf/meta@4.7.1", "@turf/meta@^4.1.0", "@turf/meta@^4.3.0", "@turf/meta@^4.6.0": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/meta/-/meta-4.7.1.tgz#53a55281ae08a5fa2f414d9ba50a951d38e86ab5" - -"@turf/meta@^3.14.0", "@turf/meta@^3.7.5": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@turf/meta/-/meta-3.14.0.tgz#8d3050c1a0f44bf406a633b6bd28c510f7bcee27" - -"@turf/midpoint@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/midpoint/-/midpoint-4.7.1.tgz#8d111a67ee8797266d73fd33d771d5147b5ecd9d" - dependencies: - "@turf/bearing" "4.7.1" - "@turf/destination" "4.7.1" - "@turf/distance" "4.7.1" - -"@turf/nearest@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/nearest/-/nearest-4.7.1.tgz#a2221fd6ed65a230a40021c1c0f336055e8c5038" - dependencies: - "@turf/distance" "4.7.1" +"@turf/helpers@^4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@turf/helpers/-/helpers-4.7.3.tgz#bc312ac43cab3c532a483151c4c382c5649429e9" -"@turf/planepoint@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/planepoint/-/planepoint-4.7.1.tgz#c0e8b21982d3ec9ddb7c7d6418335282ae59c5a4" - dependencies: - "@turf/invariant" "4.7.1" +"@turf/invariant@^4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@turf/invariant/-/invariant-4.7.3.tgz#538f367d23c113fc849d70c9a524b8563874601d" -"@turf/point-grid@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/point-grid/-/point-grid-4.7.1.tgz#f70c699292971d8629865f68e520f3c4a0c5f669" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/distance" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/inside" "4.7.1" - "@turf/invariant" "4.7.1" +"@turf/meta@^4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@turf/meta/-/meta-4.7.3.tgz#038970178e90c8e43cf7dfed79d5782298a1080d" -"@turf/point-on-line@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/point-on-line/-/point-on-line-4.7.1.tgz#f5f379878386afdae3e78f9cf0e481adf403c1f9" - dependencies: - "@turf/bearing" "4.7.1" - "@turf/destination" "4.7.1" - "@turf/distance" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/line-intersect" "4.7.1" - "@turf/meta" "4.7.1" - -"@turf/point-on-surface@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/point-on-surface/-/point-on-surface-4.7.1.tgz#3d599a6218519aaae2db7c57fa52e8a4d36c6682" +"@turf/point-to-line-distance@^4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@turf/point-to-line-distance/-/point-to-line-distance-4.7.3.tgz#1cd17a27a9438b5f3ae3717af7f0908258df0865" dependencies: - "@turf/center" "4.7.1" - "@turf/distance" "4.7.1" - "@turf/explode" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/inside" "4.7.1" + "@turf/bearing" "^4.7.3" + "@turf/distance" "^4.7.3" + "@turf/helpers" "^4.7.3" + "@turf/invariant" "^4.7.3" + "@turf/meta" "^4.7.3" + "@turf/rhumb-bearing" "^4.7.3" + "@turf/rhumb-distance" "^4.7.3" -"@turf/point-to-line-distance@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/point-to-line-distance/-/point-to-line-distance-4.7.1.tgz#1b2991696ca413877624815f4954e7b4134fdd7d" - dependencies: - "@turf/bearing" "4.7.1" - "@turf/distance" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/meta" "4.7.1" - "@turf/rhumb-bearing" "4.7.1" - "@turf/rhumb-distance" "4.7.1" - -"@turf/polygon-tangents@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/polygon-tangents/-/polygon-tangents-4.7.1.tgz#503c61891a40a60ae4422b8a978a32d05b886f36" +"@turf/rhumb-bearing@^4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@turf/rhumb-bearing/-/rhumb-bearing-4.7.3.tgz#db1821b62706fb403adbf9413cc5e56b79006146" dependencies: - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" + "@turf/invariant" "^4.7.3" + geodesy "1.1.2" -"@turf/polygon-to-linestring@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/polygon-to-linestring/-/polygon-to-linestring-4.7.1.tgz#67fe4f78f81ef6b4a96d83024a96bda6150103e5" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - -"@turf/polygonize@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/polygonize/-/polygonize-4.7.1.tgz#c9e6e0d3d3c04d38a60bc8a1ce7ad4063462a559" +"@turf/rhumb-distance@^4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@turf/rhumb-distance/-/rhumb-distance-4.7.3.tgz#30eebc6b785502bd8e08548069712c9709ed22d4" dependencies: - polygonize "1.0.1" - -"@turf/random@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/random/-/random-4.7.1.tgz#418a1acab9a29cb20033317f43aca65a42e30652" - dependencies: - geojson-random "^0.2.2" - -"@turf/rewind@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/rewind/-/rewind-4.7.1.tgz#032d8db8b3fa236ada3777c8f7ff82640a0dd54d" - dependencies: - "@turf/boolean-clockwise" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/meta" "4.7.1" - -"@turf/rhumb-bearing@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/rhumb-bearing/-/rhumb-bearing-4.7.1.tgz#ea60b12d149a68dfb005a8bef438f11f700ac511" - dependencies: - "@turf/invariant" "4.7.1" - geodesy "1.1.1" - -"@turf/rhumb-destination@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/rhumb-destination/-/rhumb-destination-4.7.1.tgz#adde79ade65cdc5ba22424de817ff337423ddf1f" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - geodesy "1.1.1" - -"@turf/rhumb-distance@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/rhumb-distance/-/rhumb-distance-4.7.1.tgz#33bd3cef070372a471dc1163c08d1ca9a6e486d8" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - geodesy "1.1.1" - -"@turf/sample@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/sample/-/sample-4.7.1.tgz#89d22ede3861586bc3c3e31314fdad8aeea89f6d" - dependencies: - "@turf/helpers" "4.7.1" - -"@turf/sector@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/sector/-/sector-4.7.1.tgz#f9454c8ab013e0af4989f1b73d6b8a1a9b04570c" - dependencies: - "@turf/circle" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/line-arc" "4.7.1" - "@turf/meta" "4.7.1" - -"@turf/simplify@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/simplify/-/simplify-4.7.1.tgz#d144a5a34ab2fcee1aa93738b7cd24b4835505e5" - dependencies: - "@turf/clean-coords" "4.7.1" - "@turf/clone" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/meta" "4.7.1" - simplify-js "^1.2.1" - -"@turf/square-grid@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/square-grid/-/square-grid-4.7.1.tgz#3357f1c0ef3185d630d0279c812d12481212e843" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/distance" "4.7.1" - "@turf/helpers" "4.7.1" - -"@turf/square@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/square/-/square-4.7.1.tgz#1f51326dd8ed0e2f4239bb5fd491885f3e579731" - dependencies: - "@turf/distance" "4.7.1" - -"@turf/tag@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/tag/-/tag-4.7.1.tgz#071d873aed361ce5bb5a28633d562b14af4e699b" - dependencies: - "@turf/inside" "4.7.1" - -"@turf/tesselate@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/tesselate/-/tesselate-4.7.1.tgz#08d8adbacd372ecb2c9e8cab1adbb18a57da0b8a" - dependencies: - "@turf/helpers" "4.7.1" - earcut "^2.0.0" - -"@turf/tin@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/tin/-/tin-4.7.1.tgz#9031bb6c606bd6b244fa4389f3a98ace751eb764" - dependencies: - "@turf/helpers" "4.7.1" - -"@turf/transform-rotate@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/transform-rotate/-/transform-rotate-4.7.1.tgz#4a1e6c5cb54244555c3de3311dd302c7ca4b9b53" - dependencies: - "@turf/centroid" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/meta" "4.7.1" - "@turf/rhumb-bearing" "4.7.1" - "@turf/rhumb-destination" "4.7.1" - "@turf/rhumb-distance" "4.7.1" - -"@turf/transform-scale@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/transform-scale/-/transform-scale-4.7.1.tgz#584271ba9d8e9992ae7f76f3a2a9f662cfa2e199" - dependencies: - "@turf/bbox" "4.7.1" - "@turf/center" "4.7.1" - "@turf/centroid" "4.7.1" - "@turf/clone" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/meta" "4.7.1" - "@turf/rhumb-bearing" "4.7.1" - "@turf/rhumb-destination" "4.7.1" - "@turf/rhumb-distance" "4.7.1" - -"@turf/transform-translate@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/transform-translate/-/transform-translate-4.7.1.tgz#0b25fff40ef87fe1fd53d3f200e8f413474a0f09" - dependencies: - "@turf/invariant" "4.7.1" - "@turf/meta" "4.7.1" - "@turf/rhumb-destination" "4.7.1" - -"@turf/triangle-grid@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/triangle-grid/-/triangle-grid-4.7.1.tgz#468a220a7d38dc4e3ab11d64a9291886992c1704" - dependencies: - "@turf/distance" "4.7.1" - "@turf/helpers" "4.7.1" - -"@turf/truncate@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/truncate/-/truncate-4.7.1.tgz#75fc7cf282e4cb5bf49c8b787f9da1f5c47d5e5d" - dependencies: - "@turf/meta" "4.7.1" - -"@turf/turf@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/turf/-/turf-4.7.1.tgz#9ee210797ec92641edcbcf9422c9fe370c2694fa" - dependencies: - "@turf/along" "4.7.1" - "@turf/area" "4.7.1" - "@turf/bbox" "4.7.1" - "@turf/bbox-clip" "4.7.1" - "@turf/bbox-polygon" "4.7.1" - "@turf/bearing" "4.7.1" - "@turf/bezier" "4.7.1" - "@turf/boolean-clockwise" "4.7.1" - "@turf/boolean-contains" "4.7.1" - "@turf/boolean-crosses" "4.7.1" - "@turf/boolean-disjoint" "4.7.1" - "@turf/boolean-equal" "4.7.1" - "@turf/boolean-overlap" "4.7.1" - "@turf/boolean-point-on-line" "4.7.1" - "@turf/boolean-within" "4.7.1" - "@turf/buffer" "4.7.1" - "@turf/center" "4.7.1" - "@turf/center-of-mass" "4.7.1" - "@turf/centroid" "4.7.1" - "@turf/circle" "4.7.1" - "@turf/clean-coords" "4.7.1" - "@turf/clone" "4.7.1" - "@turf/clusters" "4.7.1" - "@turf/clusters-dbscan" "4.7.1" - "@turf/clusters-kmeans" "4.7.1" - "@turf/collect" "4.7.1" - "@turf/combine" "4.7.1" - "@turf/concave" "4.7.1" - "@turf/convex" "4.7.1" - "@turf/destination" "4.7.1" - "@turf/difference" "4.7.1" - "@turf/dissolve" "4.7.1" - "@turf/distance" "4.7.1" - "@turf/envelope" "4.7.1" - "@turf/explode" "4.7.1" - "@turf/flatten" "4.7.1" - "@turf/flip" "4.7.1" - "@turf/great-circle" "4.7.1" - "@turf/helpers" "4.7.1" - "@turf/hex-grid" "4.7.1" - "@turf/idw" "4.7.1" - "@turf/inside" "4.7.1" - "@turf/interpolate" "4.7.1" - "@turf/intersect" "4.7.1" - "@turf/invariant" "4.7.1" - "@turf/isobands" "4.7.1" - "@turf/isolines" "4.7.1" - "@turf/kinks" "4.7.1" - "@turf/line-arc" "4.7.1" - "@turf/line-chunk" "4.7.1" - "@turf/line-distance" "4.7.1" - "@turf/line-intersect" "4.7.1" - "@turf/line-offset" "4.7.1" - "@turf/line-overlap" "4.7.1" - "@turf/line-segment" "4.7.1" - "@turf/line-slice" "4.7.1" - "@turf/line-slice-along" "4.7.1" - "@turf/line-split" "4.7.1" - "@turf/linestring-to-polygon" "4.7.1" - "@turf/mask" "4.7.1" - "@turf/meta" "4.7.1" - "@turf/midpoint" "4.7.1" - "@turf/nearest" "4.7.1" - "@turf/planepoint" "4.7.1" - "@turf/point-grid" "4.7.1" - "@turf/point-on-line" "4.7.1" - "@turf/point-on-surface" "4.7.1" - "@turf/point-to-line-distance" "4.7.1" - "@turf/polygon-tangents" "4.7.1" - "@turf/polygon-to-linestring" "4.7.1" - "@turf/polygonize" "4.7.1" - "@turf/random" "4.7.1" - "@turf/rewind" "4.7.1" - "@turf/rhumb-bearing" "4.7.1" - "@turf/rhumb-destination" "4.7.1" - "@turf/rhumb-distance" "4.7.1" - "@turf/sample" "4.7.1" - "@turf/sector" "4.7.1" - "@turf/simplify" "4.7.1" - "@turf/square" "4.7.1" - "@turf/square-grid" "4.7.1" - "@turf/tag" "4.7.1" - "@turf/tesselate" "4.7.1" - "@turf/tin" "4.7.1" - "@turf/transform-rotate" "4.7.1" - "@turf/transform-scale" "4.7.1" - "@turf/transform-translate" "4.7.1" - "@turf/triangle-grid" "4.7.1" - "@turf/truncate" "4.7.1" - "@turf/union" "4.7.1" - "@turf/unkink-polygon" "4.7.1" - "@turf/within" "4.7.1" - -"@turf/union@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/union/-/union-4.7.1.tgz#993c6a9efb7880427e331af5a4e9d02381046d03" - dependencies: - jsts "1.3.0" - -"@turf/unkink-polygon@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/unkink-polygon/-/unkink-polygon-4.7.1.tgz#6ef0958a47ade0186b4c88337302ee58134e6984" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/meta" "4.7.1" - simplepolygon "1.2.1" - -"@turf/within@4.7.1": - version "4.7.1" - resolved "https://registry.yarnpkg.com/@turf/within/-/within-4.7.1.tgz#f6027fbc3bc449fe927707a06cf48ba29123098f" - dependencies: - "@turf/helpers" "4.7.1" - "@turf/inside" "4.7.1" - -"@turf/within@^3.13.0": - version "3.14.0" - resolved "https://registry.yarnpkg.com/@turf/within/-/within-3.14.0.tgz#891a578323c292b9792269032dd74870e0e14c53" - dependencies: - "@turf/helpers" "^3.13.0" - "@turf/inside" "^3.14.0" - -affine-hull@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/affine-hull/-/affine-hull-1.0.0.tgz#763ff1d38d063ceb7e272f17ee4d7bbcaf905c5d" - dependencies: - robust-orientation "^1.1.3" + "@turf/helpers" "^4.7.3" + "@turf/invariant" "^4.7.3" + geodesy "1.1.2" balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767" -base64-js@0.0.2: - version "0.0.2" - resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-0.0.2.tgz#024f0f72afa25b75f9c0ee73cd4f55ec1bed9784" - benchmark@^2.1.4: version "2.1.4" resolved "https://registry.yarnpkg.com/benchmark/-/benchmark-2.1.4.tgz#09f3de31c916425d498cc2ee565a0ebf3c2a5629" @@ -913,17 +83,6 @@ benchmark@^2.1.4: lodash "^4.17.4" platform "^1.3.3" -bit-twiddle@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/bit-twiddle/-/bit-twiddle-1.0.2.tgz#0c6c1fabe2b23d17173d9a61b7b7093eb9e1769e" - -bops@0.0.6: - version "0.0.6" - resolved "https://registry.yarnpkg.com/bops/-/bops-0.0.6.tgz#082d1d55fa01e60dbdc2ebc2dba37f659554cf3a" - dependencies: - base64-js "0.0.2" - to-utf8 "0.0.1" - brace-expansion@^1.1.7: version "1.1.8" resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.8.tgz#c07b211c7c952ec1f8efd51a77ef0d1d3990a292" @@ -931,45 +90,11 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" -commander@2: - version "2.11.0" - resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563" - concat-map@0.0.1: version "0.0.1" resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" -concat-stream@~1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/concat-stream/-/concat-stream-1.2.1.tgz#f35100b6c46378bfba8b6b80f9f0d0ccdf13dc60" - dependencies: - bops "0.0.6" - -convex-hull@^1.0.3: - version "1.0.3" - resolved "https://registry.yarnpkg.com/convex-hull/-/convex-hull-1.0.3.tgz#20a3aa6ce87f4adea2ff7d17971c9fc1c67e1fff" - dependencies: - affine-hull "^1.0.0" - incremental-convex-hull "^1.0.1" - monotone-convex-hull-2d "^1.0.1" - -d3-array@1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/d3-array/-/d3-array-1.2.0.tgz#147d269720e174c4057a7f42be8b0f3f2ba53108" - -d3-geo@^1.6.3: - version "1.6.4" - resolved "https://registry.yarnpkg.com/d3-geo/-/d3-geo-1.6.4.tgz#f20e1e461cb1845f5a8be55ab6f876542a7e3199" - dependencies: - d3-array "1" - -debug@^2.6.3: - version "2.6.8" - resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.8.tgz#e731531ca2ede27d188222427da17821d68ff4fc" - dependencies: - ms "2.0.0" - -deep-equal@^1.0.0, deep-equal@^1.0.1, deep-equal@~1.0.1: +deep-equal@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/deep-equal/-/deep-equal-1.0.1.tgz#f5d260292b660e084eff4cdbc9f08ad3247448b5" @@ -984,18 +109,10 @@ defined@~1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/defined/-/defined-1.0.0.tgz#c98d9bcef75674188e110969151199e39b1fa693" -density-clustering@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/density-clustering/-/density-clustering-1.3.0.tgz#dc9f59c8f0ab97e1624ac64930fd3194817dcac5" - detect-indent@^5.0.0: version "5.0.0" resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-5.0.0.tgz#3871cc0a6a002e8c3e5b3cf7f336264675f06b9d" -earcut@^2.0.0: - version "2.1.1" - resolved "https://registry.yarnpkg.com/earcut/-/earcut-2.1.1.tgz#157634e5f3ebb42224e475016e86a5b6ce556b45" - error-ex@^1.2.0: version "1.3.1" resolved "https://registry.yarnpkg.com/error-ex/-/error-ex-1.3.1.tgz#f855a86ce61adc4e8621c3cda21e7a7612c3a8dc" @@ -1038,61 +155,9 @@ function-bind@^1.0.2, function-bind@^1.1.1, function-bind@~1.1.0: version "1.1.1" resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" -geodesy@1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/geodesy/-/geodesy-1.1.1.tgz#918c414a5cc247c8128332b7624050c467e98a5d" - -geojson-dissolve@3.1.0: - version "3.1.0" - resolved "https://registry.yarnpkg.com/geojson-dissolve/-/geojson-dissolve-3.1.0.tgz#86823271680a1a381f3e72f02648bbcc710ecda1" - dependencies: - "@turf/meta" "^3.7.5" - geojson-flatten "^0.2.1" - geojson-linestring-dissolve "0.0.1" - topojson-client "^3.0.0" - topojson-server "^3.0.0" - -geojson-equality@0.1.6: - version "0.1.6" - resolved "https://registry.yarnpkg.com/geojson-equality/-/geojson-equality-0.1.6.tgz#a171374ef043e5d4797995840bae4648e0752d72" - dependencies: - deep-equal "^1.0.0" - -geojson-flatten@^0.2.1: - version "0.2.1" - resolved "https://registry.yarnpkg.com/geojson-flatten/-/geojson-flatten-0.2.1.tgz#476fc6b041e94d016983ec95400f8777bd60c45c" - dependencies: - concat-stream "~1.2.1" - minimist "0.0.5" - -geojson-linestring-dissolve@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/geojson-linestring-dissolve/-/geojson-linestring-dissolve-0.0.1.tgz#08ab8cdf386e919d35a0eb38fa1c550e020838db" - -geojson-polygon-self-intersections@^1.1.2: +geodesy@1.1.2: version "1.1.2" - resolved "https://registry.yarnpkg.com/geojson-polygon-self-intersections/-/geojson-polygon-self-intersections-1.1.2.tgz#bc49ce3be2175005802ad6f3c231dbdd7c65777b" - dependencies: - rbush "^2.0.1" - -geojson-random@^0.2.2: - version "0.2.2" - resolved "https://registry.yarnpkg.com/geojson-random/-/geojson-random-0.2.2.tgz#ab4838f126adc5e16f8f94e655def820f9119dbc" - -geojson-rbush@^1.0.1: - version "1.2.0" - resolved "https://registry.yarnpkg.com/geojson-rbush/-/geojson-rbush-1.2.0.tgz#eca3b6a3afb899a453ef82d5e2373092e20d77e5" - dependencies: - "@turf/meta" "^4.6.0" - rbush "^2.0.1" - -geojson-utils@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/geojson-utils/-/geojson-utils-1.1.0.tgz#e8ffb4c81c0a75b3e306f5187265d6f23040f50b" - -get-closest@^0.0.4: - version "0.0.4" - resolved "https://registry.yarnpkg.com/get-closest/-/get-closest-0.0.4.tgz#269ac776d1e6022aa0fd586dd708e8a7d32269af" + resolved "https://registry.yarnpkg.com/geodesy/-/geodesy-1.1.2.tgz#84cbdf7e7b98907bd3b13b09ae86c65926391a50" glob@~7.1.2: version "7.1.2" @@ -1109,14 +174,6 @@ graceful-fs@^4.1.11, graceful-fs@^4.1.2: version "4.1.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.1.11.tgz#0e8bdfe4d1ddb8854d64e04ea7c00e2a026e5658" -grid-to-matrix@1.2.0, grid-to-matrix@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/grid-to-matrix/-/grid-to-matrix-1.2.0.tgz#b016df4d76f996e6b74663eab9ceb913546657e9" - dependencies: - "@turf/helpers" "^4.1.0" - "@turf/invariant" "^4.1.0" - "@turf/meta" "^4.1.0" - has@^1.0.1, has@~1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/has/-/has-1.0.1.tgz#8461733f538b0837c9361e39a9ab9e9704dc2f28" @@ -1127,13 +184,6 @@ imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" -incremental-convex-hull@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/incremental-convex-hull/-/incremental-convex-hull-1.0.1.tgz#51428c14cb9d9a6144bfe69b2851fb377334be1e" - dependencies: - robust-orientation "^1.1.2" - simplicial-complex "^1.0.0" - inflight@^1.0.4: version "1.0.6" resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" @@ -1175,14 +225,6 @@ is-symbol@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/is-symbol/-/is-symbol-1.0.1.tgz#3cc59f00025194b6ab2e38dbae6689256b660572" -jsts@1.3.0: - version "1.3.0" - resolved "https://registry.yarnpkg.com/jsts/-/jsts-1.3.0.tgz#e93a76f97ac9bda7d4625d9d6470f0d60ac80e45" - -lineclip@^1.1.5: - version "1.1.5" - resolved "https://registry.yarnpkg.com/lineclip/-/lineclip-1.1.5.tgz#2bf26067d94354feabf91e42768236db5616fd13" - load-json-file@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/load-json-file/-/load-json-file-2.0.0.tgz#7947e42149af80d696cbf797bcaabcfe1fe29ca8" @@ -1202,34 +244,16 @@ make-dir@^1.0.0: dependencies: pify "^2.3.0" -marchingsquares@1.2.0, marchingsquares@^1.2.0: - version "1.2.0" - resolved "https://registry.yarnpkg.com/marchingsquares/-/marchingsquares-1.2.0.tgz#36ae2dcc170be576d42579aac3c46da89ab650e6" - minimatch@^3.0.4: version "3.0.4" resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083" dependencies: brace-expansion "^1.1.7" -minimist@0.0.5: - version "0.0.5" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.5.tgz#d7aa327bcecf518f9106ac6b8f003fa3bcea8566" - minimist@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.0.tgz#a35008b20f41383eec1fb914f4cd5df79a264284" -monotone-convex-hull-2d@^1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/monotone-convex-hull-2d/-/monotone-convex-hull-2d-1.0.1.tgz#47f5daeadf3c4afd37764baa1aa8787a40eee08c" - dependencies: - robust-orientation "^1.1.3" - -ms@2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" - object-inspect@~1.3.0: version "1.3.0" resolved "https://registry.yarnpkg.com/object-inspect/-/object-inspect-1.3.0.tgz#5b1eb8e6742e2ee83342a637034d844928ba2f6d" @@ -1266,26 +290,6 @@ platform@^1.3.3: version "1.3.4" resolved "https://registry.yarnpkg.com/platform/-/platform-1.3.4.tgz#6f0fb17edaaa48f21442b3a975c063130f1c3ebd" -polygonize@1.0.1: - version "1.0.1" - resolved "https://registry.yarnpkg.com/polygonize/-/polygonize-1.0.1.tgz#51fb7040914be0fbc43b0bd54d421d75fc2ae7a6" - dependencies: - "@turf/envelope" "^4.3.0" - "@turf/helpers" "^4.3.0" - "@turf/inside" "^4.3.0" - "@turf/invariant" "^4.3.0" - "@turf/meta" "^4.3.0" - -quickselect@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/quickselect/-/quickselect-1.0.0.tgz#02630818f9aae4ecab26f0103f98d061c17c58f3" - -rbush@^2.0.1: - version "2.0.1" - resolved "https://registry.yarnpkg.com/rbush/-/rbush-2.0.1.tgz#4cfaca28c3064bc0ee75431a1b79990e875eefa9" - dependencies: - quickselect "^1.0.0" - resolve@~1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.4.0.tgz#a75be01c53da25d934a98ebd0e4c4a7312f92a86" @@ -1298,61 +302,10 @@ resumer@~0.0.0: dependencies: through "~2.3.4" -robust-orientation@^1.1.2, robust-orientation@^1.1.3: - version "1.1.3" - resolved "https://registry.yarnpkg.com/robust-orientation/-/robust-orientation-1.1.3.tgz#daff5b00d3be4e60722f0e9c0156ef967f1c2049" - dependencies: - robust-scale "^1.0.2" - robust-subtract "^1.0.0" - robust-sum "^1.0.0" - two-product "^1.0.2" - -robust-scale@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/robust-scale/-/robust-scale-1.0.2.tgz#775132ed09542d028e58b2cc79c06290bcf78c32" - dependencies: - two-product "^1.0.2" - two-sum "^1.0.0" - -robust-subtract@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/robust-subtract/-/robust-subtract-1.0.0.tgz#e0b164e1ed8ba4e3a5dda45a12038348dbed3e9a" - -robust-sum@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/robust-sum/-/robust-sum-1.0.0.tgz#16646e525292b4d25d82757a286955e0bbfa53d9" - signal-exit@^3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.2.tgz#b5fdc08f1287ea1178628e415e25132b73646c6d" -simplepolygon@1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/simplepolygon/-/simplepolygon-1.2.1.tgz#48250a6a853275e96e42c7105f507da00dc67d64" - dependencies: - "@turf/area" "^3.13.0" - "@turf/helpers" "^3.13.0" - "@turf/inside" "^4.5.2" - "@turf/within" "^3.13.0" - debug "^2.6.3" - geojson-polygon-self-intersections "^1.1.2" - rbush "^2.0.1" - -simplicial-complex@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/simplicial-complex/-/simplicial-complex-1.0.0.tgz#6c33a4ed69fcd4d91b7bcadd3b30b63683eae241" - dependencies: - bit-twiddle "^1.0.0" - union-find "^1.0.0" - -simplify-js@^1.2.1: - version "1.2.1" - resolved "https://registry.yarnpkg.com/simplify-js/-/simplify-js-1.2.1.tgz#fa216b40454f48175450e0fea1bd1e6ab39fcbc0" - -skmeans@0.9.7: - version "0.9.7" - resolved "https://registry.yarnpkg.com/skmeans/-/skmeans-0.9.7.tgz#72670cebb728508f56e29c0e10d11e623529ce5d" - sort-keys@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/sort-keys/-/sort-keys-1.1.2.tgz#441b6d4d346798f1b4e49e8920adfba0e543f9ad" @@ -1393,38 +346,6 @@ through@~2.3.4, through@~2.3.8: version "2.3.8" resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" -to-utf8@0.0.1: - version "0.0.1" - resolved "https://registry.yarnpkg.com/to-utf8/-/to-utf8-0.0.1.tgz#d17aea72ff2fba39b9e43601be7b3ff72e089852" - -topojson-client@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/topojson-client/-/topojson-client-3.0.0.tgz#1f99293a77ef42a448d032a81aa982b73f360d2f" - dependencies: - commander "2" - -topojson-server@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/topojson-server/-/topojson-server-3.0.0.tgz#378e78e87c3972a7b5be2c5d604369b6bae69c5e" - dependencies: - commander "2" - -two-product@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/two-product/-/two-product-1.0.2.tgz#67d95d4b257a921e2cb4bd7af9511f9088522eaa" - -two-sum@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/two-sum/-/two-sum-1.0.0.tgz#31d3f32239e4f731eca9df9155e2b297f008ab64" - -union-find@^1.0.0: - version "1.0.2" - resolved "https://registry.yarnpkg.com/union-find/-/union-find-1.0.2.tgz#292bac415e6ad3a89535d237010db4a536284e58" - -wgs84@0.0.0: - version "0.0.0" - resolved "https://registry.yarnpkg.com/wgs84/-/wgs84-0.0.0.tgz#34fdc555917b6e57cf2a282ed043710c049cdc76" - wrappy@1: version "1.0.2" resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" From e825fb10111c89eea51d6f17d5f55b2bba3ddc52 Mon Sep 17 00:00:00 2001 From: Denis Date: Sat, 16 Sep 2017 16:17:12 -0400 Subject: [PATCH 11/11] Truncate circle output --- .../turf-nearest-point-to-line/package.json | 1 + packages/turf-nearest-point-to-line/test.js | 3 +- .../test/out/fiji.geojson | 260 +++++++++--------- .../test/out/on-line.geojson | 260 +++++++++--------- .../test/out/one.geojson | 260 +++++++++--------- .../test/out/resolute.geojson | 260 +++++++++--------- .../test/out/segment.geojson | 260 +++++++++--------- .../test/out/two.geojson | 260 +++++++++--------- packages/turf-nearest-point-to-line/yarn.lock | 6 + 9 files changed, 789 insertions(+), 781 deletions(-) diff --git a/packages/turf-nearest-point-to-line/package.json b/packages/turf-nearest-point-to-line/package.json index 23b4b8f1e8..13fa3a7dde 100644 --- a/packages/turf-nearest-point-to-line/package.json +++ b/packages/turf-nearest-point-to-line/package.json @@ -35,6 +35,7 @@ "devDependencies": { "@turf/circle": "^4.7.3", "@turf/helpers": "4.7.1", + "@turf/truncate": "^4.7.3", "benchmark": "^2.1.4", "load-json-file": "^2.0.0", "tape": "^4.6.3", diff --git a/packages/turf-nearest-point-to-line/test.js b/packages/turf-nearest-point-to-line/test.js index a00b99f5e7..1b0674ce48 100644 --- a/packages/turf-nearest-point-to-line/test.js +++ b/packages/turf-nearest-point-to-line/test.js @@ -4,6 +4,7 @@ const path = require('path'); const load = require('load-json-file'); const write = require('write-json-file'); const circle = require('@turf/circle'); +const truncate = require('@turf/truncate'); const {geometryCollection, featureCollection, point, lineString, round} = require('@turf/helpers'); const nearestPointToLine = require('./'); @@ -32,7 +33,7 @@ test('turf-nearest-point-to-line', t => { 'marker-size': 'large', 'marker-symbol': 'star' }); - const distanceCircle = circle(nearest, distance || 1, null, units, {fill: '#F00'}); + const distanceCircle = truncate(circle(nearest, distance || 1, null, units, {fill: '#F00'})); const results = featureCollection([points, nearest, line, distanceCircle]); if (process.env.REGEN) write.sync(directories.out + filename, results); diff --git a/packages/turf-nearest-point-to-line/test/out/fiji.geojson b/packages/turf-nearest-point-to-line/test/out/fiji.geojson index 0964c957c2..89e8b87e01 100644 --- a/packages/turf-nearest-point-to-line/test/out/fiji.geojson +++ b/packages/turf-nearest-point-to-line/test/out/fiji.geojson @@ -103,264 +103,264 @@ "coordinates": [ [ [ - 180.25817871093747, - -16.92283728273034 + 180.258179, + -16.922837 ], [ - 180.26140745517685, - -16.922989006748615 + 180.261407, + -16.922989 ], [ - 180.2646051203381, - -16.923442718347573 + 180.264605, + -16.923443 ], [ - 180.26774092605737, - -16.924194050196636 + 180.267741, + -16.924194 ], [ - 180.27078468654537, - -16.925235770067523 + 180.270785, + -16.925236 ], [ - 180.27370710076607, - -16.926557850350097 + 180.273707, + -16.926558 ], [ - 180.27648003415976, - -16.928147564442767 + 180.27648, + -16.928148 ], [ - 180.27907678921423, - -16.929989609096015 + 180.279077, + -16.92999 ], [ - 180.28147236229424, - -16.932066251539226 + 180.281472, + -16.932066 ], [ - 180.28364368426517, - -16.934357499983644 + 180.283644, + -16.934357 ], [ - 180.28556984260155, - -16.93684129586978 + 180.28557, + -16.936841 ], [ - 180.28723228284287, - -16.93949372601873 + 180.287232, + -16.939494 ], [ - 180.2886149874553, - -16.942289252655215 + 180.288615, + -16.942289 ], [ - 180.28970463036944, - -16.945200959097615 + 180.289705, + -16.945201 ], [ - 180.29049070569587, - -16.948200808758514 + 180.290491, + -16.948201 ], [ - 180.2909656293636, - -16.951259914970034 + 180.290966, + -16.95126 ], [ - 180.2911248126863, - -16.954348819042398 + 180.291125, + -16.954349 ], [ - 180.29096670712613, - -16.957437773883147 + 180.290967, + -16.957438 ], [ - 180.29049281980318, - -16.960497030448806 + 180.290493, + -16.960497 ], [ - 180.2897076995777, - -16.963497124271584 + 180.289708, + -16.963497 ], [ - 180.28861889381645, - -16.966409159300607 + 180.288619, + -16.966409 ], [ - 180.28723687623776, - -16.969205086321065 + 180.287237, + -16.969205 ], [ - 180.28557494650863, - -16.97185797326481 + 180.285575, + -16.971858 ], [ - 180.28364910254425, - -16.974342264802207 + 180.283649, + -16.974342 ], [ - 180.28147788672385, - -16.97663402870676 + 180.281478, + -16.976634 ], [ - 180.27908220749367, - -16.978711186610127 + 180.279082, + -16.978711 ], [ - 180.27648513806756, - -16.980553726914707 + 180.276485, + -16.980554 ], [ - 180.2737116941619, - -16.982143897802292 + 180.273712, + -16.982144 ], [ - 180.27078859290754, - -16.98346637846897 + 180.270789, + -16.983466 ], [ - 180.2677439952665, - -16.984508426926606 + 180.267744, + -16.984508 ], [ - 180.26460723444615, - -16.98526000293766 + 180.264607, + -16.98526 ], [ - 180.2614085329398, - -16.985713864890837 + 180.261409, + -16.985714 ], [ - 180.25817871093747, - -16.98586563967752 + 180.258179, + -16.985866 ], [ - 180.25494888893516, - -16.985713864890837 + 180.254949, + -16.985714 ], [ - 180.25175018742883, - -16.98526000293766 + 180.25175, + -16.98526 ], [ - 180.24861342660847, - -16.984508426926606 + 180.248613, + -16.984508 ], [ - 180.24556882896744, - -16.98346637846897 + 180.245569, + -16.983466 ], [ - 180.24264572771307, - -16.982143897802292 + 180.242646, + -16.982144 ], [ - 180.23987228380741, - -16.980553726914707 + 180.239872, + -16.980554 ], [ - 180.2372752143813, - -16.978711186610127 + 180.237275, + -16.978711 ], [ - 180.23487953515112, - -16.97663402870676 + 180.23488, + -16.976634 ], [ - 180.23270831933073, - -16.974342264802207 + 180.232708, + -16.974342 ], [ - 180.23078247536634, - -16.97185797326481 + 180.230782, + -16.971858 ], [ - 180.2291205456372, - -16.969205086321065 + 180.229121, + -16.969205 ], [ - 180.2277385280585, - -16.966409159300607 + 180.227739, + -16.966409 ], [ - 180.22664972229728, - -16.963497124271584 + 180.22665, + -16.963497 ], [ - 180.2258646020718, - -16.960497030448806 + 180.225865, + -16.960497 ], [ - 180.22539071474884, - -16.957437773883147 + 180.225391, + -16.957438 ], [ - 180.22523260918868, - -16.954348819042398 + 180.225233, + -16.954349 ], [ - 180.22539179251137, - -16.951259914970034 + 180.225392, + -16.95126 ], [ - 180.2258667161791, - -16.948200808758514 + 180.225867, + -16.948201 ], [ - 180.2266527915055, - -16.945200959097615 + 180.226653, + -16.945201 ], [ - 180.22774243441967, - -16.942289252655215 + 180.227742, + -16.942289 ], [ - 180.2291251390321, - -16.93949372601873 + 180.229125, + -16.939494 ], [ - 180.23078757927343, - -16.93684129586978 + 180.230788, + -16.936841 ], [ - 180.2327137376098, - -16.934357499983644 + 180.232714, + -16.934357 ], [ - 180.23488505958073, - -16.932066251539226 + 180.234885, + -16.932066 ], [ - 180.23728063266074, - -16.929989609096015 + 180.237281, + -16.92999 ], [ - 180.2398773877152, - -16.928147564442767 + 180.239877, + -16.928148 ], [ - 180.24265032110887, - -16.926557850350097 + 180.24265, + -16.926558 ], [ - 180.2455727353296, - -16.925235770067523 + 180.245573, + -16.925236 ], [ - 180.2486164958176, - -16.924194050196636 + 180.248616, + -16.924194 ], [ - 180.25175230153687, - -16.923442718347573 + 180.251752, + -16.923443 ], [ - 180.2549499666981, - -16.922989006748615 + 180.25495, + -16.922989 ], [ - 180.25817871093747, - -16.92283728273034 + 180.258179, + -16.922837 ] ] ] diff --git a/packages/turf-nearest-point-to-line/test/out/on-line.geojson b/packages/turf-nearest-point-to-line/test/out/on-line.geojson index c7a7bddd67..a55cfbb74c 100644 --- a/packages/turf-nearest-point-to-line/test/out/on-line.geojson +++ b/packages/turf-nearest-point-to-line/test/out/on-line.geojson @@ -136,264 +136,264 @@ "coordinates": [ [ [ - -22.818603515625, - 15.324966328041096 + -22.818604, + 15.324966 ], [ - -22.817689814037777, - 15.324923034981438 + -22.81769, + 15.324923 ], [ - -22.816784913022158, - 15.32479357279178 + -22.816785, + 15.324794 ], [ - -22.815897528352142, - 15.324579188422172 + -22.815898, + 15.324579 ], [ - -22.81503620702483, - 15.324281946768512 + -22.815036, + 15.324282 ], [ - -22.8142092449098, - 15.323904710776553 + -22.814209, + 15.323905 ], [ - -22.813424606821755, - 15.323451113856875 + -22.813425, + 15.323451 ], [ - -22.812689849787404, - 15.322925524876926 + -22.81269, + 15.322926 ], [ - -22.812012050246686, - 15.32233300606795 + -22.812012, + 15.322333 ], [ - -22.81139773589021, - 15.321679264252845 + -22.811398, + 15.321679 ], [ - -22.810852822789766, - 15.320970595865477 + -22.810853, + 15.320971 ], [ - -22.810382558427623, - 15.320213826291695 + -22.810383, + 15.320214 ], [ - -22.809991471173092, - 15.319416244117111 + -22.809991, + 15.319416 ], [ - -22.80968332669234, - 15.318585530915522 + -22.809683, + 15.318586 ], [ - -22.809461091710627, - 15.317729687254959 + -22.809461, + 15.31773 ], [ - -22.80932690547472, - 15.31685695563459 + -22.809327, + 15.316857 ], [ - -22.809282059189137, - 15.315975741095059 + -22.809282, + 15.315976 ], [ - -22.809326983622757, - 15.3150945302673 + -22.809327, + 15.315095 ], [ - -22.809461245003522, - 15.314221809639605 + -22.809461, + 15.314222 ], [ - -22.80968354923913, - 15.313365983830181 + -22.809684, + 15.313366 ], [ - -22.80999175442142, - 15.31253529465218 + -22.809992, + 15.312535 ], [ - -22.810382891492427, - 15.311737741750424 + -22.810383, + 15.311738 ], [ - -22.810853192871548, - 15.310981005573773 + -22.810853, + 15.310981 ], [ - -22.81139812876694, - 15.310272373424402 + -22.811398, + 15.310272 ], [ - -22.812012450820323, - 15.309618669295554 + -22.812012, + 15.309619 ], [ - -22.81269024266413, - 15.309026188172842 + -22.81269, + 15.309026 ], [ - -22.813424976903544, - 15.308500635430889 + -22.813425, + 15.308501 ], [ - -22.81420957797461, - 15.308047071908343 + -22.81421, + 15.308047 ], [ - -22.81503649027317, - 15.30766986518921 + -22.815036, + 15.30767 ], [ - -22.815897750898937, - 15.307372647559141 + -22.815898, + 15.307373 ], [ - -22.816785066315056, - 15.307158281040671 + -22.816785, + 15.307158 ], [ - -22.817689892185818, - 15.30702882984369 + -22.81769, + 15.307029 ], [ - -22.818603515625, - 15.306985540495802 + -22.818604, + 15.306986 ], [ - -22.819517139064185, - 15.30702882984369 + -22.819517, + 15.307029 ], [ - -22.820421964934948, - 15.307158281040671 + -22.820422, + 15.307158 ], [ - -22.821309280351066, - 15.307372647559141 + -22.821309, + 15.307373 ], [ - -22.822170540976835, - 15.30766986518921 + -22.822171, + 15.30767 ], [ - -22.822997453275395, - 15.308047071908343 + -22.822997, + 15.308047 ], [ - -22.82378205434646, - 15.308500635430889 + -22.823782, + 15.308501 ], [ - -22.824516788585875, - 15.309026188172842 + -22.824517, + 15.309026 ], [ - -22.82519458042968, - 15.309618669295554 + -22.825195, + 15.309619 ], [ - -22.825808902483065, - 15.310272373424402 + -22.825809, + 15.310272 ], [ - -22.826353838378456, - 15.310981005573773 + -22.826354, + 15.310981 ], [ - -22.826824139757573, - 15.311737741750424 + -22.826824, + 15.311738 ], [ - -22.827215276828582, - 15.31253529465218 + -22.827215, + 15.312535 ], [ - -22.827523482010875, - 15.313365983830181 + -22.827523, + 15.313366 ], [ - -22.82774578624648, - 15.314221809639605 + -22.827746, + 15.314222 ], [ - -22.827880047627243, - 15.3150945302673 + -22.82788, + 15.315095 ], [ - -22.827924972060867, - 15.315975741095059 + -22.827925, + 15.315976 ], [ - -22.827880125775284, - 15.31685695563459 + -22.82788, + 15.316857 ], [ - -22.827745939539373, - 15.317729687254959 + -22.827746, + 15.31773 ], [ - -22.827523704557663, - 15.318585530915522 + -22.827524, + 15.318586 ], [ - -22.82721556007691, - 15.319416244117111 + -22.827216, + 15.319416 ], [ - -22.82682447282238, - 15.320213826291695 + -22.826824, + 15.320214 ], [ - -22.826354208460238, - 15.320970595865477 + -22.826354, + 15.320971 ], [ - -22.82580929535979, - 15.321679264252845 + -22.825809, + 15.321679 ], [ - -22.825194981003317, - 15.32233300606795 + -22.825195, + 15.322333 ], [ - -22.8245171814626, - 15.322925524876926 + -22.824517, + 15.322926 ], [ - -22.82378242442825, - 15.323451113856875 + -22.823782, + 15.323451 ], [ - -22.822997786340203, - 15.323904710776553 + -22.822998, + 15.323905 ], [ - -22.822170824225175, - 15.324281946768512 + -22.822171, + 15.324282 ], [ - -22.821309502897858, - 15.324579188422172 + -22.82131, + 15.324579 ], [ - -22.820422118227846, - 15.32479357279178 + -22.820422, + 15.324794 ], [ - -22.819517217212226, - 15.324923034981438 + -22.819517, + 15.324923 ], [ - -22.818603515625, - 15.324966328041096 + -22.818604, + 15.324966 ] ] ] diff --git a/packages/turf-nearest-point-to-line/test/out/one.geojson b/packages/turf-nearest-point-to-line/test/out/one.geojson index 170e3a79db..45f1604eb8 100644 --- a/packages/turf-nearest-point-to-line/test/out/one.geojson +++ b/packages/turf-nearest-point-to-line/test/out/one.geojson @@ -82,264 +82,264 @@ "coordinates": [ [ [ - 29.7509765625, - 18.020369523707792 + 29.750977, + 18.02037 ], [ - 29.798401827482373, - 18.0181482267381 + 29.798402, + 18.018148 ], [ - 29.845366834454154, - 18.011505895238997 + 29.845367, + 18.011506 ], [ - 29.89141589739495, - 18.000506993132046 + 29.891416, + 18.000507 ], [ - 29.936102424532006, - 17.98525824826815 + 29.936102, + 17.985258 ], [ - 29.97899334186073, - 17.965907592565877 + 29.978993, + 17.965908 ], [ - 30.01967337036126, - 17.94264269441037 + 30.019673, + 17.942643 ], [ - 30.05774911145306, - 17.91568909922797 + 30.057749, + 17.915689 ], [ - 30.092852897954906, - 17.88530799829273 + 30.092853, + 17.885308 ], [ - 30.124646371091774, - 17.851793649673876 + 30.124646, + 17.851794 ], [ - 30.152823747832677, - 17.81547047874912 + 30.152824, + 17.81547 ], [ - 30.17711474696761, - 17.776689888849123 + 30.177115, + 17.77669 ], [ - 30.19728714674601, - 17.735826815332185 + 30.197287, + 17.735827 ], [ - 30.21314895151163, - 17.69327605869468 + 30.213149, + 17.693276 ], [ - 30.22455014949058, - 17.649448434189697 + 30.22455, + 17.649448 ], [ - 30.231384048636933, - 17.604766776848717 + 30.231384, + 17.604767 ], [ - 30.23358818213892, - 17.55966184178362 + 30.233588, + 17.559662 ], [ - 30.231144779771462, - 17.51456814019756 + 30.231145, + 17.514568 ], [ - 30.224080805694253, - 17.469919751668844 + 30.224081, + 17.46992 ], [ - 30.212467567493327, - 17.426146153011082 + 30.212468, + 17.426146 ], [ - 30.19641990521581, - 17.383668103377314 + 30.19642, + 17.383668 ], [ - 30.176094972829894, - 17.342893624290557 + 30.176095, + 17.342894 ], [ - 30.151690627939942, - 17.30421411197222 + 30.151691, + 17.304214 ], [ - 30.123443448695813, - 17.26800061773043 + 30.123443, + 17.268001 ], [ - 30.091626399654885, - 17.23460033028599 + 30.091626, + 17.2346 ], [ - 30.056546170890677, - 17.204333291781133 + 30.056546, + 17.204333 ], [ - 30.018540216901354, - 17.17748937685841 + 30.01854, + 17.177489 ], [ - 29.977973523865394, - 17.15432556163748 + 29.977974, + 17.154326 ], [ - 29.935235135530665, - 17.135063506679593 + 29.935235, + 17.135064 ], [ - 29.89073446951902, - 17.119887475133638 + 29.890734, + 17.119887 ], [ - 29.84489745709067, - 17.108942604226822 + 29.844897, + 17.108943 ], [ - 29.798162540450477, - 17.102333545116693 + 29.798163, + 17.102334 ], [ - 29.7509765625, - 17.100123482882008 + 29.750977, + 17.100123 ], [ - 29.703790584549523, - 17.102333545116693 + 29.703791, + 17.102334 ], [ - 29.65705566790933, - 17.108942604226822 + 29.657056, + 17.108943 ], [ - 29.611218655480975, - 17.119887475133638 + 29.611219, + 17.119887 ], [ - 29.566717989469335, - 17.135063506679593 + 29.566718, + 17.135064 ], [ - 29.523979601134602, - 17.15432556163748 + 29.52398, + 17.154326 ], [ - 29.483412908098643, - 17.17748937685841 + 29.483413, + 17.177489 ], [ - 29.445406954109323, - 17.204333291781133 + 29.445407, + 17.204333 ], [ - 29.41032672534511, - 17.23460033028599 + 29.410327, + 17.2346 ], [ - 29.378509676304184, - 17.26800061773043 + 29.37851, + 17.268001 ], [ - 29.350262497060054, - 17.30421411197222 + 29.350262, + 17.304214 ], [ - 29.325858152170106, - 17.342893624290557 + 29.325858, + 17.342894 ], [ - 29.305533219784188, - 17.383668103377314 + 29.305533, + 17.383668 ], [ - 29.289485557506673, - 17.426146153011082 + 29.289486, + 17.426146 ], [ - 29.277872319305743, - 17.469919751668844 + 29.277872, + 17.46992 ], [ - 29.270808345228538, - 17.51456814019756 + 29.270808, + 17.514568 ], [ - 29.268364942861076, - 17.55966184178362 + 29.268365, + 17.559662 ], [ - 29.270569076363067, - 17.604766776848717 + 29.270569, + 17.604767 ], [ - 29.27740297550942, - 17.649448434189697 + 29.277403, + 17.649448 ], [ - 29.28880417348837, - 17.69327605869468 + 29.288804, + 17.693276 ], [ - 29.304665978253986, - 17.735826815332185 + 29.304666, + 17.735827 ], [ - 29.324838378032386, - 17.776689888849123 + 29.324838, + 17.77669 ], [ - 29.349129377167323, - 17.81547047874912 + 29.349129, + 17.81547 ], [ - 29.377306753908226, - 17.851793649673876 + 29.377307, + 17.851794 ], [ - 29.40910022704509, - 17.88530799829273 + 29.4091, + 17.885308 ], [ - 29.444204013546937, - 17.91568909922797 + 29.444204, + 17.915689 ], [ - 29.482279754638736, - 17.94264269441037 + 29.48228, + 17.942643 ], [ - 29.522959783139267, - 17.965907592565877 + 29.52296, + 17.965908 ], [ - 29.565850700467994, - 17.98525824826815 + 29.565851, + 17.985258 ], [ - 29.61053722760505, - 18.000506993132046 + 29.610537, + 18.000507 ], [ - 29.656586290545846, - 18.011505895238997 + 29.656586, + 18.011506 ], [ - 29.703551297517627, - 18.0181482267381 + 29.703551, + 18.018148 ], [ - 29.7509765625, - 18.020369523707792 + 29.750977, + 18.02037 ] ] ] diff --git a/packages/turf-nearest-point-to-line/test/out/resolute.geojson b/packages/turf-nearest-point-to-line/test/out/resolute.geojson index 58a94f7299..b4fa34d8d7 100644 --- a/packages/turf-nearest-point-to-line/test/out/resolute.geojson +++ b/packages/turf-nearest-point-to-line/test/out/resolute.geojson @@ -89,264 +89,264 @@ "coordinates": [ [ [ - -87.2314453125, - 75.74515005991336 + -87.231445, + 75.74515 ], [ - -87.13711546640516, - 75.74399036006236 + -87.137115, + 75.74399 ], [ - -87.04373852535383, - 75.74052298011723 + -87.043739, + 75.740523 ], [ - -86.95225641538097, - 75.7347829435378 + -86.952256, + 75.734783 ], [ - -86.86358928800111, - 75.72682817383318 + -86.863589, + 75.726828 ], [ - -86.77862508612732, - 75.71673882911684 + -86.778625, + 75.716739 ], [ - -86.69820963851318, - 75.70461638611047 + -86.69821, + 75.704616 ], [ - -86.62313743422634, - 75.69058248864654 + -86.623137, + 75.690582 ], [ - -86.5541432091043, - 75.67477757922566 + -86.554143, + 75.674778 ], [ - -86.49189445353588, - 75.6573593351559 + -86.491894, + 75.657359 ], [ - -86.43698492629511, - 75.63850093317049 + -86.436985, + 75.638501 ], [ - -86.38992923359613, - 75.61838916815753 + -86.389929, + 75.618389 ], [ - -86.35115850708308, - 75.59722245272981 + -86.351159, + 75.597222 ], [ - -86.32101719007805, - 75.57520872483734 + -86.321017, + 75.575209 ], [ - -86.29976091890596, - 75.55256329051855 + -86.299761, + 75.552563 ], [ - -86.28755546616019, - 75.52950662825931 + -86.287555, + 75.529507 ], [ - -86.28447669584223, - 75.5062621803556 + -86.284477, + 75.506262 ], [ - -86.29051146669086, - 75.48305415523733 + -86.290511, + 75.483054 ], [ - -86.30555940981604, - 75.46010536299346 + -86.305559, + 75.460105 ], [ - -86.32943549991796, - 75.43763510442683 + -86.329435, + 75.437635 ], [ - -86.3618733357048, - 75.4158571319414 + -86.361873, + 75.415857 ], [ - -86.40252904432666, - 75.3949776984985 + -86.402529, + 75.394978 ], [ - -86.45098572633513, - 75.37519370883514 + -86.450986, + 75.375194 ], [ - -86.50675836143384, - 75.3566909851694 + -86.506758, + 75.356691 ], [ - -86.56929910065334, - 75.33964265776739 + -86.569299, + 75.339643 ], [ - -86.63800287711936, - 75.32420768904333 + -86.638003, + 75.324208 ], [ - -86.71221327485428, - 75.310529538328 + -86.712213, + 75.31053 ], [ - -86.79122860266388, - 75.2987349730824 + -86.791229, + 75.298735 ], [ - -86.87430812775848, - 75.2889330311531 + -86.874308, + 75.288933 ], [ - -86.9606784310271, - 75.28121413765774 + -86.960678, + 75.281214 ], [ - -87.04953985256526, - 75.27564937924163 + -87.04954, + 75.275649 ], [ - -87.1400730019311, - 75.27228993774082 + -87.140073, + 75.27229 ], [ - -87.2314453125, - 75.27116668470433 + -87.231445, + 75.271167 ], [ - -87.3228176230689, - 75.27228993774082 + -87.322818, + 75.27229 ], [ - -87.41335077243474, - 75.27564937924163 + -87.413351, + 75.275649 ], [ - -87.5022121939729, - 75.28121413765774 + -87.502212, + 75.281214 ], [ - -87.58858249724152, - 75.2889330311531 + -87.588582, + 75.288933 ], [ - -87.67166202233614, - 75.2987349730824 + -87.671662, + 75.298735 ], [ - -87.75067735014574, - 75.310529538328 + -87.750677, + 75.31053 ], [ - -87.82488774788064, - 75.32420768904333 + -87.824888, + 75.324208 ], [ - -87.89359152434668, - 75.33964265776739 + -87.893592, + 75.339643 ], [ - -87.95613226356616, - 75.3566909851694 + -87.956132, + 75.356691 ], [ - -88.01190489866487, - 75.37519370883514 + -88.011905, + 75.375194 ], [ - -88.06036158067334, - 75.3949776984985 + -88.060362, + 75.394978 ], [ - -88.1010172892952, - 75.4158571319414 + -88.101017, + 75.415857 ], [ - -88.13345512508204, - 75.43763510442683 + -88.133455, + 75.437635 ], [ - -88.15733121518396, - 75.46010536299346 + -88.157331, + 75.460105 ], [ - -88.17237915830916, - 75.48305415523733 + -88.172379, + 75.483054 ], [ - -88.17841392915777, - 75.5062621803556 + -88.178414, + 75.506262 ], [ - -88.17533515883981, - 75.52950662825931 + -88.175335, + 75.529507 ], [ - -88.16312970609404, - 75.55256329051855 + -88.16313, + 75.552563 ], [ - -88.14187343492195, - 75.57520872483734 + -88.141873, + 75.575209 ], [ - -88.11173211791692, - 75.59722245272981 + -88.111732, + 75.597222 ], [ - -88.07296139140387, - 75.61838916815753 + -88.072961, + 75.618389 ], [ - -88.02590569870489, - 75.63850093317049 + -88.025906, + 75.638501 ], [ - -87.97099617146412, - 75.6573593351559 + -87.970996, + 75.657359 ], [ - -87.9087474158957, - 75.67477757922566 + -87.908747, + 75.674778 ], [ - -87.83975319077366, - 75.69058248864654 + -87.839753, + 75.690582 ], [ - -87.76468098648682, - 75.70461638611047 + -87.764681, + 75.704616 ], [ - -87.68426553887268, - 75.71673882911684 + -87.684266, + 75.716739 ], [ - -87.59930133699889, - 75.72682817383318 + -87.599301, + 75.726828 ], [ - -87.51063420961903, - 75.7347829435378 + -87.510634, + 75.734783 ], [ - -87.41915209964617, - 75.74052298011723 + -87.419152, + 75.740523 ], [ - -87.32577515859484, - 75.74399036006236 + -87.325775, + 75.74399 ], [ - -87.2314453125, - 75.74515005991336 + -87.231445, + 75.74515 ] ] ] diff --git a/packages/turf-nearest-point-to-line/test/out/segment.geojson b/packages/turf-nearest-point-to-line/test/out/segment.geojson index e46f3a930a..ce518adee3 100644 --- a/packages/turf-nearest-point-to-line/test/out/segment.geojson +++ b/packages/turf-nearest-point-to-line/test/out/segment.geojson @@ -74,264 +74,264 @@ "coordinates": [ [ [ - 27.268066406250004, - 15.046566556329937 + 27.268066, + 15.046567 ], [ - 27.34961301171175, - 15.04268354039556 + 27.349613, + 15.042684 ], [ - 27.43036560509869, - 15.031072310022385 + 27.430366, + 15.031072 ], [ - 27.509538173049005, - 15.01184593581434 + 27.509538, + 15.011846 ], [ - 27.5863606074305, - 14.985191600951385 + 27.586361, + 14.985192 ], [ - 27.660086429082174, - 14.951368714975777 + 27.660086, + 14.951369 ], [ - 27.730000241379773, - 14.910706303849164 + 27.73, + 14.910706 ], [ - 27.795424830851758, - 14.863599706357817 + 27.795425, + 14.8636 ], [ - 27.85572783799104, - 14.81050661459659 + 27.855728, + 14.810507 ], [ - 27.91032792842231, - 14.751942503259729 + 27.910328, + 14.751943 ], [ - 27.95870040247301, - 14.688475498713954 + 27.9587, + 14.688475 ], [ - 28.000382189720955, - 14.620720744257305 + 28.000382, + 14.620721 ], [ - 28.034976184014795, - 14.549334322532511 + 28.034976, + 14.549334 ], [ - 28.06215488355595, - 14.475006799748384 + 28.062155, + 14.475007 ], [ - 28.081663309682863, - 14.398456459170907 + 28.081663, + 14.398456 ], [ - 28.09332118682831, - 14.32042229330184 + 28.093321, + 14.320422 ], [ - 28.097024374579817, - 14.241656825306483 + 28.097024, + 14.241657 ], [ - 28.09274555074808, - 14.162918830634434 + 28.092746, + 14.162919 ], [ - 28.080534151762517, - 14.084966029456634 + 28.080534, + 14.084966 ], [ - 28.060515583523284, - 14.008547819579189 + 28.060516, + 14.008548 ], [ - 28.032889722032387, - 13.934398117950755 + 28.03289, + 13.934398 ], [ - 27.997928728714665, - 13.863228376812856 + 27.997929, + 13.863228 ], [ - 27.95597421035276, - 13.795720838003911 + 27.955974, + 13.795721 ], [ - 27.907433758040774, - 13.732522085964083 + 27.907434, + 13.732522 ], [ - 27.852776903557245, - 13.674236956639005 + 27.852777, + 13.674237 ], [ - 27.79253053511818, - 13.621422855779503 + 27.792531, + 13.621423 ], [ - 27.727273817639144, - 13.574584536110509 + 27.727274, + 13.574585 ], [ - 27.65763266544927, - 13.534169378520284 + 27.657633, + 13.534169 ], [ - 27.584273817887407, - 13.500563217824318 + 27.584274, + 13.500563 ], [ - 27.50789857038972, - 13.474086748809798 + 27.507899, + 13.474087 ], [ - 27.42923621555796, - 13.45499254319047 + 27.429236, + 13.454993 ], [ - 27.349037250279473, - 13.443462702824968 + 27.349037, + 13.443463 ], [ - 27.268066406250004, - 13.439607169103843 + 27.268066, + 13.439607 ], [ - 27.18709556222053, - 13.443462702824968 + 27.187096, + 13.443463 ], [ - 27.106896596942043, - 13.45499254319047 + 27.106897, + 13.454993 ], [ - 27.028234242110283, - 13.474086748809798 + 27.028234, + 13.474087 ], [ - 26.9518589946126, - 13.500563217824318 + 26.951859, + 13.500563 ], [ - 26.878500147050733, - 13.534169378520284 + 26.8785, + 13.534169 ], [ - 26.80885899486086, - 13.574584536110509 + 26.808859, + 13.574585 ], [ - 26.743602277381825, - 13.621422855779503 + 26.743602, + 13.621423 ], [ - 26.683355908942758, - 13.674236956639005 + 26.683356, + 13.674237 ], [ - 26.62869905445923, - 13.732522085964083 + 26.628699, + 13.732522 ], [ - 26.580158602147243, - 13.795720838003911 + 26.580159, + 13.795721 ], [ - 26.53820408378534, - 13.863228376812856 + 26.538204, + 13.863228 ], [ - 26.503243090467617, - 13.934398117950755 + 26.503243, + 13.934398 ], [ - 26.47561722897672, - 14.008547819579189 + 26.475617, + 14.008548 ], [ - 26.455598660737486, - 14.084966029456634 + 26.455599, + 14.084966 ], [ - 26.443387261751923, - 14.162918830634434 + 26.443387, + 14.162919 ], [ - 26.439108437920186, - 14.241656825306483 + 26.439108, + 14.241657 ], [ - 26.442811625671695, - 14.32042229330184 + 26.442812, + 14.320422 ], [ - 26.45446950281714, - 14.398456459170907 + 26.45447, + 14.398456 ], [ - 26.473977928944052, - 14.475006799748384 + 26.473978, + 14.475007 ], [ - 26.50115662848521, - 14.549334322532511 + 26.501157, + 14.549334 ], [ - 26.535750622779048, - 14.620720744257305 + 26.535751, + 14.620721 ], [ - 26.577432410026994, - 14.688475498713954 + 26.577432, + 14.688475 ], [ - 26.625804884077695, - 14.751942503259729 + 26.625805, + 14.751943 ], [ - 26.680404974508964, - 14.810506614596587 + 26.680405, + 14.810507 ], [ - 26.740707981648246, - 14.863599706357817 + 26.740708, + 14.8636 ], [ - 26.80613257112023, - 14.910706303849164 + 26.806133, + 14.910706 ], [ - 26.87604638341783, - 14.951368714975777 + 26.876046, + 14.951369 ], [ - 26.949772205069504, - 14.985191600951385 + 26.949772, + 14.985192 ], [ - 27.026594639450998, - 15.01184593581434 + 27.026595, + 15.011846 ], [ - 27.10576720740131, - 15.031072310022385 + 27.105767, + 15.031072 ], [ - 27.186519800788254, - 15.04268354039556 + 27.18652, + 15.042684 ], [ - 27.268066406250004, - 15.046566556329937 + 27.268066, + 15.046567 ] ] ] diff --git a/packages/turf-nearest-point-to-line/test/out/two.geojson b/packages/turf-nearest-point-to-line/test/out/two.geojson index 7299626af9..1d7947f296 100644 --- a/packages/turf-nearest-point-to-line/test/out/two.geojson +++ b/packages/turf-nearest-point-to-line/test/out/two.geojson @@ -93,264 +93,264 @@ "coordinates": [ [ [ - -38.0126953125, - 26.89706388840599 + -38.012695, + 26.897064 ], [ - -37.93552441172803, - 26.893662035598062 + -37.935524, + 26.893662 ], [ - -37.85911039862827, - 26.883489849979018 + -37.85911, + 26.88349 ], [ - -37.784202324290746, - 26.866647103835728 + -37.784202, + 26.866647 ], [ - -37.71153366503345, - 26.84329893494962 + -37.711534, + 26.843299 ], [ - -37.641814778996846, - 26.81367413783948 + -37.641815, + 26.813674 ], [ - -37.57572564999091, - 26.7780628017451 + -37.575726, + 26.778063 ], [ - -37.513909005361654, - 26.736813324835175 + -37.513909, + 26.736813 ], [ - -37.456963887376354, - 26.69032884149463 + -37.456964, + 26.690329 ], [ - -37.40543974905283, - 26.63906310618754 + -37.40544, + 26.639063 ], [ - -37.35983113577391, - 26.583515883199183 + -37.359831, + 26.583516 ], [ - -37.32057300375018, - 26.52422789646192 + -37.320573, + 26.524228 ], [ - -37.288036715741825, - 26.461775397622354 + -37.288037, + 26.461775 ], [ - -37.262526743730376, - 26.396764413500016 + -37.262527, + 26.396764 ], [ - -37.244278097726884, - 26.32982473613523 + -37.244278, + 26.329825 ], [ - -37.23345448986008, - 26.261603719765624 + -37.233454, + 26.261604 ], [ - -37.23014723350783, - 26.192759949365364 + -37.230147, + 26.19276 ], [ - -37.23437486867239, - 26.123956844902548 + -37.234375, + 26.123957 ], [ - -37.2460834971584, - 26.05585626430064 + -37.246083, + 26.055856 ], [ - -37.26514780444807, - 25.98911216631813 + -37.265148, + 25.989112 ], [ - -37.29137273949325, - 25.924364392274782 + -37.291373, + 25.924364 ], [ - -37.32449581893367, - 25.862232622838107 + -37.324496, + 25.862233 ], [ - -37.36419001844701, - 25.80331056301978 + -37.36419, + 25.803311 ], [ - -37.41006721096029, - 25.74816040518909 + -37.410067, + 25.74816 ], [ - -37.46168210920786, - 25.697307616351463 + -37.461682, + 25.697308 ], [ - -37.5185366685034, - 25.651236092216436 + -37.518537, + 25.651236 ], [ - -37.5800849044965, - 25.610383716733395 + -37.580085, + 25.610384 ], [ - -37.6457380800029, - 25.57513836183868 + -37.645738, + 25.575138 ], [ - -37.71487021463542, - 25.545834358159915 + -37.71487, + 25.545834 ], [ - -37.786823870831, - 25.522749463381285 + -37.786824, + 25.522749 ], [ - -37.86091616989228, - 25.506102350900992 + -37.860916, + 25.506102 ], [ - -37.93644499177463, - 25.496050637318874 + -37.936445, + 25.496051 ], [ - -38.0126953125, - 25.492689463184444 + -38.012695, + 25.492689 ], [ - -38.08894563322538, - 25.496050637318874 + -38.088946, + 25.496051 ], [ - -38.16447445510772, - 25.506102350900992 + -38.164474, + 25.506102 ], [ - -38.238566754169, - 25.522749463381285 + -38.238567, + 25.522749 ], [ - -38.31052041036459, - 25.545834358159915 + -38.31052, + 25.545834 ], [ - -38.37965254499711, - 25.57513836183868 + -38.379653, + 25.575138 ], [ - -38.445305720503505, - 25.610383716733395 + -38.445306, + 25.610384 ], [ - -38.506853956496606, - 25.651236092216436 + -38.506854, + 25.651236 ], [ - -38.56370851579215, - 25.697307616351463 + -38.563709, + 25.697308 ], [ - -38.61532341403971, - 25.74816040518909 + -38.615323, + 25.74816 ], [ - -38.66120060655299, - 25.80331056301978 + -38.661201, + 25.803311 ], [ - -38.70089480606633, - 25.862232622838107 + -38.700895, + 25.862233 ], [ - -38.73401788550676, - 25.924364392274782 + -38.734018, + 25.924364 ], [ - -38.76024282055194, - 25.98911216631813 + -38.760243, + 25.989112 ], [ - -38.7793071278416, - 26.05585626430064 + -38.779307, + 26.055856 ], [ - -38.79101575632762, - 26.123956844902548 + -38.791016, + 26.123957 ], [ - -38.79524339149218, - 26.192759949365364 + -38.795243, + 26.19276 ], [ - -38.79193613513993, - 26.261603719765624 + -38.791936, + 26.261604 ], [ - -38.78111252727312, - 26.32982473613523 + -38.781113, + 26.329825 ], [ - -38.76286388126963, - 26.396764413500016 + -38.762864, + 26.396764 ], [ - -38.73735390925818, - 26.461775397622354 + -38.737354, + 26.461775 ], [ - -38.70481762124983, - 26.52422789646192 + -38.704818, + 26.524228 ], [ - -38.6655594892261, - 26.583515883199183 + -38.665559, + 26.583516 ], [ - -38.61995087594717, - 26.63906310618754 + -38.619951, + 26.639063 ], [ - -38.56842673762365, - 26.69032884149463 + -38.568427, + 26.690329 ], [ - -38.51148161963835, - 26.736813324835175 + -38.511482, + 26.736813 ], [ - -38.44966497500909, - 26.7780628017451 + -38.449665, + 26.778063 ], [ - -38.38357584600316, - 26.81367413783948 + -38.383576, + 26.813674 ], [ - -38.31385695996656, - 26.84329893494962 + -38.313857, + 26.843299 ], [ - -38.24118830070926, - 26.866647103835728 + -38.241188, + 26.866647 ], [ - -38.16628022637174, - 26.883489849979018 + -38.16628, + 26.88349 ], [ - -38.089866213271975, - 26.893662035598062 + -38.089866, + 26.893662 ], [ - -38.0126953125, - 26.89706388840599 + -38.012695, + 26.897064 ] ] ] diff --git a/packages/turf-nearest-point-to-line/yarn.lock b/packages/turf-nearest-point-to-line/yarn.lock index da3a09ba45..c8c241ac59 100644 --- a/packages/turf-nearest-point-to-line/yarn.lock +++ b/packages/turf-nearest-point-to-line/yarn.lock @@ -72,6 +72,12 @@ "@turf/invariant" "^4.7.3" geodesy "1.1.2" +"@turf/truncate@^4.7.3": + version "4.7.3" + resolved "https://registry.yarnpkg.com/@turf/truncate/-/truncate-4.7.3.tgz#827a8df8ff0c9fff9dcf1a4b3145cbdef80fb993" + dependencies: + "@turf/meta" "^4.7.3" + balanced-match@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"