{"name":"@turf/random","version":"7.3.3","keywords":["turf","gis"],"author":{"name":"Turf Authors"},"license":"MIT","_id":"@turf/random@7.3.3","maintainers":[{"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"},{"name":"twelch","email":"tim.j.welch@gmail.com"},{"name":"jamesmilneruk","email":"jamesmilner22@hotmail.com"},{"name":"morgan.herlocker","email":"morganherlocker@gmail.com"},{"name":"smallsaucepan","email":"james@smallsaucepan.com"}],"homepage":"https://github.com/Turfjs/turf","bugs":{"url":"https://github.com/Turfjs/turf/issues"},"dist":{"shasum":"c75961066da348c8bd2f06cc955cb96a402b8ee5","tarball":"http://registry-npm.ywwl.com/@turf/random/download/@turf/random-7.3.3.tgz","fileCount":9,"integrity":"sha512-11gqu8Fu1mACzcEAPrc9N8QFNeHfSOI21j80Tj4E1fa5qTgbveZ8nIKlIc5Y9XmWfNzSWwjABFejNs8E/OXcag==","signatures":[{"sig":"MEQCIDuzHGUiPEdAamIXwMOOmaL5Jhqeg55C14HVNE4SLHkMAiA4dAkoTcrX6tmffi3LoZl9f23gWiywmM1yuAhiMAI+yw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@turf%2frandom@7.3.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":51415,"size":8778,"noattachment":false,"key":"/@turf/random/-/@turf/random-7.3.3.tgz"},"main":"dist/cjs/index.cjs","type":"module","types":"dist/esm/index.d.ts","module":"dist/esm/index.js","exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/cjs/index.d.cts","default":"./dist/cjs/index.cjs"}},"./package.json":"./package.json"},"funding":"https://opencollective.com/turf","gitHead":"fa0e2da8ce02d9a82720eae922f89c9386596e04","scripts":{"docs":"tsx ../../scripts/generate-readmes.ts","test":"pnpm run /test:.*/","bench":"tsx bench.ts","build":"tsup --config ../../tsup.config.ts","test:tape":"tsx test.ts"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:0cffe401-1a9a-4b96-9644-50e66288213f"}},"repository":{"url":"git://github.com/Turfjs/turf.git","type":"git"},"_npmVersion":"lerna/9.0.3/node@v20.20.0+x64 (linux)","description":"Generates random points, lines, or polygons for testing.","directories":{},"sideEffects":false,"_nodeVersion":"20.20.0","dependencies":{"tslib":"^2.8.1","@turf/helpers":"7.3.3","@types/geojson":"^7946.0.10"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.4","glob":"^11.1.0","tape":"^5.9.0","tsup":"^8.4.0","benchmark":"^2.1.4","typescript":"^5.8.3","@types/tape":"^5.8.1","@types/benchmark":"^2.1.5"},"_npmOperationalInternal":{"tmp":"tmp/random_7.3.3_1769566707279_0.28007091644697346","host":"s3://npm-registry-packages-npm-production"},"readme":"# @turf/random\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n## randomPosition\n\nReturns a random position within a [bounding box][1].\n\n### Parameters\n\n*   `bbox` **[BBox][1]** a bounding box inside of which positions are placed. (optional, default `[-180,-90,180,90]`)\n\n### Examples\n\n```javascript\nvar position = turf.randomPosition([-180, -90, 180, 90])\n// => position\n```\n\n*   Throws **[Error][2]** if bbox is invalid\n\nReturns **[Position][3]** Position \\[longitude, latitude]\n\n## randomPoint\n\nReturns a random [point][4].\n\n### Parameters\n\n*   `count` **[number][5]** how many geometries will be generated (optional, default `1`)\n*   `options` **[Object][6]** Optional parameters (optional, default `{}`)\n\n    *   `options.bbox` **[BBox][1]** a bounding box inside of which geometries are placed. (optional, default `[-180,-90,180,90]`)\n\n### Examples\n\n```javascript\nvar points = turf.randomPoint(25, {bbox: [-180, -90, 180, 90]})\n// => points\n```\n\n*   Throws **[Error][2]** if bbox is invalid\n\nReturns **[FeatureCollection][7]<[Point][8]>** GeoJSON FeatureCollection of points\n\n## randomPolygon\n\nReturns a random [polygon][9].\n\n### Parameters\n\n*   `count` **[number][5]** how many geometries will be generated (optional, default `1`)\n*   `options` **[Object][6]** Optional parameters (optional, default `{}`)\n\n    *   `options.bbox` **[BBox][1]** a bounding box inside of which geometries are placed. (optional, default `[-180,-90,180,90]`)\n    *   `options.num_vertices` **[number][5]** is how many coordinates each LineString will contain. (optional, default `10`)\n    *   `options.max_radial_length` **[number][5]** is the maximum number of decimal degrees latitude or longitude that a\n        vertex can reach out of the center of the Polygon. (optional, default `10`)\n\n### Examples\n\n```javascript\nvar polygons = turf.randomPolygon(25, {bbox: [-180, -90, 180, 90]})\n// => polygons\n```\n\n*   Throws **[Error][2]** if bbox is invalid\n\nReturns **[FeatureCollection][7]<[Polygon][10]>** GeoJSON FeatureCollection of polygons\n\n## randomLineString\n\nReturns a random [LineString][11].\n\n### Parameters\n\n*   `count` **[number][5]** how many geometries will be generated (optional, default `1`)\n*   `options` **[Object][6]** Optional parameters (optional, default `{}`)\n\n    *   `options.bbox` **[BBox][1]** a bounding box inside of which geometries are placed. (optional, default `[-180,-90,180,90]`)\n    *   `options.num_vertices` **[number][5]** is how many coordinates each LineString will contain. (optional, default `10`)\n    *   `options.max_length` **[number][5]** is the maximum number of decimal degrees that a\n        vertex can be from its predecessor (optional, default `0.0001`)\n    *   `options.max_rotation` **[number][5]** is the maximum number of radians that a\n        line segment can turn from the previous segment. (optional, default `Math.PI/8`)\n\n### Examples\n\n```javascript\nvar lineStrings = turf.randomLineString(25, {bbox: [-180, -90, 180, 90]})\n// => lineStrings\n```\n\n*   Throws **[Error][2]** if bbox is invalid\n\nReturns **[FeatureCollection][7]<[LineString][11]>** GeoJSON FeatureCollection of linestrings\n\n[1]: https://tools.ietf.org/html/rfc7946#section-5\n\n[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Error\n\n[3]: https://developer.mozilla.org/docs/Web/API/Position\n\n[4]: point\n\n[5]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number\n\n[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\n\n[7]: https://tools.ietf.org/html/rfc7946#section-3.3\n\n[8]: https://tools.ietf.org/html/rfc7946#section-3.1.2\n\n[9]: polygon\n\n[10]: https://tools.ietf.org/html/rfc7946#section-3.1.6\n\n[11]: https://tools.ietf.org/html/rfc7946#section-3.1.4\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/random\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":1769566707438,"_cnpm_publish_time":1769566707438,"dist-tags":{"canary":"3.5.2-alpha.d2c36ee7","latest":"7.4.0","prerelease":"7.1.0-alpha.70"}}