Skip to contents

Reads a CSV file containing homologous points and prepares them for modeling by calculating displacement vectors and creating an sf object.

Usage

read_gcps(gcp_path, crs)

Arguments

gcp_path

A character string specifying the path to the CSV file of homologous points.

crs

The coordinate reference system (CRS) of the source_x and source_y coordinates. This is a required parameter to ensure spatial context. It can be an EPSG code (e.g., 32632) or a WKT string.

Value

An sf object of the homologous points, with point geometries based on the source coordinates and calculated dx and dy displacement columns.

Details

This function is the first step in the modeling workflow. It requires a CSV file with four specific columns: source_x and source_y (coordinates from the old/distorted map) and target_x and target_y (coordinates from the reference/true map). It calculates the dx and dy errors that the models will learn to predict.

Examples

if (FALSE) { # \dontrun{
# First, create a demo CSV file
demo_files <- create_demo_data()

# Read the GCPs, providing the CRS for the source coordinates
# (The demo data uses a placeholder CRS of 3857)
gcp_data <- read_gcps(gcp_path = demo_files$gcp_path, crs = 3857)

# The output is now ready for model training
print(gcp_data)
} # }