gdalraster.windows helps you use gdalraster
with a bundled GDAL runtime on Windows.
Typical flow:
gdalraster from source against that runtimepak::pak("jimbrig/gdalraster.windows")
gdalraster.windows::install_gdal_runtime()
gdalraster.windows::install_gdalraster()
library(gdalraster.windows)
gdalraster::gdal_global_reg_names()If runtime and custom gdalraster are already
installed:
Explicit load flow:
Download the release asset from https://github.com/jimbrig/gdalraster.windows/releases on a connected machine, transfer it, then:
Some GDAL algorithms (e.g. gdal driver gpkg validate)
are implemented in Python: libgdal embeds a CPython
interpreter at runtime and imports the pure-python
osgeo_utils package. The runtime bundle ships that package
under <gdal_home>/python, and
activate_gdal_runtime() exposes it to the embedded
interpreter by prepending it to PYTHONPATH
(session-scoped).
library(gdalraster.windows)
library(gdalraster)
alg <- gdalraster::gdal_alg(cmd = "driver gpkg validate")
alg$setArg("dataset", "path/to/file.gpkg")
alg$setArg("full-check", TRUE)
alg$run()
alg$output()
#> [1] "Checking gpkg_spatial_ref_sys\n...\nValidation succeeded"A python.exe must be discoverable on PATH
for GDAL to embed an interpreter (Rtools’ UCRT64 python works, as does
any system python). If such an algorithm fails with
ModuleNotFoundError: No module named 'osgeo_utils', the
runtime bundle predates python support — reinstall with
install_gdal_runtime(overwrite = TRUE) and re-activate.
By default:
gdalraster installs to an isolated library
pathPersistent startup behavior is optional:
In a fresh session:
gdalraster.windows::activate_gdal_runtime()library(gdalraster)length(gdalraster::gdal_global_reg_names()) > 0If this fails, see dev/docs/05-troubleshooting.md.