{"name":"@turf/nearest-point-on-line","version":"7.0.0-alpha.0","author":{"name":"Turf Authors"},"license":"MIT","_id":"@turf/nearest-point-on-line@7.0.0-alpha.0","homepage":"https://github.com/Turfjs/turf","bugs":{"url":"https://github.com/Turfjs/turf/issues"},"dist":{"shasum":"4a1f9a96744625182971fb1b096a9b079b7cb99e","tarball":"http://registry-npm.ywwl.com/@turf/nearest-point-on-line/download/@turf/nearest-point-on-line-7.0.0-alpha.0.tgz","fileCount":7,"integrity":"sha512-8LaFRnG1qkPjMdOQpnaGM7mWo359IIK+mtc4QSfHb7CePKGAuRihmD1iMtDWTKZlplUZe6I8mHmDbiUUyp6fPw==","signatures":[{"sig":"MEYCIQCcVpUltkcIoLksDcMA+uRwUubXcM3qxF7eWqSDtwAE/AIhAIwb3TEX3EQIjOSLWFEvErXb+P/zAgSBei2T8CxOb2fx","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":16404,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJja8OzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoASA/+Iuyc1uaPBsh7K4UM21IycvcfCTboleZLe3LIu/j2kP3VTr2y\r\nCRiwm0IiwgxijmjBP4xOjmocGRDJAxAPeCJ1IW3oyLrBmyfEhBNAN6sXrL5w\r\nztDEed84QcrBKYAM2/A76HImqyW2Z1rDvjpH1QXKfHaTLbSILLRKuOBn9n1i\r\nJZ3imz+4iHHxp0CV1WLvguHqcjKRcOSsxJ4eLoyYlVEmWhEJ7WdTEKhVFASp\r\nepjqAHpD8bPf7BeyuJJSKgBja1dRDgaLIInmJUjw0peHem/ZmZ6YORt5NTbh\r\nWlC2A0+IR+ABP9UvX+krybYZpt0RIe/cPpEs5wQv3hfyRyr215ZxCeiqqXEq\r\nTRbnluoGDoetEkFegzAAaW3sCsPwC0XvHt+QEMrQKmKggKK/foM8eJd7JRKZ\r\nsc519guT+1ruNIxC5ozj+j5bugNxrR6sWgbpcxEvKq0WsSVdDoGJM7X4kqty\r\n3IGNaLgjXx82HKRwwKfy0yPznmrbQ5Qqu+Qj1ybn+9x9d1yt1+9N0CoGHe2/\r\n34b4T5eCbDT7AISgIcY3LNzFtXzeXz6aL4z3oKD+m4rPHLF9Hv8A4UmlaOms\r\nWDfHj7/2fAxMQXAuu0UdOK/JojfjLwlHvZSqX+kzJoDGEJezNt9uoCsu0q55\r\nnuf8jOpoh0M0v8zoqWD7FqYjPWTRKbLNjX8=\r\n=P/Ss\r\n-----END PGP SIGNATURE-----\r\n","size":4129,"noattachment":false,"key":"/@turf/nearest-point-on-line/-/@turf/nearest-point-on-line-7.0.0-alpha.0.tgz"},"main":"dist/js/index.js","types":"dist/js/index.d.ts","module":"dist/es/index.js","exports":{".":{"import":"./dist/es/index.js","require":"./dist/js/index.js"},"./package.json":"./package.json"},"funding":"https://opencollective.com/turf","gitHead":"0edc4c491b999e5ace770a61e1cf549f7c004189","scripts":{"docs":"node ../../scripts/generate-readmes","test":"npm-run-all test:*","bench":"ts-node bench.js","build":"npm-run-all build:*","build:es":"tsc --outDir dist/es --module esnext --declaration false && echo '{\"type\":\"module\"}' > dist/es/package.json","build:js":"tsc","test:tape":"ts-node -r esm test.js","test:types":"tsc --esModuleInterop --noEmit --strict types.ts"},"_npmUser":{"name":"mdfedderly","email":"mdfedderly@mdfedderly.com"},"repository":{"url":"git://github.com/Turfjs/turf.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v19.0.1+arm64 (darwin)","description":"turf nearest-point-on-line module","directories":{},"sideEffects":false,"_nodeVersion":"19.0.1","dependencies":{"tslib":"^2.3.0","@turf/meta":"^7.0.0-alpha.0","@turf/bearing":"^7.0.0-alpha.0","@turf/helpers":"^7.0.0-alpha.0","@turf/distance":"^7.0.0-alpha.0","@turf/invariant":"^7.0.0-alpha.0","@turf/destination":"^7.0.0-alpha.0","@turf/line-intersect":"^7.0.0-alpha.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tape":"*","tslint":"*","ts-node":"*","benchmark":"*","typescript":"*","@turf/along":"^7.0.0-alpha.0","@types/tape":"*","npm-run-all":"*","@turf/length":"^7.0.0-alpha.0","@turf/truncate":"^7.0.0-alpha.0","load-json-file":"*","write-json-file":"*"},"_npmOperationalInternal":{"tmp":"tmp/nearest-point-on-line_7.0.0-alpha.0_1668006835478_0.8767217941700816","host":"s3://npm-registry-packages"},"readme":"# @turf/nearest-point-on-line\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n## nearestPointOnLine\n\nReturns the nearest point on a line to a given point.\n\nIf any of the segments in the input line string are antipodal and therefore\nhave an undefined arc, this function will instead return that the point lies\non the line.\n\n⚠️ We have begun the process of migrating to different return properties for\nthis function. The new properties we recommend using as of v7.4 are:\n\n*   lineStringIndex - point was found on the nth LineString of an input MultiLineString. Previously `multiFeatureIndex`\n*   segmentIndex - point was found on the nth segment of the above LineString. Previously `index`\n*   totalDistance - distance from the start of the overall MultiLineString. Previously `location`\n*   lineDistance - distance from the start of the relevant LineString\n*   segmentDistance - distance from the start of the relevant segment\n*   pointDistance - distance between found point is from input reference point. Previously `dist`\n\nmultiFeatureIndex, index, location, and dist continue to work as previously\nuntil at least the next major release.\n\n### Parameters\n\n*   `lines` **([Geometry][1] | [Feature][2]<([LineString][3] | [MultiLineString][4])>)** Lines to snap to\n*   `inputPoint` **([Geometry][1] | [Feature][2]<[Point][5]> | [Array][6]<[number][7]>)** Point to snap from\n*   `options` **[Object][8]** Optional parameters (optional, default `{}`)\n\n    *   `options.units` **Units** Supports all valid Turf [Units][9] (optional, default `'kilometers'`)\n\n### Examples\n\n```javascript\nvar line = turf.lineString([\n    [-77.031669, 38.878605],\n    [-77.029609, 38.881946],\n    [-77.020339, 38.884084],\n    [-77.025661, 38.885821],\n    [-77.021884, 38.889563],\n    [-77.019824, 38.892368]\n]);\nvar inputPoint = turf.point([-77.037076, 38.884017]);\n\nvar snapped = turf.nearestPointOnLine(line, inputPoint, {units: 'miles'});\n\n//addToMap\nvar addToMap = [line, inputPoint, snapped];\nsnapped.properties['marker-color'] = '#00f';\n```\n\nReturns **[Feature][2]<[Point][5]>** closest point on the `lines` to the `inputPoint`. The point will have the following properties: `lineStringIndex`: closest point was found on the nth LineString (only relevant if input is MultiLineString), `segmentIndex`: closest point was found on nth line segment of the LineString, `totalDistance`: distance along the line from the absolute start of the MultiLineString, `lineDistance`: distance along the line from the start of the LineString where the closest point was found, `segmentDistance`: distance along the line from the start of the line segment where the closest point was found, `pointDistance`: distance to the input point.\n\n[1]: https://tools.ietf.org/html/rfc7946#section-3.1\n\n[2]: https://tools.ietf.org/html/rfc7946#section-3.2\n\n[3]: https://tools.ietf.org/html/rfc7946#section-3.1.4\n\n[4]: https://tools.ietf.org/html/rfc7946#section-3.1.5\n\n[5]: https://tools.ietf.org/html/rfc7946#section-3.1.2\n\n[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array\n\n[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number\n\n[8]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\n\n[9]: https://turfjs.org/docs/api/types/Units\n\n<!-- This file is automatically generated. Please don't edit it directly. If you find an error, edit the source file of the module in question (likely index.js or index.ts), and re-run \"yarn docs\" from the root of the turf project. -->\n\n---\n\nThis module is part of the [Turfjs project](https://turfjs.org/), an open source module collection dedicated to geographic algorithms. It is maintained in the [Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create PRs and issues.\n\n### Installation\n\nInstall this single module individually:\n\n```sh\n$ npm install @turf/nearest-point-on-line\n```\n\nOr install the all-encompassing @turf/turf module that includes all modules as functions:\n\n```sh\n$ npm install @turf/turf\n```\n","publish_time":1668006835654,"maintainers":[{"name":"smallsaucepan","email":"james@smallsaucepan.com"},{"name":"morgan.herlocker","email":"morganherlocker@gmail.com"},{"name":"twelch","email":"tim.j.welch@gmail.com"},{"name":"jamesmilneruk","email":"jamesmilner22@hotmail.com"},{"name":"rowanwins","email":"rowanwins@yahoo.com.au"},{"name":"tmcw","email":"tom@macwright.com"},{"name":"morganherlocker","email":"morgan.herlocker@gmail.com"},{"name":"tcql","email":"tim.channell@gmail.com"},{"name":"mdfedderly","email":"mdfedderly@mdfedderly.com"}],"_cnpm_publish_time":1668006835654,"dist-tags":{"latest":"7.4.0","prerelease":"7.1.0-alpha.70"}}