Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/program--/tidygdal
https://github.com/program--/tidygdal
Last synced: 24 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/program--/tidygdal
- Owner: program--
- License: other
- Created: 2024-08-04T19:37:18.000Z (5 months ago)
- Default Branch: main
- Last Pushed: 2024-08-05T05:07:41.000Z (5 months ago)
- Last Synced: 2024-08-06T05:41:48.817Z (5 months ago)
- Language: C
- Size: 79.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# tidygdal
## Installation
You can install the development version of tidygdal like so:
``` r
pak::pkg_install("program--/tidygdal")
```## Example
### Opening a vector file
```{r example_open}
path <- system.file("testdata", "nc.gpkg", package = "tidygdal")ds <- tidygdal::gdal_vector(path)
ds# Similar to `sf::st_layers`
tidygdal::gdal_vector_layers(ds)
```### Vector Translate (ogr2ogr)
```{r example_ogr2ogr}
library(tidygdal)testdata <- system.file("testdata", package = "tidygdal")
# Convert the test GPKG to a FlatGeoBuf file
# Note: order of these steps does not matter
# Additionally, omitting `gdal_vto_set_output` returns the transformed
# data to an in-memory dataset.
gdal_vto() |>
gdal_vto_set_input_fmt("GPKG") |>
gdal_vto_set_output_fmt("FlatGeoBuf") |>
gdal_vto_set_target_srs("EPSG:5070") |>
gdal_vto_set_make_valid() |>
gdal_vto_set_new_layer_name("nc") |>
gdal_vto_set_input(file.path(testdata, "nc.gpkg")) |>
gdal_vto_set_output(file.path(testdata, "nc.fgb")) |>
gdal_vector_translate()
```