Skip to contents

Match ground control points from source and target vectors by a shared identifier. CRS is stripped from both inputs to work in pixel coordinate space. Points present in only one input are dropped with a warning.

Usage

hsi_match_gcp(source, target, id_col = "gcp_id")

Arguments

source

A SpatVector of points with source GCPs. Must contain an identifier column.

target

A SpatVector of points with target GCPs. Must contain an identifier column.

id_col

Character. Column name containing GCP identifiers. Default "gcp_id".

Value

A tibble with columns:

gcp_id

GCP identifier, or column named by id_col.

source_x

X pixel coordinate in source raster.

source_y

Y pixel coordinate in source raster.

target_x

X pixel coordinate in target raster.

target_y

Y pixel coordinate in target raster.

See also

hsi_check_gcp() for assessing transformation quality, hsi_coregister() for warping.

Other HSI Co-registration: hsi_check_gcp(), hsi_coregister()

Examples

if (FALSE) { # \dontrun{
# Get SWIR GCPs
swir_gcps <- terra::vect("swir_preview.gpkg", layer = "gcp")

# Get VNIR GCPs
vnir_gcps <- terra::vect("vnir_preview.gpkg", layer = "gcp")

# See if there is a match between the GCPs
matched <- hsi_match_gcp(swir_gcps, vnir_gcps)
} # }