{"id":18722605,"url":"https://github.com/mdsumner/llbox","last_synced_at":"2025-10-10T10:09:51.719Z","repository":{"id":72211601,"uuid":"431721344","full_name":"mdsumner/llbox","owner":"mdsumner","description":null,"archived":false,"fork":false,"pushed_at":"2021-11-29T05:10:35.000Z","size":72,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-19T16:13:27.581Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mdsumner.png","metadata":{"files":{"readme":"README.Rmd","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2021-11-25T05:10:55.000Z","updated_at":"2023-06-08T06:25:51.000Z","dependencies_parsed_at":"2023-02-24T05:30:49.700Z","dependency_job_id":null,"html_url":"https://github.com/mdsumner/llbox","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mdsumner/llbox","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fllbox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fllbox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fllbox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fllbox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mdsumner","download_url":"https://codeload.github.com/mdsumner/llbox/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mdsumner%2Fllbox/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279003468,"owners_count":26083595,"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-10-10T02:00:06.843Z","response_time":62,"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":[],"created_at":"2024-11-07T13:42:12.048Z","updated_at":"2025-10-10T10:09:51.701Z","avatar_url":"https://github.com/mdsumner.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"---\noutput: github_document\neditor_options: \n  chunk_output_type: console\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# llbox\n\n\u003c!-- badges: start --\u003e\n\u003c!-- badges: end --\u003e\n\nThe goal of llbox is to ... have control over building graticules. \n\nThere are simple cases ... we can do curvature analysis (see tissot) for more complex ones, or segment subdivision ala D3. \n\nThis is how to make tiles. Do the start and end edge of a series of longitudes and latitudes. \n\n```{r tiles}\nlibrary(llbox)\ndevtools::load_all()\n#system.time({\nto_sf \u003c- function(x) {\n  #sfheaders::sfc_polygon(polygonate(x))\n  sf::st_sfc(sf::st_polygon(list(polygonate(x))), crs = \"OGC:CRS84\")\n}\nproj \u003c- \"+proj=murd3 +lat_1=30 +lat_2=50\"\n# proj \u003c- \"+proj=tobmerc\"\n# proj \u003c- \"+proj=laea\"\n# proj \u003c- \"+proj=peirce_q\"\ngridx \u003c- seq(-180, 180, by = 10)\ngridy \u003c- seq(-50, 90, by = 15)\nx0 \u003c- list()\nrevm \u003c- function(x) {\n  x[seq(nrow(x), 1), ]\n}\nnv \u003c- 180\nfor (i in seq_along(head(gridx, -1))) {\n  for (j in seq_along(head(gridy, -1))) {\n    ww \u003c- west(x = gridx[i], y = gridy[j + c(0, 1)], nverts = nv)\n    nn \u003c- north(x = gridx[i + c(0, 1)], y = gridy[j + 1], nverts = nv)\n    ee \u003c- revm(east(x = gridx[i + 1], y = gridy[j + c(0, 1)], nverts = nv))\n    ss \u003c- revm(south(x = gridx[i + c(0, 1)], y = gridy[j], nverts = nv))\n    x0  \u003c- c(x0, list(rbind(ww, nn, ee, ss)))\n\n  }\n}\n\nsfx \u003c- sf::st_transform(do.call(c, lapply(x0, to_sf)), proj)\n#})\nplot(sfx)\n\n\n```\n\nThis is how to make lines. \n\n\n```{r lines}\nxs \u003c- seq(-175, 175, by = 15)\nys \u003c- seq(-75, 75, by = 10)\nmeridians \u003c- lapply(xs, \\(x) west(x, c(-85, 85)))\nparallels \u003c- lapply(ys, \\(x) north(c(-180, 180), x, nverts = 120))\nto_sfl \u003c- function(x) {\n  sf::st_sfc(sf::st_linestring(x), crs = \"OGC:CRS84\")\n}\nsfx \u003c- sf::st_transform(do.call(c, lapply(c(meridians, parallels), to_sfl)), proj)\nplot(sfx)\n```\n\n\n## Code of Conduct\n  \nPlease note that the llbox project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdsumner%2Fllbox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmdsumner%2Fllbox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmdsumner%2Fllbox/lists"}