Skip to contents

Creates a multi-layer raster containing the spherical distance (in kilometers) from each PRIO-GRID cell centroid to the territorial outline of the country the cell belongs to using CShapes 2.0 boundary data for temporal time slices as defined in PRIOGRID.

Usage

gen_bdist3(cshp = read_cshapes())

Arguments

cshp

An sf object containing CShapes 2.0 boundary data with temporal information. Defaults to read_cshapes() if not provided.

Value

A SpatRaster object

Details

The function automatically uses past results from previous time slices to reduce computation time when country boundaries remain unchanged between consecutive periods.

Note

  • This function is computationally intensive and may take hours to complete

  • Progress indicators are printed during processing (time slice numbers)

  • The optimization using past results significantly reduces total computation time

  • Consider running in segments for very long time series to manage memory usage

References

Schvitz G, Girardin L, Rüegger S, Weidmann NB, Cederman L, Gleditsch KS (2022). “Mapping the International System, 1886-2019: The CShapes 2.0 Dataset.” Journal of Conflict Resolution, 66(1), 144–161. ISSN 0022-0027, doi:10.1177/00220027211013563 , 2024-11-22.

Examples

if (FALSE) { # \dontrun{
# Generate full temporal border distance dataset
# Warning: This may take several hours to complete
temporal_bdist3 <- gen_bdist3()

print(temporal_bdist3)
} # }