{"id":13995392,"url":"https://github.com/malcommac/SwiftSimplify","last_synced_at":"2025-07-22T21:32:45.454Z","repository":{"id":35060962,"uuid":"39198663","full_name":"malcommac/SwiftSimplify","owner":"malcommac","description":"🥷 High-performance polyline simplification library - port of simplify.js","archived":false,"fork":false,"pushed_at":"2022-08-13T13:52:48.000Z","size":3137,"stargazers_count":300,"open_issues_count":5,"forks_count":35,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-11-24T11:05:46.720Z","etag":null,"topics":["cgpoint","cllocationcoordinate2d","polyline","polyline-algorithm","polyline-simplification","simplifyjs","swift-library"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/malcommac.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-07-16T13:34:34.000Z","updated_at":"2024-09-06T17:42:47.000Z","dependencies_parsed_at":"2022-09-18T03:14:34.931Z","dependency_job_id":null,"html_url":"https://github.com/malcommac/SwiftSimplify","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcommac%2FSwiftSimplify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcommac%2FSwiftSimplify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcommac%2FSwiftSimplify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/malcommac%2FSwiftSimplify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/malcommac","download_url":"https://codeload.github.com/malcommac/SwiftSimplify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227177934,"owners_count":17743207,"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":["cgpoint","cllocationcoordinate2d","polyline","polyline-algorithm","polyline-simplification","simplifyjs","swift-library"],"created_at":"2024-08-09T14:03:22.832Z","updated_at":"2024-11-29T17:31:38.184Z","avatar_url":"https://github.com/malcommac.png","language":"Swift","readme":"\u003cp align=\"center\" \u003e\n  \u003cimg src=\"banner.png\" width=300px alt=\"SwiftSimplify\" title=\"SwiftSimplify\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cstrong\u003eHigh-performance polyline simplification library\u003c/strong\u003e\u003c/p\u003e\n\nSwiftSimplify is a tiny high-performance Swift polyline simplification library ported from Javascript's [Simplify.js](http://mourner.github.io/simplify-js/). Original work come from [Leaflet](http://leafletjs.com/), a JS interactive maps library by [Vladimir Agafonkin](http://agafonkin.com/en).\n\nIt uses a combination of [Douglas-Peucker](http://en.wikipedia.org/wiki/Ramer-Douglas-Peucker_algorithm) and Radial Distance algorithms. Works both on browser and server platforms.\n\nPolyline simplification dramatically reduces the number of points in a polyline while retaining its shape, giving a huge performance boost when processing it and also reducing visual noise. For example, it's essential when rendering a 70k-points line chart or a map route in the browser using MapKit.\n\n![SwiftSimplify](./SwiftSimplify.gif)\n  \n## Requirements\n* iOS 8.0, watchOS 2.0, tvOS 9.0\n* Swift 5.x+\n\n## Communication\n- If you **found a bug**, open an issue.\n- If you **have a feature request**, open an issue.\n- If you **want to contribute**, submit a pull request.\n\n## Installation\nSwiftSimplify is available through [CocoaPods](http://cocoapods.org). To install\nit, simply add the following line to your Podfile:\n\n```ruby\npod \"SwiftSimplify\"\n```\n## Usage\nUsage is pretty straightforward: in fact you need just call the SwiftSimplify's class method simplify by passing your configuration:\n\n```swift\nlet allPoints: [Point2DRepresentable] = ...\nlet simplifiedPoints = SwiftSimplify.simplify(allPoints, tolerance: tolerance)\n```\n\nAllowed parameters are:\n\n* ```points```: An array of points. SwiftSimplify supports Swift's generic so you can pass an array of objects which are conforms to `Point2DRepresentable` protocol (both `CGPoint` and `CLLocationCoordinate2D` objects supports it).\n* ```tolerance```: *(1 by default)* Affects the amount of simplification (in the same metric as the point coordinates)\n* ```highQuality```: *(false by default)* Excludes distance-based preprocessing step which leads to highest quality simplification but runs ~10-20 times slower.\n\n## ❤️ Your Support\n\n*Hi fellow developer!*  \nYou know, maintaing and developing tools consumes resources and time. While I enjoy making them **your support is foundamental to allow me continue its development**.  \n\nIf you are using SwiftSimplify or any other of my creations please consider the following options:\n\n- [**Make a donation with PayPal**](https://www.paypal.com/paypalme/danielemargutti/20)\n- [**Become a Sponsor**](https://github.com/sponsors/malcommac)\n\n- [Follow Me](https://github.com/malcommac)\n\n### Installation\n\nSwiftSimplify is compatible with Swift 5.x+ under iOS (11+) and macOS platforms.  \n\nYou can install it via CocoaPods:\n\n```sh\nuse_frameworks!\npod 'SwiftSimplify'\n```\n\nor SPM in your `Package.swift`:\n\n```sh\nimport PackageDescription\n\n  let package = Package(name: \"YourPackage\",\n    dependencies: [\n      .Package(url: \"https://github.com/malcommac/SwiftSimplify.git\", majorVersion: 0),\n    ]\n  )\n```\n\n**Consider ❤️ [support the development](#support) of this library!**\n\n## Contributing\n\n- If you **need help** or you'd like to **ask a general question**, open an issue.\n- If you **found a bug**, open an issue.\n- If you **have a feature request**, open an issue.\n- If you **want to contribute**, submit a pull request.\n\n## Copyright \u0026 Acknowledgements\n\nSwiftSimplify is currently owned and maintained by Daniele Margutti.  \nYou can follow me on Twitter [@danielemargutti](http://twitter.com/danielemargutti).  \nMy web site is [https://www.danielemargutti.com](https://www.danielemargutti.com) \n\nThis software is licensed under [MIT License](LICENSE.md).\n\n***Follow me on:***  \n- 💼 [Linkedin](https://www.linkedin.com/in/danielemargutti/)  \n- 🐦 [Twitter](https://twitter.com/danielemargutti)\n","funding_links":["https://www.paypal.com/paypalme/danielemargutti/20","https://github.com/sponsors/malcommac"],"categories":["Swift"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalcommac%2FSwiftSimplify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmalcommac%2FSwiftSimplify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmalcommac%2FSwiftSimplify/lists"}