{"id":16125666,"url":"https://github.com/dy/polyline-clean","last_synced_at":"2025-04-14T23:54:03.805Z","repository":{"id":57327083,"uuid":"131088302","full_name":"dy/polyline-clean","owner":"dy","description":"Clean polygon or polyline coordinates: remove duplicates, degenerate, collinear or bad items, trim.","archived":false,"fork":false,"pushed_at":"2018-04-27T00:57:31.000Z","size":14,"stargazers_count":2,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-14T23:53:46.121Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dy.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-04-26T02:22:12.000Z","updated_at":"2019-07-23T18:58:33.000Z","dependencies_parsed_at":"2022-09-13T19:21:48.930Z","dependency_job_id":null,"html_url":"https://github.com/dy/polyline-clean","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fpolyline-clean","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fpolyline-clean/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fpolyline-clean/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dy%2Fpolyline-clean/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dy","download_url":"https://codeload.github.com/dy/polyline-clean/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248981261,"owners_count":21193144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-09T21:30:32.390Z","updated_at":"2025-04-14T23:54:03.780Z","avatar_url":"https://github.com/dy.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# polyline-clean [![experimental](https://img.shields.io/badge/stability-unstable-green.svg)](http://github.com/badges/stability-badges) [![Build Status](https://travis-ci.org/dy/polyline-clean.png)](https://travis-ci.org/dy/polyline-clean)\n\nClean polyline or polygon data: remove duplicate, collinear, null points, etc.\n\n[![npm install polyline-clean](https://nodei.co/npm/polyline-clean.png?mini=true)](https://npmjs.org/package/polyline-clean/)\n\n```js\nconst c = require('polyline-clean')\n\n// remove duplicate, degenerate or collinear segments\nc([[0,0], [null,null], [1,1], [1,1], [.5,.5], [1,1], [3,3]])\n// === [[0,0], [3,3]]\n```\n\n## `c(coordinates, options?)`\n\nReturn new coordinates array with bad points removed. If result is degenerate, `null` will be returned.\n\nOption | Meaning\n---|---\n`ids` | Return indexes in the initial array instead of points.\n`fold` | Collapse collinear segments. Can be a number indicating min angle threshold. `polygon` mode has more rigid folding. Useful to disable it when data has logarithmic fashion.\n`polygon` | Apply polygon optimizations: remove coinciding end, collinear end segments, ignore degenerate results.\n\n## Related\n\n* [parse-poly](https://github.com/dy/parse-poly) − parse any polygon/polyline format and return list of coordinates.\n* [simplify-path](https://www.npmjs.com/package/simplify-path) − simplify polyline with tolerance.\n\n## License\n\n(c) 2018 Dmitry Yv. MIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdy%2Fpolyline-clean","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdy%2Fpolyline-clean","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdy%2Fpolyline-clean/lists"}