{"id":13423583,"url":"https://github.com/munterfi/flexpolyline","last_synced_at":"2025-09-21T03:31:38.052Z","repository":{"id":46017510,"uuid":"270295330","full_name":"munterfi/flexpolyline","owner":"munterfi","description":"The flexpolyline R package provides a binding to the C++ implementation of the flexible polyline encoding by HERE. The encoding is a lossy compressed representation of a list of coordinate pairs or coordinate triples. ","archived":false,"fork":false,"pushed_at":"2023-07-19T09:28:29.000Z","size":10788,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-03T19:51:09.505Z","etag":null,"topics":["gis","heremaps","polyline","polyline-decoder","polyline-encoder","rspatial","rstats"],"latest_commit_sha":null,"homepage":"https://munterfi.github.io/flexpolyline/","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/munterfi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2020-06-07T12:12:00.000Z","updated_at":"2023-11-19T03:11:23.000Z","dependencies_parsed_at":"2023-12-08T10:37:12.238Z","dependency_job_id":"92307ad7-bd0b-49f5-9e91-453af1e43f06","html_url":"https://github.com/munterfi/flexpolyline","commit_stats":{"total_commits":180,"total_committers":2,"mean_commits":90.0,"dds":"0.033333333333333326","last_synced_commit":"8b584a629ac9a4b098797bdcb0672893bc90da3e"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/munterfi/flexpolyline","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munterfi%2Fflexpolyline","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munterfi%2Fflexpolyline/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munterfi%2Fflexpolyline/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munterfi%2Fflexpolyline/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/munterfi","download_url":"https://codeload.github.com/munterfi/flexpolyline/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/munterfi%2Fflexpolyline/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276189965,"owners_count":25600291,"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-09-21T02:00:07.055Z","response_time":72,"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":["gis","heremaps","polyline","polyline-decoder","polyline-encoder","rspatial","rstats"],"created_at":"2024-07-31T00:00:38.167Z","updated_at":"2025-09-21T03:31:37.615Z","avatar_url":"https://github.com/munterfi.png","language":"C++","readme":"# Flexible Polyline Encoding for R \u003cimg src=\"man/figures/logo.png\" align=\"right\" alt=\"\" width=\"120\" /\u003e\n\n\u003c!-- badges: start --\u003e\n\n[![CRAN status](https://www.r-pkg.org/badges/version/flexpolyline)](https://CRAN.R-project.org/package=flexpolyline)\n[![CRAN checks](https://badges.cranchecks.info/worst/flexpolyline.svg)](https://cran.r-project.org/web/checks/check_results_flexpolyline.html)\n[![CRAN downloads](https://cranlogs.r-pkg.org/badges/last-month/flexpolyline?color=brightgreen)](https://CRAN.R-project.org/package=flexpolyline)\n[![R-CMD-check](https://github.com/munterfi/flexpolyline/actions/workflows/check-standard.yaml/badge.svg)](https://github.com/munterfi/flexpolyline/actions/workflows/check-standard.yaml)\n[![Codecov test coverage](https://codecov.io/gh/munterfi/flexpolyline/branch/master/graph/badge.svg)](https://app.codecov.io/gh/munterfi/flexpolyline?branch=master)\n[![CodeFactor](https://www.codefactor.io/repository/github/munterfi/flexpolyline/badge)](https://www.codefactor.io/repository/github/munterfi/flexpolyline)\n\n\u003c!-- badges: end --\u003e\n\nThe **flexpolyline** R package provides a binding to the\n[C++ implementation](https://github.com/heremaps/flexible-polyline/tree/master/cpp) of the\nflexible polyline encoding by [HERE](https://github.com/heremaps/flexible-polyline).\nThe flexible polyline encoding is a lossy compressed representation of a list of\ncoordinate pairs or coordinate triples. The encoding is achieved by:\n(1) Reducing the decimal digits of each value;\n(2) encoding only the offset from the previous point;\n(3) using variable length for each coordinate delta; and\n(4) using 64 URL-safe characters to display the result.\nThe flexible polyline encoding is a variant of the [Encoded Polyline Algorithm Format](https://developers.google.com/maps/documentation/utilities/polylinealgorithm) by Google.\n\n**Note:**\n\n- The order of the coordinates (lng, lat) does not correspond to the original\n  C++ implementation (lat, lng). This enables direct conversion to **sf**\n  objects, without reordering the columns.\n- The encoding is lossy, this means the encoding process could reduce the\n  precision of your data.\n\n## Installation\n\nInstall the released version of **flexpolyline** from [CRAN](https://CRAN.R-project.org/package=flexpolyline):\n\n```r\ninstall.packages(\"flexpolyline\")\n```\n\nTo install the development version from [GitHub](https://github.com/munterfi/flexpolyline):\n\n```r\nremotes::install_github(\"munterfi/flexpolyline\")\n```\n\n## C++ binding\n\nEncoding and decoding in R is straight forward by using `encode()` and\n`decode()`. These functions are binding to the flexpolyline C++ implementation\nand reflect the arguments and return values of their counterparts\n(`hf::flexpolyline::polyline_encode` and `hf::flexpolyline::polyline_decode`):\n\n```r\nline \u003c- matrix(\n  c(8.69821, 50.10228, 10,\n    8.69567, 50.10201, 20,\n    8.69150, 50.10063, 30,\n    8.68752, 50.09878, 40),\n  ncol = 3, byrow = TRUE\n)\n\nencode(line)\n\ndecode(\"BlBoz5xJ67i1BU1B7PUzIhaUxL7YU\")\n```\n\n## Simple feature support\n\nThe **flexpolyline** package integrates with the popular\n[sf](https://CRAN.R-project.org/package=sf) package for working with spatial\ndata in R, which is built on the concept of simple features. The package\nprovides additional functions for encoding and decoding sf objects directly:\n\n```r\nsfg \u003c- sf::st_linestring(line, dim = \"XYZ\")\n\nencode_sf(sfg)\n\ndecode_sf(\"BlBoz5xJ67i1BU1B7PUzIhaUxL7YU\")\n```\n\n## Contributing\n\n- Contributions to this package are welcome, issues and pull requests are the\n  preferred ways to share them. Please see the [Contribution Guidelines](https://github.com/munterfi/flexpolyline/blob/master/.github/CONTRIBUTING.md).\n- This project is released with a [Contributor Code of Conduct](https://github.com/munterfi/flexpolyline/blob/master/.github/CODE_OF_CONDUCT.md).\n  By participating in this project you agree to abide by its terms.\n\n## References\n\n- [Flexible Polyline Encoding by HERE](https://github.com/heremaps/flexible-polyline)\n- [Encoded Polyline Algorithm Format](https://developers.google.com/maps/documentation/utilities/polylinealgorithm)\n- [Simple Features for R](https://CRAN.R-project.org/package=sf)\n- Inspired by the [googlePolylines](https://github.com/SymbolixAU/googlePolylines) package\n\n## License\n\nThe **flexpolyline** R package is licensed under GNU GPL v3.0. The C++\nimplementation by HERE Europe B.V. is licensed under MIT.\n","funding_links":[],"categories":["C++"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmunterfi%2Fflexpolyline","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmunterfi%2Fflexpolyline","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmunterfi%2Fflexpolyline/lists"}