{"name":"@turf/point-on-line","version":"3.7.3","author":{"name":"morganherlocker"},"license":"MIT","_id":"@turf/point-on-line@3.7.3","homepage":"https://github.com/Turfjs/turf","bugs":{"url":"https://github.com/Turfjs/turf/issues"},"dist":{"shasum":"11ed083413fd2e5f24ac20822fcbd5597d492e25","tarball":"http://registry-npm.ywwl.com/@turf/point-on-line/download/@turf/point-on-line-3.7.3.tgz","integrity":"sha512-BxxM0gBgj3aDl1SxGp0WgXkmWnZFfEEQb6sYZbKGcWXybL5aABYWlkYr8R/5nEPpZDAVZZDSNRG+ckCVlZHoBQ==","signatures":[{"sig":"MEQCIFkF1Vjfl1R/3cO4jhSV92IccujKb0bl3vgRBeT+pdRLAiB7QJxRfyXC/qG4xSV+/NzyPwEYIfM2UoGRYxZ/2HNHNg==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"size":3931,"noattachment":false,"key":"/@turf/point-on-line/-/@turf/point-on-line-3.7.3.tgz"},"main":"index.js","_from":".","types":"index.d.ts","_shasum":"11ed083413fd2e5f24ac20822fcbd5597d492e25","scripts":{"test":"node test/test.js"},"_npmUser":{"name":"tmcw","email":"tom@macwright.org"},"deprecated":"Module has been renamed to @turf/nearest-point-on-line","repository":{"url":"git://github.com/Turfjs/turf.git","type":"git"},"_npmVersion":"2.15.11","description":"# pointOnLine","directories":{},"_nodeVersion":"4.7.2","dependencies":{"@turf/bearing":"^3.7.3","@turf/helpers":"^3.7.3","@turf/distance":"^3.7.3","@turf/destination":"^3.7.3"},"devDependencies":{"tape":"^3.5.0","benchmark":"^1.0.0","@turf/along":"^3.7.3","@turf/helpers":"^3.7.3","@turf/distance":"^3.7.3","@turf/line-distance":"^3.7.3"},"_npmOperationalInternal":{"tmp":"tmp/point-on-line-3.7.3.tgz_1483981205514_0.15282412455417216","host":"packages-12-west.internal.npmjs.com"},"readme":"# @turf/point-on-line\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n## pointOnLine\n\nTakes a [Point](http://geojson.org/geojson-spec.html#point) and a [LineString](http://geojson.org/geojson-spec.html#linestring) and calculates the closest Point on the (Multi)LineString.\n\n**Parameters**\n\n-   `lines` **([Geometry](http://geojson.org/geojson-spec.html#geometry) \\| [Feature](http://geojson.org/geojson-spec.html#feature-objects)&lt;([LineString](http://geojson.org/geojson-spec.html#linestring) \\| [MultiLineString](http://geojson.org/geojson-spec.html#multilinestring))>)** lines to snap to\n-   `pt` **([Geometry](http://geojson.org/geojson-spec.html#geometry) \\| [Feature](http://geojson.org/geojson-spec.html#feature-objects)&lt;[Point](http://geojson.org/geojson-spec.html#point)> | [Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)&lt;[number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)>)** point to snap from\n-   `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`)\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 pt = turf.point([-77.037076, 38.884017]);\n\nvar snapped = turf.pointOnLine(line, pt, 'miles');\n\n//addToMap\nvar addToMap = [line, pt, snapped];\nsnapped.properties['marker-color'] = '#00f';\n```\n\nReturns **[Feature](http://geojson.org/geojson-spec.html#feature-objects)&lt;[Point](http://geojson.org/geojson-spec.html#point)>** closest point on the `line` to `point`. The properties object will contain three values: `index`: closest point was found on nth line part, `dist`: distance between pt and the closest point, `location`: distance along the line between start and the closest point.\n\n<!-- This file is automatically generated. Please don't edit it directly:\nif you find an error, edit the source file (likely index.js), and re-run\n./scripts/generate-readmes in the turf project. -->\n\n---\n\nThis module is part of the [Turfjs project](http://turfjs.org/), an open source\nmodule collection dedicated to geographic algorithms. It is maintained in the\n[Turfjs/turf](https://github.com/Turfjs/turf) repository, where you can create\nPRs and issues.\n\n### Installation\n\nInstall this module individually:\n\n```sh\n$ npm install @turf/point-on-line\n```\n\nOr install the Turf module that includes it as a function:\n\n```sh\n$ npm install @turf/turf\n```\n","publish_time":1483981207512,"maintainers":[{"email":"james@smallsaucepan.com","name":"smallsaucepan"},{"email":"morganherlocker@gmail.com","name":"morgan.herlocker"},{"email":"tim.j.welch@gmail.com","name":"twelch"},{"email":"jamesmilner22@hotmail.com","name":"jamesmilneruk"},{"email":"rowanwins@yahoo.com.au","name":"rowanwins"},{"email":"tom@macwright.com","name":"tmcw"},{"email":"morgan.herlocker@gmail.com","name":"morganherlocker"},{"email":"tim.channell@gmail.com","name":"tcql"},{"email":"mdfedderly@mdfedderly.com","name":"mdfedderly"}],"_cnpm_publish_time":1483981207512,"dist-tags":{"canary":"3.5.2-alpha.d2c36ee7","latest":"5.0.3","lerna-temp":"4.7.1"}}