{"id":14067144,"url":"https://github.com/geoarrow/geoarrow-r","last_synced_at":"2025-05-12T19:38:37.159Z","repository":{"id":39492244,"uuid":"431964058","full_name":"geoarrow/geoarrow-r","owner":"geoarrow","description":"Extension types for geospatial data for use with 'Arrow'","archived":false,"fork":false,"pushed_at":"2025-03-07T15:18:29.000Z","size":3695,"stargazers_count":164,"open_issues_count":11,"forks_count":7,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-03T14:19:49.773Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://geoarrow.org/geoarrow-r/","language":"C","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/geoarrow.png","metadata":{"files":{"readme":"README.Rmd","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2021-11-25T20:03:47.000Z","updated_at":"2025-04-23T10:58:13.000Z","dependencies_parsed_at":"2024-01-31T02:28:28.011Z","dependency_job_id":"249a0a10-a043-4144-ad87-c22a73858068","html_url":"https://github.com/geoarrow/geoarrow-r","commit_stats":null,"previous_names":["geoarrow/geoarrow-r"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoarrow%2Fgeoarrow-r","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoarrow%2Fgeoarrow-r/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoarrow%2Fgeoarrow-r/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geoarrow%2Fgeoarrow-r/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geoarrow","download_url":"https://codeload.github.com/geoarrow/geoarrow-r/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253808958,"owners_count":21967631,"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":[],"created_at":"2024-08-13T07:05:27.245Z","updated_at":"2025-05-12T19:38:37.122Z","avatar_url":"https://github.com/geoarrow.png","language":"C","funding_links":[],"categories":["R"],"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# geoarrow\n\n\u003c!-- badges: start --\u003e\n[![Codecov test coverage](https://codecov.io/gh/geoarrow/geoarrow-r/branch/main/graph/badge.svg)](https://app.codecov.io/gh/geoarrow/geoarrow-r?branch=main)\n\u003c!-- badges: end --\u003e\n\nThe goal of geoarrow is to leverage the features of the [arrow](https://arrow.apache.org/docs/r/) package and larger [Apache Arrow](https://arrow.apache.org/) ecosystem for geospatial data. The geoarrow package provides an R implementation of the [GeoParquet](https://github.com/opengeospatial/geoparquet) file format of and the draft [geoarrow data specification](https://geoarrow.org), defining extension array types for vector geospatial data.\n\n## Installation\n\nYou can install the released version of geoarrow from [CRAN](https://cran.r-project.org/) with:\n\n``` r\ninstall.packages(\"geoarrow\")\n```\n\nYou can install the development version of geoarrow from [GitHub](https://github.com/) with:\n\n``` r\n# install.packages(\"pak\")\npak::pak(\"geoarrow/geoarrow-r\")\n```\n\n## Example\n\nThe geoarrow package implements conversions to/from various geospatial types (e.g., sf, sfc, s2, wk) with various Arrow representations (e.g., arrow, nanoarrow). The most useful conversions are between the **arrow** and **sf** packages, which in most cases allow sf objects to be passed to **arrow** functions directly after `library(geoarrow)` or `requireNamespace(\"geoarrow\")` has been called.\n\n```{r example}\nlibrary(geoarrow)\nlibrary(arrow, warn.conflicts = FALSE)\nlibrary(sf)\n\nnc \u003c- read_sf(system.file(\"gpkg/nc.gpkg\", package = \"sf\"))\ntf \u003c- tempfile(fileext = \".parquet\")\n\nnc |\u003e \n  tibble::as_tibble() |\u003e \n  write_parquet(tf)\n\nopen_dataset(tf) |\u003e \n  dplyr::filter(startsWith(NAME, \"A\")) |\u003e\n  dplyr::select(NAME, geom) |\u003e \n  st_as_sf()\n```\n\nBy default, arrow objects are converted to a neutral wrapper around chunked Arrow memory, which in turn implements conversions to most spatial types:\n\n```{r}\ndf \u003c- read_parquet(tf)\ndf$geom\nst_as_sfc(df$geom)\n```\n\nThe entry point to creating arrays is `as_geoarrow_vctr()`:\n\n```{r}\nas_geoarrow_vctr(c(\"POINT (0 1)\", \"POINT (2 3)\"))\n```\n\nBy default these do not attempt to create a new storage type; however, you can request a storage type or infer one from the data:\n\n```{r}\nas_geoarrow_vctr(c(\"POINT (0 1)\", \"POINT (2 3)\"), schema = geoarrow_native(\"POINT\"))\n\nvctr \u003c- as_geoarrow_vctr(c(\"POINT (0 1)\", \"POINT (2 3)\"))\nas_geoarrow_vctr(vctr, schema = infer_geoarrow_schema(vctr))\n```\n\nThere are a number of files to use as examples at \u003chttps://geoarrow.org/data\u003e that can be read with `arrow::read_ipc_file()`:\n\n```{r}\nurl \u003c- \"https://github.com/geoarrow/geoarrow-data/releases/download/v0.1.0/ns-water-basin_point.arrow\"\ntab \u003c- read_ipc_file(url, as_data_frame = FALSE)\ntab$geometry$type\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeoarrow%2Fgeoarrow-r","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeoarrow%2Fgeoarrow-r","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeoarrow%2Fgeoarrow-r/lists"}