has.geoloc: Geolocation arrays and GCPs

has.geolocR Documentation

Geolocation arrays and GCPs

Description

Detect whether a SpatRaster source has GDAL geolocation arrays (e.g. satellite swath / curvilinear NetCDF) and/or Ground Control Points (GCPs), and report the associated spatial reference and array paths.

When a file has no conventional geotransform but does have a GEOLOCATION metadata domain (or GCPs), rast stores that information on the source and, if the dataset itself has no CRS, applies the geolocation/GCP CRS automatically so that project can use the arrays.

Usage

## S4 method for signature 'SpatRaster'
has.geoloc(x)

## S4 method for signature 'SpatRaster'
geoloc(x)

Arguments

x

SpatRaster

Value

has.geoloc: logical, one value per raster data source.

geoloc: data.frame with one row per source and columns geolocation (logical), gcps (logical), srs (character), x / y (paths to the X/Y geolocation datasets when present).

See Also

project, rectify, is.rotated, crs

Examples

r <- rast(nrows=10, ncols=10)
has.geoloc(r)
geoloc(r)

terra documentation built on Aug. 22, 2026, 5:07 p.m.