Precision agriculture relies heavily on identifying and managing fine-scale spatial variability across cultivated fields by transforming observations collected at discrete sample locations into continuous maps through numerical interpolation. Agronomic field management decisions depend directly on map reliability, yet previous experimental research has demonstrated that no single spatial interpolator consistently outperforms alternative algorithms across all environmental and sampling conditions. The predictive performance of spatial interpolation depends on an array of interacting dataset properties, including sampling design, underlying data quality, total sample size, spatial dependence, auxiliary covariate availability, and the mathematical properties of the selected estimation algorithm. When practitioners choose an interpolator without evaluating these governing data characteristics, mapping errors can propagate into flawed field applications. To address these operational constraints, researchers Laura Delgado Bejarano and Lucas Rios do Amaral developed Best Fit Interpolator, an open-source QGIS decision-support plugin designed to operationalize an empirical, rule-based selection framework while enabling systematic method comparison, statistical validation, and automated map generation directly inside a unified geographic information system environment.
Developing continuous digital maps from point samples in routine agricultural workflows has traditionally presented technical obstacles that discourage practitioners from exploring multiple spatial models. Advanced geostatistical algorithms, such as ordinary kriging, and modern machine-learning models, including random forest and support vector machines, demand specialized statistical knowledge for covariance parameterization, hyperparameter tuning, and diagnostic interpretation. Furthermore, computational processing costs can increase substantially when managing large agricultural point datasets collected by sensor-equipped machinery. In conventional settings, data preparation, spatial exploratory analysis, model fitting, and validation are frequently fragmented across disconnected software packages, requiring custom programming scripts in environments such as R or Python to achieve reproducible results. Existing digital mapping tools typically fall into script-based frameworks like the gstat package, workflow-based graphical platforms like native QGIS interpolation tools or AgDataBox, or hybrid systems like ArcGIS Pro ModelBuilder and Smart-Map. Best Fit Interpolator bridges these approaches by integrating data characterization, empirical rule-based method recommendations, cross-validation metrics, and cartographic reporting into a single graphical user interface without requiring programming experience or commercial software licensing.
Best Fit Interpolator version 2.1 is implemented in Python as a standard extension that utilizes the QGIS Python Application Programming Interface, offering cross-platform compatibility across QGIS versions 3.14 through 3.99 as well as QGIS 4.x environments under Qt5 and Qt6 architectures. The software architecture separates interface management, process control, and numerical computation into distinct layers to minimize software coupling between user interface events and backend spatial routines. The graphical interface was designed using Qt Designer and rendered via PyQt, while a central controller oversees specialized operational modules dedicated to data inspection, deterministic algorithms, geostatistical routines, machine learning, hybrid regression kriging, and framework-guided recommendations. Core computational routines are maintained in modular Python code that can run and be evaluated independently of the graphical interface, supported by fundamental scientific libraries including NumPy, pandas, SciPy, Matplotlib, GDAL, scikit-learn, joblib, and threadpoolctl. Compatible dependency versions are isolated within a dedicated subfolder to avoid runtime library conflicts with the host QGIS Python environment.
The analytical sequence begins in the Data tab, where users define a shared spatial context by linking an input point observation layer, the numerical target attribute, a polygon layer defining the bounding interpolation boundary, and the target output raster resolution. The plugin conducts initial integrity verifications, filtering out records containing missing target values and evaluating coordinate reference system compatibility and spatial overlap between observation points and boundary polygons. The software subsequently evaluates global spatial autocorrelation for the target attribute using Moran’s I computed across the eight nearest sample locations. A standardized z-score classifies spatial autocorrelation as clustered when z exceeds 1.96, dispersed when z falls below negative 1.96, or random when z remains between these critical thresholds, using a significance threshold of p below 0.05 to indicate structured spatial patterns. Additionally, an interactive Outlier Diagnostic tool allows users to detect potential statistical outliers using interquartile range and median absolute deviation rules, alongside spatial clusters and spatial anomalies identified through Local Moran’s I statistics without permanently modifying original project layers.
For univariate modeling tasks, the plugin provides deterministic and geostatistical alternatives in dedicated tabs that support both manual configuration and automated optimization routines. In the Deterministic tab, inverse distance weighting enables users to specify power exponents and neighborhood sizes manually or execute an optimization routine evaluating power values from 0.5 to 6.0 in increments of 0.5 and neighbor counts from 4 to 16, retaining the combination yielding the lowest Interpolation Selection Index based on absolute mean error and error standard deviation. Thin plate spline interpolation utilizes a global formulation for sample sizes up to 500 observations, switching to neighbor-aware local systems supporting up to 64 neighbors in dense computational profiles and 32 neighbors in massive profiles to preserve computational tractability on large datasets. The Geostatistics tab provides Ordinary Kriging and Universal Kriging with linear spatial trends, estimating spherical, exponential, or Gaussian covariance functions via either the method of moments or restricted maximum likelihood, where the method of moments employs constrained weighted least squares that assigns larger fitting weights to shorter lag distances.
The plugin’s Machine Learning tab supports multivariate spatial prediction using random forest and support vector machine regressors, as well as a hybrid regression kriging workflow that couples nonlinear machine-learning predictions with ordinary kriging applied to model residuals. Users can import and resample auxiliary raster covariates, extract localized predictor values at sample coordinates, standardize feature distributions, and inspect inter-variable correlation matrices. To represent location-associated variation, the framework-guided workflow includes geographic X and Y coordinates alongside environmental covariates as candidate predictors, while the manual workflow allows users to include or omit spatial coordinates to avoid potential orthogonal prediction artifacts. Parameter optimization within the machine-learning modules is supported by reproducible grid-search routines that systematically evaluate sampled hyperparameter combinations across cross-validation folds. For regression kriging, the workflow models underlying deterministic environmental relationships with random forest before calculating an experimental semivariogram on the resulting regression residuals, using ordinary kriging to interpolate remaining spatially structured residual variance across the study area.
To maintain computational efficiency across diverse sampling scales, Best Fit Interpolator establishes tiered computational profiles based on the count of valid sample observations: normal for up to 500 observations, dense for 501 to 10,000 observations, and massive when observation counts exceed 10,000. These profiles dynamically configure neighborhood selections, prediction raster block processing sizes, and machine-learning search limits while ensuring all valid observations contribute to final surface generation. To evaluate predictive performance, the software deploys an adaptive validation protocol tailored to dataset size, executing leave-one-out cross-validation for sample sizes up to 100 observations, 10-fold cross-validation for 101 to 500 samples, and 5-fold cross-validation for 501 to 10,000 samples. When sample sizes exceed 10,000 observations, the framework activates a hold-out validation routine using approximately 20 percent of data, capped at 10,000 test observations per method. Validation accuracy is summarized through root mean square error, relative root mean square error, mean absolute error, Pearson’s correlation coefficient, the coefficient of determination, and Lin’s concordance correlation coefficient.
The core decision-support logic of the Framework tab links sample size classes, Moran’s I spatial autocorrelation significance, spatial dependence index levels, and auxiliary covariate availability to recommend eligible interpolation approaches. The spatial dependence index represents the proportion of total semivariance associated with the spatially structured component, classified from very low under 20 percent to very high at or above 80 percent. When environmental covariates are absent, the framework evaluates univariate options, whereas covariate availability activates the full workflow incorporating machine-learning and hybrid models. Within the framework, candidate models are formally ranked by decreasing Lin’s concordance correlation coefficient, breaking any numerical ties with lower root mean square error values. Because Lin’s metric measures agreement against the 1:1 identity line, it simultaneously captures prediction accuracy and precision. Users are not restricted to recommended candidates; they can validate alternative methods concurrently, allowing empirical predictive accuracy to verify or refine the framework’s initial guidance.
The authors demonstrated the practical application of Best Fit Interpolator using an illustrative agronomic dataset comprising 114 georeferenced soil clay observations collected from the 0 to 0.20-meter soil layer across a 107-hectare agricultural field in Paulínia, São Paulo State, Brazil. Attribute analysis detected significant clustered spatial autocorrelation, characterized by a Moran’s I of 0.75 and a significance value of p below 0.001. Fitting an ordinary kriging spherical semivariogram through the method of moments yielded a nugget of zero, a partial sill of 16,323, a range of 901.50 meters, and a spatial dependence index of 100 percent. Given the sample size of 114 observations, significant clustering, very high spatial dependence, and four available raster covariates, the full framework initially recommended ordinary kriging, random forest, regression kriging, and support vector machines. However, validation of all six candidate methods via 10-fold cross-validation revealed that ordinary kriging achieved the highest Lin’s concordance correlation coefficient at 0.904, followed by thin plate splines at 0.890, inverse distance weighting at 0.878, regression kriging at 0.866, random forest at 0.835, and support vector machines at 0.762.
The empirical clay results underscore the value of validating multiple spatial algorithms, as deterministic methods outside initial recommendations performed competitively with advanced multivariate models under conditions of strong spatial dependence. In addition to small-scale soil modeling, computational performance was tested using 99,480 combine-harvester sorghum yield observations recorded across Paulínia in 2023, along with a 5,000-observation representative subset evaluated under five-fold cross-validation across three offscreen repetitions in QGIS 3.44.8 on an Intel Core Ultra 9 system running Windows 11. Across the full six-method suite, median execution time reached 154.3 seconds for the subset and 722.4 seconds for the full 99,480-point dataset, with maximum resident process memory remaining below 996 megabytes. The authors note methodological limitations in current validation procedures: the present framework does not enforce spatial buffer separation between training and validation folds, which can inflate accuracy metrics in clustered data, and the software does not yet generate localized uncertainty maps or prediction intervals. Nonetheless, Best Fit Interpolator provides an open-source, reproducible decision-support system that streamlines complex spatial interpolation and comparative model selection for precision agriculture practitioners.
Subject of Research: Decision-support software for spatial interpolation and method validation in precision agriculture
Article Title: Best Fit Interpolator: a QGIS decision-support plugin for comparing, validating, and applying spatial interpolation methods
Article References: Delgado Bejarano, L., & Rios do Amaral, L. (2026). Best Fit Interpolator: a QGIS decision-support plugin for comparing, validating, and applying spatial interpolation methods. SoftwareX, 36, Article 103252. https://doi.org/10.1016/j.softx.2026.103252
Image Credits: AI Generated
DOI: 10.1016/j.softx.2026.103252
Keywords: QGIS, spatial interpolation, precision agriculture, ordinary kriging, random forest, support vector machine, regression kriging, thin plate spline, inverse distance weighting, geostatistics, Moran's I, cross-validation, Lin's concordance correlation coefficient, digital soil mapping, Python, open-source software, spatial autocorrelation
Cite Scienmag News
Alan Morgan. (November 22, 2026). Open Source QGIS Plugin Automates Multi Method Spatial Interpolation for Agriculture. Scienmag. https://scienmag.com/open-source-qgis-plugin-automates-multi-method-spatial-interpolation-for-agriculture/
Alan Morgan. "Open Source QGIS Plugin Automates Multi Method Spatial Interpolation for Agriculture." Scienmag, 22 November 2026, https://scienmag.com/open-source-qgis-plugin-automates-multi-method-spatial-interpolation-for-agriculture/. Accessed 22 November 2026.
Alan Morgan. "Open Source QGIS Plugin Automates Multi Method Spatial Interpolation for Agriculture." Scienmag. November 22, 2026. https://scienmag.com/open-source-qgis-plugin-automates-multi-method-spatial-interpolation-for-agriculture/








