# Spatial Tessellation, Modeling, and Cross-Validation Toolkit

## Documentation for package ‘spatialkit’ version 1.0.0

- DESCRIPTION file
- User guides, package vignettes and other documentation
- Package README

## Help Pages

assign_features_to_polygons | Assign features to polygons and attach a polygon ID
build_tessellation | Build a tessellation (Voronoi, Delaunay triangles, hex grid, or square grid)
clear_fitted_cache | Clear cached fitted values for a Bayesian spatial model
clear_grid_cache | Clear the in-session grid cache
clip_target_for | Build a polygonal clip target from points and/or a boundary
coef.bayesian_fit | Extract Bayesian model fixed-effect summaries
coef.gwr_fit | Extract GWR local coefficients
coerce_to_points | Coerce arbitrary geometries to representative points
compare_models | Side-by-side comparison of fitted spatial models
compare_models_cv | Cross-validated comparison of spatial models
create_grid_polygons | Create square or hexagonal grid polygons over a boundary
create_grid_polygons_cached | Create and cache grid polygons over a boundary
create_voronoi_polygons | Create Voronoi polygons from points with robust CRS and optional clipping
cv_bayes | K-fold cross-validation for the Bayesian spatial model
cv_gwr | K-fold cross-validation for GWR
cv_spatial | Model-agnostic spatial cross-validation
determine_optimal_levels | Determine an optimal number of spatial levels via an elbow heuristic
ensure_projected | Ensure an object has a projected CRS (with sensible defaults)
ensure_stable_poly_id | Create deterministic, stable polygon IDs based on spatial sort keys
estimate_sac_range | Estimate the spatial autocorrelation range from data
evaluate_insample | Compute in-sample (or out-of-sample) metrics for fitted spatial models
evaluate_models | Evaluate spatial models (legacy interface)
evaluate_models_cv | Cross-validated comparison with optional tessellation (legacy interface)
fit_bayesian_spatial_model | Fit a Bayesian spatial regression with a 2D Gaussian Process (via brms)
fit_gwr_model | Fit a Geographically Weighted Regression (GWR) via GWmodel
get_voronoi_seeds | Generate seed points for Voronoi tessellation
gp_lengthscale_bounds | Heuristic length-scale bounds for a squared-exponential GP
harmonize_crs | Harmonize CRS between two spatial objects
make_folds | Create spatial cross-validation folds
model_metrics | Compute goodness-of-fit metrics for a spatial model
model_metrics.spatial_fit | Compute goodness-of-fit metrics for a spatial model
new_spatial_fit | Build a spatial_fit S3 object
phi_prior_bounds | Heuristic length-scale bounds for a squared-exponential GP
plot_tessellation_map | Plot a tessellation map with optional boundary, seeds, and features
predict.bayesian_fit | Predict from a Bayesian spatial GP model
predict.gwr_fit | Predict from a GWR spatial model
prep_model_data | Prepare and sanitize an sf dataset for spatial modeling
residual_morans_i | Compute Moran's I on the residuals of a fitted spatial model
summarize_by_cell | Summarize features by polygon/cell ID
voronoi_seeds_kmeans | K-means seed generation from point coordinates
voronoi_seeds_random | Random seed generation within a polygonal boundary