| Title: | Windows GDAL Runtime and gdalraster Bootstrap Tools |
|---|---|
| Description: | Installs and activates a self-contained GDAL runtime on Windows and provides helpers to install gdalraster from source against that GDAL instead of the default Rtools GDAL. |
| Authors: | Jimmy Briggs [aut, cre] (ORCID: <https://orcid.org/0000-0002-7489-8787>) |
| Maintainer: | Jimmy Briggs <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.2.1 |
| Built: | 2026-06-28 23:45:11 UTC |
| Source: | https://github.com/jimbrig/gdalraster.windows |
Prepends runtime paths, sets GDAL/PROJ env vars, and preloads GDAL DLL.
activate_gdal_runtime( gdal_home = default_gdal_home(), preload = TRUE, quiet = FALSE )activate_gdal_runtime( gdal_home = default_gdal_home(), preload = TRUE, quiet = FALSE )
gdal_home |
GDAL home directory. |
preload |
Whether to preload |
quiet |
Suppress informational CLI output. |
When the runtime bundle contains a python/ directory (pure-python
osgeo_utils package from GDAL's gdal-utils distribution), it is
prepended to PYTHONPATH so GDAL algorithms that embed Python at runtime
(e.g. gdal driver gpkg validate) can import it. This is session-scoped
and does not modify machine or user environment variables.
Invisibly returns a list with configured paths.
Writes a managed hook block into an .Rprofile file. The block loads the
bundled GDAL DLL before package attach and prepends the custom gdalraster
library path.
add_gdal_rprofile_hook( rprofile = "~/.Rprofile", gdal_home = default_gdal_home(), lib = default_gdalraster_lib(), dry_run = FALSE )add_gdal_rprofile_hook( rprofile = "~/.Rprofile", gdal_home = default_gdal_home(), lib = default_gdalraster_lib(), dry_run = FALSE )
rprofile |
Target |
gdal_home |
GDAL home directory. |
lib |
Library path containing the custom gdalraster install. |
dry_run |
If |
Invisibly returns the updated .Rprofile text.
Sets GDAL home for this session using either an R option or environment variable. This does not write to user profile files.
configure_gdal_home(path, mode = c("option", "env"))configure_gdal_home(path, mode = c("option", "env"))
path |
GDAL home directory path. |
mode |
Either |
Invisibly returns the normalized GDAL home path.
Returns the currently configured GDAL runtime home used by this package.
gdal_home()gdal_home()
Resolution order:
options(gdalraster.windows.gdal_home = "...")
GDALRASTER_WINDOWS_GDAL_HOME environment variable
package-managed user data directory (tools::R_user_dir())
A single string path.
Returns R code that loads the bundled GDAL DLL before attaching
gdalraster, and prepends the custom lib path so library(gdalraster)
resolves to the source build installed by install_gdalraster().
gdal_rprofile_snippet( gdal_home = default_gdal_home(), lib = default_gdalraster_lib() )gdal_rprofile_snippet( gdal_home = default_gdal_home(), lib = default_gdalraster_lib() )
gdal_home |
GDAL home directory. |
lib |
Library path containing the custom gdalraster install. |
A single string containing R code.
Installs the GDAL runtime into gdal_home from one of:
install_gdal_runtime( repo = "jimbrig/gdalraster.windows", tag = "latest", asset_pattern = "gdal-(bundle|ucrt64)-.*\\.zip$", gdal_home = default_gdal_home(), overwrite = FALSE, local_zip = NULL, fallback_zip = NULL )install_gdal_runtime( repo = "jimbrig/gdalraster.windows", tag = "latest", asset_pattern = "gdal-(bundle|ucrt64)-.*\\.zip$", gdal_home = default_gdal_home(), overwrite = FALSE, local_zip = NULL, fallback_zip = NULL )
repo |
GitHub repo slug, e.g. |
tag |
Release tag or |
asset_pattern |
Regex used to select the release asset. |
gdal_home |
Destination GDAL home directory. |
overwrite |
Whether to replace existing |
local_zip |
Optional local GDAL runtime zip to install directly. |
fallback_zip |
Optional fallback zip path used when release download
fails. When |
local_zip (highest precedence),
GitHub release asset lookup/download,
fallback_zip when release lookup/download fails.
The selected zip must contain a GDAL root with bin/libgdal-*.dll.
Invisibly returns installed GDAL home path.
On machines without network access, download the release asset manually from https://github.com/jimbrig/gdalraster.windows/releases, transfer it to the target machine, and install directly:
gdalraster.windows::install_gdal_runtime( local_zip = "C:/Downloads/gdal-ucrt64-v3.13.1-windows-x64.zip" )
Note that no fallback zip is shipped with the package (a full runtime
bundle is too large to vendor), so the fallback path only applies when you
provide a fallback_zip yourself.
Downloads or uses a local gdalraster source tarball and installs it from source into a dedicated library path (default) so existing user libraries are not overwritten.
install_gdalraster( gdal_home = default_gdal_home(), lib = default_gdalraster_lib(), source_tarball = NULL, repo = "firelab/gdalraster", ref = "HEAD", upgrade = FALSE, repos = getOption("repos") )install_gdalraster( gdal_home = default_gdal_home(), lib = default_gdalraster_lib(), source_tarball = NULL, repo = "firelab/gdalraster", ref = "HEAD", upgrade = FALSE, repos = getOption("repos") )
gdal_home |
GDAL home directory used for compile/link flags. |
lib |
Destination library path for installing gdalraster. |
source_tarball |
Optional local path to |
repo |
Source GitHub repo slug for gdalraster. |
ref |
Git ref (branch, tag, commit) used when downloading from GitHub. |
upgrade |
Whether to allow dependency upgrades during install. |
repos |
CRAN-like repositories passed to |
Invisibly returns installed library path.
Convenience wrapper over activate_gdal_runtime() that ensures the GDAL
runtime is activated and the main GDAL DLL is preloaded in the current
session.
load_gdal_dll(gdal_home = default_gdal_home(), quiet = FALSE)load_gdal_dll(gdal_home = default_gdal_home(), quiet = FALSE)
gdal_home |
GDAL home directory. |
quiet |
Suppress informational CLI output. |
Invisibly returns activation metadata.
Activates bundled GDAL runtime, prepends lib to .libPaths(), and attaches
gdalraster for use in the current R session.
load_gdalraster( lib = default_gdalraster_lib(), gdal_home = default_gdal_home(), quiet = FALSE )load_gdalraster( lib = default_gdalraster_lib(), gdal_home = default_gdal_home(), quiet = FALSE )
lib |
Library path containing the gdalraster source install. |
gdal_home |
GDAL home directory. |
quiet |
Suppress informational CLI output. |
Invisibly returns TRUE if gdalraster was attached.
Attempts to load gdalraster and checks the global algorithm registry.
verify_gdalraster_runtime( lib.loc = NULL, activate_runtime = TRUE, gdal_home = default_gdal_home(), quiet = FALSE )verify_gdalraster_runtime( lib.loc = NULL, activate_runtime = TRUE, gdal_home = default_gdal_home(), quiet = FALSE )
lib.loc |
Optional library location used for loading |
activate_runtime |
Whether to run |
gdal_home |
GDAL home used when |
quiet |
If |
TRUE when algorithm API is available, otherwise FALSE.