{"name":"@turf/nearest-point","version":"6.5.0","keywords":["turf","geojson","gis","near","nearest","point"],"author":{"name":"Turf Authors"},"license":"MIT","_id":"@turf/nearest-point@6.5.0","homepage":"https://github.com/Turfjs/turf","bugs":{"url":"https://github.com/Turfjs/turf/issues"},"dist":{"shasum":"2f1781c26ff3f054005d4ff352042973318b92f1","tarball":"http://registry-npm.ywwl.com/@turf/nearest-point/download/@turf/nearest-point-6.5.0.tgz","fileCount":7,"integrity":"sha512-fguV09QxilZv/p94s8SMsXILIAMiaXI5PATq9d7YWijLxWUj6Q/r43kxyoi78Zmwwh1Zfqz9w+bCYUAxZ5+euA==","signatures":[{"sig":"MEYCIQCeOSjUYoccDUeIcF06YjNPSdhu7sGGDXrZSg+JX8KBVQIhAItcdUcUxkkWVBa86h6nYV3ZR4ooOsVc3JLEX4Ad8o6X","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":9741,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh2fJ6CRA9TVsSAnZWagAAfpsP/3BfsirNg1SuKyBpncIm\ngUG4rw+2CP6sJedKORyaYc8OmxWErIEUxd+m+R/pa7JtRmDckQBSh/+jV1Ad\n3CTwWUXqfzB/Ztm2N9B3O5v0MY3Rwnbi+D5k1YuWxj3xY4Q8GsI5RHGKcHHG\n410hWgJJwU2rHq7RE2F//UvgsxG0GsvlY5C4Hmi4QGglIR81xEigCV7eqUbC\n4M6B6sRYPaz1RQg8EB7MrjxDTF33GK3+7qEXR7BdPxC/UMK5ac/EruOa6o3K\n226hw94DMCW7mrVCVsZlFDM1J8901BHafAgTZDBwUvSugjUljQhPno3oGtYQ\nbiEhqy6Mi8Px8Sy79K0Y1E/zhUuhHV5aD58ghbVc+yiJCkqAkcbD4lyWnuQl\nfHsVbSb71/RwRm7Y+wauSfOfUZ9Vtss4cL4qk+GpClMWrGEX7bOrYDZEltqJ\nCEtMVe2Whtk+Kq0eWkTF3CSyc7x7MbRmfeThkr0rZecDsqynKTENOuWpRgqD\ngJahCNkM2KVsmkgEcmGhICpOFd9B4ETZlHlgDdlBMB3IJVY+wgYmZ+/bxTIJ\nhg8Bm6LZtTFBqV0rbHKM/m+NsjsuME21/u9zQ43uJTY8iB7dT4EGXb+5Flm8\nWFAL6ynpzBrdefsEiJT6v27TYZ/1BiLkT/rMd5OWILsVXu1dgDGHQ215EAa5\npswm\r\n=ZqBv\r\n-----END PGP SIGNATURE-----\r\n","size":3130,"noattachment":false,"key":"/@turf/nearest-point/-/@turf/nearest-point-6.5.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":"5375941072b90d489389db22b43bfe809d5e451e","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 types.ts"},"_npmUser":{"name":"rowanwins","email":"rowanwins@yahoo.com.au"},"repository":{"url":"git://github.com/Turfjs/turf.git","type":"git"},"_npmVersion":"lerna/4.0.0/node@v14.8.0+x64 (darwin)","description":"turf nearest-point module","directories":{},"sideEffects":false,"_nodeVersion":"14.8.0","dependencies":{"@turf/meta":"^6.5.0","@turf/clone":"^6.5.0","@turf/helpers":"^6.5.0","@turf/distance":"^6.5.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tape":"*","tslint":"*","ts-node":"*","benchmark":"*","typescript":"*","@types/tape":"*","npm-run-all":"*"},"_npmOperationalInternal":{"tmp":"tmp/nearest-point_6.5.0_1625912264862_0.1297555071303902","host":"s3://npm-registry-packages"},"readme":"# @turf/nearest-point\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n## nearestPoint\n\nTakes a reference [point][1] and a FeatureCollection of Features\nwith Point geometries and returns the\npoint from the FeatureCollection closest to the reference. This calculation\nis geodesic.\n\n### Parameters\n\n*   `targetPoint` **[Coord][2]** the reference point\n*   `points` **[FeatureCollection][3]<[Point][1]>** against input point set\n*   `options` **[Object][4]** Optional parameters (optional, default `{}`)\n\n    *   `options.units` **Units** the units of the numeric result. Supports all valid Turf [Units][5]. (optional, default `'kilometers'`)\n\n### Examples\n\n```javascript\nvar targetPoint = turf.point([28.965797, 41.010086], {\"marker-color\": \"#0F0\"});\nvar points = turf.featureCollection([\n    turf.point([28.973865, 41.011122]),\n    turf.point([28.948459, 41.024204]),\n    turf.point([28.938674, 41.013324])\n]);\n\nvar nearest = turf.nearestPoint(targetPoint, points);\n\n//addToMap\nvar addToMap = [targetPoint, points, nearest];\nnearest.properties['marker-color'] = '#F00';\n```\n\nReturns **[Feature][6]<[Point][1]>** the closest point in the set to the reference point\n\n[1]: https://tools.ietf.org/html/rfc7946#section-3.1.2\n\n[2]: https://tools.ietf.org/html/rfc7946#section-3.1.1\n\n[3]: https://tools.ietf.org/html/rfc7946#section-3.3\n\n[4]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\n\n[5]: https://turfjs.org/docs/api/types/Units\n\n[6]: https://tools.ietf.org/html/rfc7946#section-3.2\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\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":1625912264980,"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":1625912264980,"dist-tags":{"latest":"7.4.0","prerelease":"7.1.0-alpha.70"}}