{"id":13857637,"url":"https://github.com/dcooley/sfheaders","last_synced_at":"2025-04-06T03:08:54.282Z","repository":{"id":52215684,"uuid":"192025868","full_name":"dcooley/sfheaders","owner":"dcooley","description":"Build sf objects from R and Rcpp","archived":false,"fork":false,"pushed_at":"2024-07-29T22:57:40.000Z","size":12210,"stargazers_count":74,"open_issues_count":14,"forks_count":5,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-30T01:12:29.474Z","etag":null,"topics":["r","rcpp","simple-features"],"latest_commit_sha":null,"homepage":"https://dcooley.github.io/sfheaders/","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/dcooley.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["dcooley"]}},"created_at":"2019-06-15T02:04:32.000Z","updated_at":"2024-08-24T12:49:14.000Z","dependencies_parsed_at":"2024-01-03T02:44:39.936Z","dependency_job_id":"c2b9bb99-07f4-4368-8d43-5a79e81d98f5","html_url":"https://github.com/dcooley/sfheaders","commit_stats":{"total_commits":420,"total_committers":9,"mean_commits":"46.666666666666664","dds":"0.43333333333333335","last_synced_commit":"c5ed7fc5532fc5f084aec80d0b81755ea47364c6"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcooley%2Fsfheaders","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcooley%2Fsfheaders/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcooley%2Fsfheaders/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dcooley%2Fsfheaders/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dcooley","download_url":"https://codeload.github.com/dcooley/sfheaders/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247427006,"owners_count":20937201,"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":["r","rcpp","simple-features"],"created_at":"2024-08-05T03:01:42.672Z","updated_at":"2025-04-06T03:08:54.260Z","avatar_url":"https://github.com/dcooley.png","language":"R","funding_links":["https://github.com/sponsors/dcooley"],"categories":["R"],"sub_categories":[],"readme":"---\noutput: github_document\n---\n\n```{r setup, include = FALSE}\nknitr::opts_chunk$set(\n  collapse = TRUE,\n  comment = \"#\",\n  fig.path = \"man/figures/README-\",\n  out.width = \"100%\"\n)\n\n```\n\n[![R build status](https://github.com/dcooley/sfheaders/workflows/R-CMD-check/badge.svg)](https://github.com/dcooley/sfheaders/actions)\n[![Coverage status](https://codecov.io/gh/dcooley/sfheaders/branch/master/graph/badge.svg)](https://app.codecov.io/github/dcooley/sfheaders?branch=master)\n![downloads](http://cranlogs.r-pkg.org/badges/grand-total/sfheaders)\n[![CRAN RStudio mirror downloads](http://cranlogs.r-pkg.org/badges/sfheaders)](https://CRAN.R-project.org/package=sfheaders)\n\n## Another spatial library?\n\nYep. In a few of my other libraries I've made use of `sf` objects, but without importing the `sf` library itself. This is by design because `sf` is quite a 'heavy' library. \n\nTherefore I've written / copied these methods for constructing the `sf` objects across a few different libraries. \n\nSo I thought it would be useful to have these in one place. And here they are.\n\n## Does it really make `sf` objects?\n\nYes and No. \n\nThese functions do not perform any validity checks on the geometries. Nor do they set Coordinate Reference Systems, EPSG, PROJ4 or precision attributes. \n\nWhat they do is convert R and Rcpp objects (vectors, matrices and data.frames) into the correct `sf` class structure, so you can then assign these values yourself. \n\n\n## Are there any catches?\n\nYes. Your data has to be ordered before coverting to `sf`.\n\n## Where are the examples?\n\nThey're on the [website](https://dcooley.github.io/sfheaders/articles/examples.html). GO NOW!\n\n(however, here's a taster)\n\n\n```r\n\ndf \u003c- data.frame(\n  id = c(1,1,1,1,1,2,2,2,2,2)\n  , x = c(1,2,2,1,1,3,4,4,3,3)\n  , y = c(1,1,2,2,1,3,3,4,4,3)\n)\n\ndf$val \u003c- letters[df$id]\n\nsfheaders::sf_linestring( df, x = \"x\", y = \"y\", linestring_id = \"id\", keep = TRUE )\n\n# Simple feature collection with 2 features and 2 fields\n# geometry type:  LINESTRING\n# dimension:      XY\n# bbox:           xmin: 1 ymin: 1 xmax: 4 ymax: 4\n# epsg (SRID):    NA\n# proj4string:    NA\n#   id val                       geometry\n# 1  1   a LINESTRING (1 1, 2 1, 2 2, ...\n# 2  2   b LINESTRING (3 3, 4 3, 4 4, ...\n\nsfheaders::sf_polygon( df, x = \"x\", y = \"y\", polygon_id = \"id\" , keep = TRUE )\n\n# Simple feature collection with 2 features and 2 fields\n# geometry type:  POLYGON\n# dimension:      XY\n# bbox:           xmin: 1 ymin: 1 xmax: 4 ymax: 4\n# epsg (SRID):    NA\n# proj4string:    NA\n#   id val                       geometry\n# 1  1   a POLYGON ((1 1, 2 1, 2 2, 1 ...\n# 2  2   b POLYGON ((3 3, 4 3, 4 4, 3 ...\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcooley%2Fsfheaders","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdcooley%2Fsfheaders","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdcooley%2Fsfheaders/lists"}