Skip to contents

The mapAI package provides a cohesive, end-to-end toolkit in R for the Positional Accuracy Improvement (PAI) and distortion analysis of historical vector maps. It uses a suite of statistical and machine learning models to learn the complex geometric distortions inherent in historical cartographic documents and applies a correction to use in modern GIS applications.

Details

The package is designed for researchers and practitioners in geomatics, GIS, and the digital humanities. It provides a complete, modular workflow that guides the user from data ingestion to final analysis and visualization.

The Core Workflow

The main workflow follows a logical sequence:

  1. Data Handling: Imports spatial data and control points using read_map() and read_gcps(). The package also includes functions to generate synthetic data (create_demo_data()) and save results (write_map()).

  2. Model Training & Validation: Train a correction model using train_pai_model() with a choice of methods ("helmert", "lm", "rf", "gam"). Robustly evaluate model performance using spatial cross-validation with assess_pai_model().

  3. Geometric Correction: Apply the trained model to the full vector map to get a geometrically corrected version using apply_pai_model().

  4. Distortion Analysis & Visualization: Go beyond correction to quantify and understand the distortion itself.

See also

To get started with a practical example, see the introductory vignette: vignette("getting-started", package = "mapAI")

For a more in-depth look at comparing models and validation strategies, see the advanced vignette: vignette("swiss-analysis", package = "mapAI")

The project's source code and issue tracker can be found on GitHub: https://github.com/kvantas/mapAI

Author

Maintainer: Konstantinos Vantas kon.vantas@gmail.com (ORCID)