{"id":27159456,"url":"https://github.com/kinkard/polyline-iter","last_synced_at":"2025-08-18T10:17:01.324Z","repository":{"id":269307600,"uuid":"906979216","full_name":"kinkard/polyline-iter","owner":"kinkard","description":"Zero-dependency polyline format decoding without hidden allocations","archived":false,"fork":false,"pushed_at":"2025-05-28T10:29:31.000Z","size":105,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-02T19:20:31.413Z","etag":null,"topics":["geospatial","maps","polyline"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kinkard.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-12-22T13:32:04.000Z","updated_at":"2025-05-28T10:29:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"dc024748-2113-4080-8ca3-334e8bffe19b","html_url":"https://github.com/kinkard/polyline-iter","commit_stats":null,"previous_names":["kinkard/polyline-iter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kinkard/polyline-iter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinkard%2Fpolyline-iter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinkard%2Fpolyline-iter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinkard%2Fpolyline-iter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinkard%2Fpolyline-iter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kinkard","download_url":"https://codeload.github.com/kinkard/polyline-iter/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kinkard%2Fpolyline-iter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270977626,"owners_count":24678740,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["geospatial","maps","polyline"],"created_at":"2025-04-08T22:51:55.828Z","updated_at":"2025-08-18T10:17:01.272Z","avatar_url":"https://github.com/kinkard.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# About\n\nZero-dependency Rust crate for encoding and decoding [Google's polyline format](https://developers.google.com/maps/documentation/utilities/polylinealgorithm).\n\nCompared to the [georust/polyline](https://github.com/georust/polyline) crate, the `polyline-iter` decodes polyline into an iterator over points instead of vector, which is benefitial when only a single iteration over the polyline is needed. And in such cases it performs twice as fast as the `georust/polyline` crate (check `cargo bench` for exact numbers) and has no hidden allocations.\n\n## Usage\n\nAdd this to your `Cargo.toml`:\n\n```toml\n[dependencies]\npolyline-iter = \"0.3\"\n```\n\n## Example\n\n```rust\nuse polyline_iter::PolylineIter;\n\nlet iter = PolylineIter::new(6, \"avs_iB}xlxWissBw|zEu``AsxgCyoaAm_z@\");\nassert_eq!(\n    iter.collect::\u003cVec\u003c_\u003e\u003e(),\n    vec![\n        (55.585137, 12.999583),\n        (55.644854, 13.112187),\n        (55.678161, 13.182229),\n        (55.712222, 13.212444),\n    ]\n);\n\n// If the points are not needed, the iterator can be used directly\nassert_eq!(PolylineIter::new(5, \"avs_iB}xlxWissBw|zEu``AsxgCyoaAm_z@\").count(), 4);\n\n// Iterator approach allows to transcode polyline to another precision without intermediate allocations.\nlet polyline5 = polyline_iter::encode(5, PolylineIter::new(6, \"avs_iB}xlxWissBw|zEu``AsxgCyoaAm_z@\"));\nassert_eq!(polyline5, \"cngrIk~inAgtJw~TeoEwtL{sE{{D\");\nassert_eq!(\n    PolylineIter::new(5, \u0026polyline5).collect::\u003cVec\u003c_\u003e\u003e(),\n    vec![\n        (55.58514, 12.99958),\n        (55.64486, 13.11218),\n        (55.67817, 13.18222),\n        (55.71223, 13.21244)\n    ],\n);\n\n// Keeping all the power of working with slices\nlet points = vec![\n    (55.58513, 12.99958),\n    (55.61461, 13.04627),\n    (55.64485, 13.11219),\n    (55.67816, 13.18223),\n    (55.71840, 13.22343),\n];\nassert_eq!(polyline_iter::encode(5, points[1..3].iter().copied()), \"ifmrIebsnA_|D_{K\");\n```\n\n## License\n\nAll code in this project is dual-licensed under either:\n\n- [MIT license](https://opensource.org/licenses/MIT) ([`LICENSE-MIT`](LICENSE-MIT))\n- [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) ([`LICENSE-APACHE`](LICENSE-APACHE))\n\nat your option.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinkard%2Fpolyline-iter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkinkard%2Fpolyline-iter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkinkard%2Fpolyline-iter/lists"}