{"_id":"@mapbox/geojson-tidy","_rev":"278-e694f0575e38a04b8e24a4436751ee6a","name":"@mapbox/geojson-tidy","description":"tidy up a geojson input by filtering out noisy point clusters","dist-tags":{"latest":"2.0.0","rc":"2.0.0-rc"},"versions":{"1.0.1":{"name":"@mapbox/geojson-tidy","version":"1.0.1","keywords":["geojson","tidy","noise","filter"],"author":{"name":"Arun Ganesh"},"license":"MIT","_id":"@mapbox/geojson-tidy@1.0.1","maintainers":[{"name":"tmcw","email":"tom@macwright.org"}],"homepage":"https://github.com/mapbox/geojson-tidy#readme","bugs":{"url":"https://github.com/mapbox/geojson-tidy/issues"},"dist":{"shasum":"3477c241920cdc8199929204e9abfc35d3c4103b","tarball":"https://registry.npmjs.org/@mapbox/geojson-tidy/-/geojson-tidy-1.0.1.tgz","integrity":"sha512-T46Is9ndGVqkM57rpUFQHF/etUalrHBEW6p7TwGxQd+a6X67UiNxzJnQenEU9usdUebvQD70W4IF0wRbaP2W3Q==","signatures":[{"sig":"MEQCICPw5ULsnoLMqanx7f9slpDE7JpUGPdOYN9/tqbloX3GAiBi3cbsFau+jrhgnwgen4hqN3r3pfV7VuSLiR24QvPLcA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"geojson-tidy.js","_from":".","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"_shasum":"3477c241920cdc8199929204e9abfc35d3c4103b","gitHead":"f2eaec40df6d5fa71aacd06d99f0429e54a43db0","scripts":{"test":"tape test/test.js","build":"mkdir -p dist && browserify -s tidy geojson-tidy.js > dist/geojson-tidy.js && uglifyjs dist/geojson-tidy.js -c -m > dist/geojson-tidy.min.js"},"_npmUser":{"name":"tmcw","email":"tom@macwright.org"},"repository":{"url":"git+ssh://git@github.com/mapbox/geojson-tidy.git","type":"git"},"_npmVersion":"3.10.10","description":"tidy up a geojson input by filtering out noisy point clusters","directories":{"test":"test"},"_nodeVersion":"7.2.1","dependencies":{"minimist":"^1.1.1","haversine":"^1.0.0"},"devDependencies":{"tape":"^4.0.0","uglify-js":"2.7.5","browserify":"13.1.1","cz-conventional-changelog":"^1.2.0"},"_npmOperationalInternal":{"tmp":"tmp/geojson-tidy-1.0.1.tgz_1482426288360_0.1889868804719299","host":"packages-18-east.internal.npmjs.com"}},"2.0.0-rc":{"name":"@mapbox/geojson-tidy","version":"2.0.0-rc","keywords":["geojson","tidy","noise","filter"],"author":{"name":"Arun Ganesh"},"license":"MIT","_id":"@mapbox/geojson-tidy@2.0.0-rc","maintainers":[{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"homepage":"https://github.com/mapbox/geojson-tidy#readme","bugs":{"url":"https://github.com/mapbox/geojson-tidy/issues"},"dist":{"shasum":"6663d5bc4aea7d7ce7d1bfbe4b64d2894e1ba29f","tarball":"https://registry.npmjs.org/@mapbox/geojson-tidy/-/geojson-tidy-2.0.0-rc.tgz","fileCount":14,"integrity":"sha512-wIUj2v03ho1h6aKp0xtOeNwhvlvl/tlrNP7Jnl8r1HJROLvoBF645JEFCFasCILmav6/9PWPvAy7jBUY/NDhEw==","signatures":[{"sig":"MEUCIDcMLRwdRUOG+O0AN1HNaXFKvHY5cMeJ4ovWR23cGoKdAiEA7mZD1K595dj1F/Nkd6NX0l+xZSLLk6sA18ZF7C1NQ+o=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":114161},"main":"geojson-tidy.js","config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"readme":"[![Build Status](https://travis-ci.org/mapbox/geojson-tidy.png)](https://travis-ci.org/mapbox/geojson-tidy)\n\n# geojson-tidy\n\nCreate a tidy geojson by resmapling points in the feature based on sampling time and distance. Handy when geometries that have been converted from a noisy GPS/GPX output.\n- Set a minimum  sampling time between successive points (Default: 5 seconds)\n- Set a minimum distance between successive points (Default: 10 metres)\n- Set a maximum feature length to split long segments (Default: 100 points)\n\n![untitled](https://cloud.githubusercontent.com/assets/126868/8111925/96012394-1032-11e5-9e9e-069746f4dcc9.gif)\n\n### install\n\n    npm install @mapbox/geojson-tidy\n\n### usage\n\n```js\nvar geojsonTidy = require('@mapbox/geojson-tidy');\n\nvar tidyLineString = geojsonTidy.tidy(obj, [options]);\n```\n\n### Input\nAny geojson file from [togeojson](https://github.com/mapbox/togeojson) is a valid input for geojson-tidy. Only LineString features are processed currently.\n\nThe timestamp array for the trackpoints need to be stored stored in `features[].properties.coordTimes[]`.\nTimestamps can either be JavaScript numeric [Time Values](http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.1)\n(milliseconds since epoch) or strings in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\n### Output\nThe default output is a geojson `FeatureCollection` with the timestamps stored in the `cordTimes[]` property. All other properties are stripped out.\n\n```\n{\n    \"type\": \"FeatureCollection\",\n    \"features\": [\n        {\n            \"type\": \"Feature\",\n            \"properties\": {\n                \"coordTimes\": []\n            },\n            \"geometry\": {\n                \"type\": \"LineString\",\n                \"coordinates\": []\n            }\n        }\n    ]\n}\n```\n\n## API\n\n### `geojsonTidy.tidy(obj, [options])`\n\nGiven a geojson object, return contains a tidy geometry with extra points filtered out based on default settings\n\n### options\n\nAllows you to set custom values for the filter\n\n```js\n{\n    minimumDistance: 10, // Minimum distance between points in metres\n    minimumTime: 5,      // Minimum time interval between points in seconds\n    maximumPoints: 100   // Maximum points in a feature\n}\n```\n\n## CLI\n```\n./geojson-tidy -h\nUsage: geojson-tidy [-d minimum distance between points] [-t minimum sample time between points] [-m maximum number of points in a single line feature] FILE\nFILE is any valid geojson file generated by togeojson\ngeojson-tidy returns a stingified gejosn FeatureCollection\nExample: ./geojson-tidy test/walk-1.json -d 10 -t 5 -m 100 > output.json\n```\n\n## Algorithm\n1. Read a geojson FeatureCollection\n2. Loop through the features for LineString features\n3. Compare successive coordinates of the feature\n4. If the dinstance between the points or timestamp difference is too small, delete it\n5. Write a tidied geojson FeatureCollection with reduced points\n\n\n## Development\n\n### Build with Browserify\n\nTo run this project in the browser, you first need to build it with [browserify](http://browserify.org/):\n\n```sh\ngit clone git@github.com:mapbox/geojson-tidy.git\n\ncd geojson-tidy\n\n# to run tests\nnpm install\n\n# to build geojson-tidy\nnpm run build\n```\n\n`geojson-tidy.js` and `geojson-tidy.min.js` are **built files** generated\nfrom `geojson-tidy.js` by `browserify`. If you find an issue, it either needs to be\nfixed in `index.js`, or in one of the libraries mapbox-mapmatch uses\nto parse formats.\n","gitHead":"3e158b234f6b0a768a7279749c9e3db9c34a2ccb","scripts":{"test":"tape test/test.js","build":"mkdir -p dist && browserify -s tidy geojson-tidy.js > dist/geojson-tidy.js && uglifyjs dist/geojson-tidy.js -c -m > dist/geojson-tidy.min.js"},"_npmUser":{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},"repository":{"url":"git+ssh://git@github.com/mapbox/geojson-tidy.git","type":"git"},"_npmVersion":"10.2.4","description":"tidy up a geojson input by filtering out noisy point clusters","directories":{"test":"test"},"_nodeVersion":"21.6.2","dependencies":{"minimist":"^1.1.1","haversine":"^1.0.0"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"tape":"^4.0.0","uglify-js":"2.7.5","browserify":"13.1.1","cz-conventional-changelog":"^1.2.0"},"_npmOperationalInternal":{"tmp":"tmp/geojson-tidy_2.0.0-rc_1714039111871_0.5944890234092348","host":"s3://npm-registry-packages"}},"2.0.0":{"name":"@mapbox/geojson-tidy","version":"2.0.0","description":"tidy up a geojson input by filtering out noisy point clusters","main":"geojson-tidy.js","directories":{"test":"test"},"repository":{"type":"git","url":"git+ssh://git@github.com/mapbox/geojson-tidy.git"},"scripts":{"test":"tape test/test.js","build":"mkdir -p dist && browserify -s tidy geojson-tidy.js > dist/geojson-tidy.js && uglifyjs dist/geojson-tidy.js -c -m > dist/geojson-tidy.min.js"},"keywords":["geojson","tidy","noise","filter"],"author":{"name":"Arun Ganesh"},"license":"MIT","dependencies":{"haversine":"^1.0.0","minimist":"^1.1.1"},"devDependencies":{"browserify":"13.1.1","cz-conventional-changelog":"^1.2.0","tape":"^4.0.0","uglify-js":"2.7.5"},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}},"gitHead":"30d94d91e8a6d55695ece6da739ac7c76b647d08","bugs":{"url":"https://github.com/mapbox/geojson-tidy/issues"},"homepage":"https://github.com/mapbox/geojson-tidy#readme","_id":"@mapbox/geojson-tidy@2.0.0","_nodeVersion":"18.17.1","_npmVersion":"9.6.7","dist":{"integrity":"sha512-qvRQFBOn/SIj6yrxKGyTRl51s+39jV4txcEO3FqTd8Htaqn8Ese58pzjkJTfMTPKOAA4bSev09CqPueJorhUuA==","shasum":"04370db94546d3c460cc7854bb7fb814fe971ef1","tarball":"https://registry.npmjs.org/@mapbox/geojson-tidy/-/geojson-tidy-2.0.0.tgz","fileCount":15,"unpackedSize":114185,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGMIe+UFbJOpsgibnqjTIG/AV0b8BfL/tDMeepJMZUOQAiB99Jy1F6JAim2D2zdLw0wSDGbuuWiUiI7/yMCGs8TguA=="}]},"_npmUser":{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},"maintainers":[{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/geojson-tidy_2.0.0_1718011871865_0.9736617870801179"},"_hasShrinkwrap":false}},"time":{"created":"2016-12-22T17:04:49.082Z","modified":"2024-06-10T09:31:12.658Z","1.0.1":"2016-12-22T17:04:49.082Z","2.0.0-rc":"2024-04-25T09:58:32.029Z","2.0.0":"2024-06-10T09:31:12.033Z"},"maintainers":[{"name":"mbx-npm-ci-production","email":"yannick.meeus+npm+production+ci@mapbox.com"},{"name":"mbx-npm-ci-staging","email":"yannick.meeus+npm+staging+ci@mapbox.com"},{"name":"mbx-npm-advanced-actions-production","email":"yannick.meeus+npm+prod+advanced+actions@mapbox.com"},{"name":"mbx-npm-advanced-actions-staging","email":"yannick.meeus+npm+staging+advanced+actions@mapbox.com"},{"name":"mbx-npm-09-production","email":"yannick.meeus+npm+prod+09@mapbox.com"},{"name":"mbx-npm-08-production","email":"yannick.meeus+npm+prod+08@mapbox.com"},{"name":"mbx-npm-07-production","email":"yannick.meeus+npm+prod+07@mapbox.com"},{"name":"mbx-npm-06-production","email":"yannick.meeus+npm+prod+06@mapbox.com"},{"name":"mbx-npm-05-production","email":"yannick.meeus+npm+prod+05@mapbox.com"},{"name":"mbx-npm-04-production","email":"yannick.meeus+npm+prod+04@mapbox.com"},{"name":"mbx-npm-03-production","email":"yannick.meeus+npm+prod+03@mapbox.com"},{"name":"mbx-npm-02-production","email":"yannick.meeus+npm+prod+02@mapbox.com"},{"name":"mbx-npm-01-production","email":"yannick.meeus+npm+prod+01@mapbox.com"},{"name":"mbx-npm-02-staging","email":"yannick.meeus@mapbox.com"},{"name":"mapbox-npm-01","email":"accounts+npmjs-01@mapbox.com"},{"name":"mapbox-npm-02","email":"accounts+npmjs-02@mapbox.com"},{"name":"mapbox-npm-07","email":"accounts+npmjs-07@mapbox.com"},{"name":"mapbox-npm-03","email":"accounts+npmjs-03@mapbox.com"},{"name":"mapbox-npm-04","email":"accounts+npmjs-04@mapbox.com"},{"name":"mapbox-npm-09","email":"accounts+npmjs-09@mapbox.com"},{"name":"mapbox-npm-05","email":"accounts+npmjs-05@mapbox.com"},{"name":"mapbox-npm-06","email":"accounts+npmjs-06@mapbox.com"},{"name":"mapbox-npm-08","email":"accounts+npmjs-08@mapbox.com"},{"name":"mapbox-npm-advanced-actions","email":"accounts+npmjs-advanced-actions@mapbox.com"},{"name":"mapbox-npm-ci","email":"accounts+npmjs-npm-ci@mapbox.com"},{"name":"mapbox-npm","email":"accounts+npmjs@mapbox.com"},{"name":"mapbox-admin","email":"accounts@mapbox.com"},{"name":"mapbox-machine-user","email":"accounts+npm-mapbox-machine-user@mapbox.com"}],"author":{"name":"Arun Ganesh"},"repository":{"type":"git","url":"git+ssh://git@github.com/mapbox/geojson-tidy.git"},"keywords":["geojson","tidy","noise","filter"],"license":"MIT","homepage":"https://github.com/mapbox/geojson-tidy#readme","bugs":{"url":"https://github.com/mapbox/geojson-tidy/issues"},"readme":"[![Build Status](https://travis-ci.org/mapbox/geojson-tidy.png)](https://travis-ci.org/mapbox/geojson-tidy)\n\n# geojson-tidy\n\nCreate a tidy geojson by resmapling points in the feature based on sampling time and distance. Handy when geometries that have been converted from a noisy GPS/GPX output.\n- Set a minimum  sampling time between successive points (Default: 5 seconds)\n- Set a minimum distance between successive points (Default: 10 metres)\n- Set a maximum feature length to split long segments (Default: 100 points)\n\n![untitled](https://cloud.githubusercontent.com/assets/126868/8111925/96012394-1032-11e5-9e9e-069746f4dcc9.gif)\n\n### install\n\n    npm install @mapbox/geojson-tidy\n\n### usage\n\n```js\nvar geojsonTidy = require('@mapbox/geojson-tidy');\n\nvar tidyLineString = geojsonTidy.tidy(obj, [options]);\n```\n\n### Input\nAny geojson file from [togeojson](https://github.com/mapbox/togeojson) is a valid input for geojson-tidy. Only LineString features are processed currently.\n\nThe timestamp array for the trackpoints need to be stored stored in `features[].properties.coordTimes[]`.\nTimestamps can either be JavaScript numeric [Time Values](http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.1)\n(milliseconds since epoch) or strings in the [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) format.\n\n### Output\nThe default output is a geojson `FeatureCollection` with the timestamps stored in the `cordTimes[]` property. All other properties are stripped out.\n\n```\n{\n    \"type\": \"FeatureCollection\",\n    \"features\": [\n        {\n            \"type\": \"Feature\",\n            \"properties\": {\n                \"coordTimes\": []\n            },\n            \"geometry\": {\n                \"type\": \"LineString\",\n                \"coordinates\": []\n            }\n        }\n    ]\n}\n```\n\n## API\n\n### `geojsonTidy.tidy(obj, [options])`\n\nGiven a geojson object, return contains a tidy geometry with extra points filtered out based on default settings\n\n### options\n\nAllows you to set custom values for the filter\n\n```js\n{\n    minimumDistance: 10, // Minimum distance between points in metres\n    minimumTime: 5,      // Minimum time interval between points in seconds\n    maximumPoints: 100   // Maximum points in a feature\n}\n```\n\n## CLI\n```\n./geojson-tidy -h\nUsage: geojson-tidy [-d minimum distance between points] [-t minimum sample time between points] [-m maximum number of points in a single line feature] FILE\nFILE is any valid geojson file generated by togeojson\ngeojson-tidy returns a stingified gejosn FeatureCollection\nExample: ./geojson-tidy test/walk-1.json -d 10 -t 5 -m 100 > output.json\n```\n\n## Algorithm\n1. Read a geojson FeatureCollection\n2. Loop through the features for LineString features\n3. Compare successive coordinates of the feature\n4. If the dinstance between the points or timestamp difference is too small, delete it\n5. Write a tidied geojson FeatureCollection with reduced points\n\n\n## Development\n\n### Build with Browserify\n\nTo run this project in the browser, you first need to build it with [browserify](http://browserify.org/):\n\n```sh\ngit clone git@github.com:mapbox/geojson-tidy.git\n\ncd geojson-tidy\n\n# to run tests\nnpm install\n\n# to build geojson-tidy\nnpm run build\n```\n\n`geojson-tidy.js` and `geojson-tidy.min.js` are **built files** generated\nfrom `geojson-tidy.js` by `browserify`. If you find an issue, it either needs to be\nfixed in `index.js`, or in one of the libraries mapbox-mapmatch uses\nto parse formats.\n","readmeFilename":"README.md","users":{"labithiotis":true}}