{"name":"@turf/moran-index","version":"7.3.3","keywords":["turf","moran-index"],"author":{"name":"Turf Authors"},"license":"MIT","_id":"@turf/moran-index@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"}],"contributors":[{"name":"Haoming Zhuang","email":"@zhuang-hao-ming"}],"homepage":"https://github.com/Turfjs/turf","bugs":{"url":"https://github.com/Turfjs/turf/issues"},"dist":{"shasum":"3906a07aace240c9fea7909edc175d40edab573f","tarball":"http://registry-npm.ywwl.com/@turf/moran-index/download/@turf/moran-index-7.3.3.tgz","fileCount":9,"integrity":"sha512-vL9nDje9nTNBw0bF0GOvDxxpGXaOzve6ivm3QNJsArZXWM3W/whZtOKZrvfmx39Fz+2Tj7RmxdLaFwGkPNSSOA==","signatures":[{"sig":"MEYCIQC69jBt1KZE3oGDdkcgbroBWBHkULlZmgoVFgvy788N7gIhAKMZN9WnbCsSdUyRup0zvihuYbOWo2tcUAzNXB423fw3","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@turf%2fmoran-index@7.3.3","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":30127,"size":6522,"noattachment":false,"key":"/@turf/moran-index/-/@turf/moran-index-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:8a8fc980-2888-4e98-ad40-be573331b427"}},"repository":{"url":"git://github.com/Turfjs/turf.git","type":"git"},"_npmVersion":"lerna/9.0.3/node@v20.20.0+x64 (linux)","description":"Measures patterns of attribute values associated with features. Reveals whether similar values tend to occur near each other, or whether high or low values are interspersed","directories":{},"sideEffects":false,"_nodeVersion":"20.20.0","dependencies":{"tslib":"^2.8.1","@turf/meta":"7.3.3","@turf/helpers":"7.3.3","@types/geojson":"^7946.0.10","@turf/distance-weight":"7.3.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.19.4","tape":"^5.9.0","tsup":"^8.4.0","benchmark":"^2.1.4","typescript":"^5.8.3","@types/tape":"^5.8.1","load-json-file":"^7.0.1","write-json-file":"^6.0.0","@types/benchmark":"^2.1.5"},"_npmOperationalInternal":{"tmp":"tmp/moran-index_7.3.3_1769566748614_0.984801405531798","host":"s3://npm-registry-packages-npm-production"},"readme":"# @turf/moran-index\n\n<!-- Generated by documentation.js. Update this documentation by updating the source code. -->\n\n## MoranIndex\n\nType: [object][1]\n\n### Properties\n\n*   `moranIndex` **[number][2]** the moran's Index of the observed feature set\n*   `expectedMoranIndex` **[number][2]** the moran's Index of the random distribution\n*   `stdNorm` **[number][2]** the standard devitaion of the random distribution\n*   `zNorm` **[number][2]** the z-score of the observe samples with regard to the random distribution\n\n## moranIndex\n\nMoran's I measures patterns of attribute values associated with features.\nThe method reveal whether similar values tend to occur near each other,\nor whether high or low values are interspersed.\n\nMoran's I > 0 means a clusterd pattern.\nMoran's I < 0 means a dispersed pattern.\nMoran's I = 0 means a random pattern.\n\nIn order to test the significance of the result. The z score is calculated.\nA positive enough z-score (ex. >1.96) indicates clustering,\nwhile a negative enough z-score (ex. <-1.96) indicates a dispersed pattern.\n\nthe z-score can be calculated based on a normal or random assumption.\n\n**Bibliography**\\*\n\n1.  [Moran's I][3]\n\n2.  [pysal][4]\n\n3.  Andy Mitchell, The ESRI Guide to GIS Analysis Volume 2: Spatial Measurements & Statistics.\n\n### Parameters\n\n*   `fc` **[FeatureCollection][5]\\<any>**&#x20;\n*   `options` **[Object][1]**&#x20;\n\n    *   `options.inputField` **[string][6]** the property name, must contain numeric values\n    *   `options.threshold` **[number][2]** the distance threshold (optional, default `100000`)\n    *   `options.p` **[number][2]** the Minkowski p-norm distance parameter (optional, default `2`)\n    *   `options.binary` **[boolean][7]** whether transfrom the distance to binary (optional, default `false`)\n    *   `options.alpha` **[number][2]** the distance decay parameter (optional, default `-1`)\n    *   `options.standardization` **[boolean][7]** wheter row standardization the distance (optional, default `true`)\n\n### Examples\n\n```javascript\nconst bbox = [-65, 40, -63, 42];\nconst dataset = turf.randomPoint(100, { bbox: bbox });\n\nconst result = turf.moranIndex(dataset, {\n  inputField: 'CRIME',\n});\n```\n\nReturns **[MoranIndex][8]**&#x20;\n\n[1]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object\n\n[2]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number\n\n[3]: https://en.wikipedia.org/wiki/Moran%27s_I\n\n[4]: http://pysal.readthedocs.io/en/latest/index.html\n\n[5]: https://tools.ietf.org/html/rfc7946#section-3.3\n\n[6]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String\n\n[7]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean\n\n[8]: #moranindex\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/moran-index\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":1769566748759,"_cnpm_publish_time":1769566748759,"dist-tags":{"latest":"7.4.0","prerelease":"7.1.0-alpha.70"}}