{"id":22713583,"url":"https://github.com/program--/hilbert","last_synced_at":"2025-04-13T17:36:11.357Z","repository":{"id":107794126,"uuid":"468032867","full_name":"program--/hilbert","owner":"program--","description":"R :package: for Hilbert Curve indexing of coordinates","archived":false,"fork":false,"pushed_at":"2022-04-08T15:31:34.000Z","size":1628,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-13T09:06:46.840Z","etag":null,"topics":["hilbert-curve","r","spatial"],"latest_commit_sha":null,"homepage":"https://hilbert.justinsingh.me","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/program--.png","metadata":{"files":{"readme":"README.Rmd","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,"governance":null}},"created_at":"2022-03-09T17:43:48.000Z","updated_at":"2025-03-22T10:38:40.000Z","dependencies_parsed_at":"2023-04-27T11:02:13.876Z","dependency_job_id":null,"html_url":"https://github.com/program--/hilbert","commit_stats":{"total_commits":34,"total_committers":1,"mean_commits":34.0,"dds":0.0,"last_synced_commit":"d621e0497c6947d75a277a7f55ac510117df41be"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2Fhilbert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2Fhilbert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2Fhilbert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/program--%2Fhilbert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/program--","download_url":"https://codeload.github.com/program--/hilbert/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248753151,"owners_count":21156220,"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":["hilbert-curve","r","spatial"],"created_at":"2024-12-10T14:09:35.919Z","updated_at":"2025-04-13T17:36:11.335Z","avatar_url":"https://github.com/program--.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n\u003c!-- README.md is generated from README.Rmd. Please edit that file --\u003e\n\n```{r, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\u003e\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n```\n\n# hilbert\n\n\u003c!-- badges: start --\u003e\n[![CRAN status](https://www.r-pkg.org/badges/version/hilbert)](https://CRAN.R-project.org/package=hilbert)\n[![Codecov test coverage](https://codecov.io/gh/program--/hilbert/branch/main/graph/badge.svg)](https://app.codecov.io/gh/program--/hilbert?branch=main)\n[![R-CMD-check](https://github.com/program--/hilbert/workflows/R-CMD-check/badge.svg)](https://github.com/program--/hilbert/actions)\n[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\u003c!-- badges: end --\u003e\n\n**hilbert** provides utilities for quick indexing/encoding of coordinates to a Hilbert Curve.\n\n## Installation\n\nYou can install **hilbert** via either `remotes` or `pak`:\n\n``` r\n# pak\npak::pkg_install(\"program--/hilbert\")\n\n# remotes\nremotes::install_github(\"program--/hilbert\")\n```\n\n## Example\n\n### Setting Up\n```{r setup}\nx \u003c- -77.85641\ny \u003c- 34.35935\nn \u003c- 24 # n \u003e 15 requires `bit64`\ne \u003c- c(xmax = 180, xmin = -180, ymax = 90, ymin = -90)\n```\n\n### Coordinates to Position\n```{r coords2pos}\npos \u003c- hilbert::coords_to_position(x, y, n = n, extent = e)\npos\n```\n\n### Position to Index\n```{r pos2index}\nindex \u003c- hilbert::index(pos, coords = c(\"x\", \"y\"), n = n, attach = TRUE)\nindex\n```\n\n### Index to Position\n```{r index2pos}\nnew_pos \u003c- hilbert::position(index, idx = \"h\", n = n, attach = FALSE)\nnew_pos\n```\n\n### Position to Coordinates\n```{r pos2coords}\nnew_xy \u003c- hilbert::position_to_coords(new_pos, coords = c(\"x\", \"y\"), extent = e, n = n, attach = TRUE)\nnew_xy\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogram--%2Fhilbert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprogram--%2Fhilbert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprogram--%2Fhilbert/lists"}