The
Precision Zones plugin is an open-source tool for QGIS, developed in Python 3.10 and designed for QGIS version 3.44.11 or later. The source code is available on GitHub (
https://github.com/Derleimelo/Precision-Zones-Plugin) accessed on 23 October 2025, and the plugin is available in the official QGIS repository (
https://plugins.qgis.org/plugins/precision_zones/) accessed on 23 October 2025. The methodological protocol embedded within the plugin is based on the integration of routines and techniques validated in the literature for the segmentation and evaluation of management zones in precision agriculture [
12,
13,
22,
25,
26,
27]. The integration of routines typically scattered across different software packages into a single environment (
Figure 1) allows
Precision Zones to leverage specialized geospatial libraries for the full MZ segmentation workflow. However, its contribution goes beyond merely aggregating a step-by-step analysis, as it implements a reproducible protocol for management-zone delineation, with explicit parameter settings, consistency checks, and standardized outputs. This process is executed through five main steps (
Figure 1), which can be summarized as follows:
The plugin provides a guided, user-friendly workflow to access and integrate the required layers. To ensure data quality, the system automatically validates the Coordinate Reference System (CRS), resolution, and extent of the selected QGIS layers. Furthermore, the workflow integrates options for resampling, clipping, and z-score standardization, enabling analyses only after these harmonization steps are successfully completed. This comprehensive system of interface checks and messages reduces errors and ensures methodological reproducibility. The entire workflow operates through a guided graphical interface, which eliminates the need for programming knowledge. This design allows for both sequential and modular execution and facilitates seamless integration with external data sources.
Case Study
The characterization and evaluation of
Precision Zones utilized a case study conducted in a ~107-hectare area located in the municipality of Cosmópolis, state of São Paulo, Brazil (22°41′55.16″ S, 47°10′34.15″ W) (
Figure 2). The climate classification, according to the Köppen system, is Cwa (humid subtropical with hot summers), characterized by a mean annual precipitation of 1400 mm and a mean annual temperature of 20–22 °C. The area features gently undulating terrain and is characterized, predominantly, by a Latosol soil type, with a surface texture (0–20 cm) ranging from clay to clay-loam-sandy. Grain production predominates, with soybean cropped in the first season and oat or grain sorghum in the second season. Soil fertility management in both seasons is conventional, utilizing a fixed-rate application according to the grower’s standards.
The primary focus of this case study involves investigating soil variability through management zones; consequently, the analysis employs agronomically relevant soil data as the target variables. However, it is important to note that other datasets (e.g., yield and proximal sensing) can also be utilized, depending on the application, given that management zones have a broad scope and serve multiple purposes.
Dense soil sampling was implemented across the entire study area using a regular 40 × 40 m grid, which corresponds to a density of 6 sampling points per hectare (
Figure 2). Each sampling point constitutes a composite sample, generated from six subsamples collected within a 5 m radius of the central point using an instrumented quad bike with an automated auger. Samples were collected at a depth of 0–20 cm, which is the recommended depth for fertilizer prescriptions in grain-producing areas [
28]. The implemented high sampling density provided the necessary resolution to test the efficiency of the management zones in grouping the attributes of interest. The composite samples subsequently underwent chemical and physical determinations at a certified soil analysis laboratory. The study selected three soil attributes for management zone segmentation: available phosphorus (P, mg dm
−3), available potassium (K, mmolc dm
−3), and cation exchange capacity (CEC, mmolc dm
−3). Phosphorus and potassium merit inclusion because their status dictates the most frequent fertilization replenishment in Brazilian agricultural areas. Similarly, the study incorporates Cation Exchange Capacity (CEC) due to its strong influence on overall soil fertility and its relationship with liming requirements for soil correction in Brazil. The soil sampling dataset is available at the University of Campinas Research Data Repository (ReDU) [
29].
The proposed methodology captures variability in the study areas by subdividing the field into MZ segmentation, which functions analogously to blocking, thereby favoring the identification of internally homogeneous zones for the selected soil attributes. This process simultaneously reduces the field’s intrinsic variability and enables uniform management within each MZ. Furthermore, well-segmented MZ supports a sampling plan that accurately represents the attributes of interest, which, in turn, increases fertilizer use efficiency in the context of precision agriculture.
The study utilized seven covariates for MZ segmentation (
Figure 3): apparent magnetic susceptibility of the soil (SMa); a digital elevation model (DEM) from the SRTM mission; soil clay and sand contents; the normalized mean of five grain yield maps; a synthetic image of the Enhanced Vegetation Index (EVI) from Sentinel-2 MSI; and a synthetic image of VH-polarization backscatter from Sentinel-1 SAR. EVI and VH data were obtained at the soybean vegetative peak of each year (2019–2024), and the per-pixel mean was subsequently computed for each index [
17,
30]. This set of covariates merits inclusion due to its empirical relationship with soil attributes and its established use in farm and field-scale studies focusing on precision agriculture [
17,
30,
31,
32,
33,
34] and on management-zone segmentation [
8,
22,
23,
25,
35,
36]. The SMa, clay, sand, and yield datasets originated as point samples; therefore, we generated continuous surfaces via ordinary kriging. Specific interpolation resolutions were applied to validate the resampling algorithm: 10 m for SMa and the mean yield, and 5 m for the clay and sand content. Conversely, DEM, EVI, and VH were acquired directly in raster format and required no interpolation, with a 30 m (DEM) and 10 m (EVI and VH) resolution. The entire set of covariates was obtainable through open-source plugins (Smart-Map, EasyDEM, RAVI, and AGLgis) available in QGIS.
To specifically demonstrate the plugin’s ability to handle heterogeneity across layers (
Figure 3), the study deliberately utilized raster files with differing spatial extents and Coordinate Reference Systems (CRS). Examples of this heterogeneity include the VH layer extending beyond the working boundary and the EVI with pixels clipped along surrounding field access roads. Furthermore, the data spanned different CRS, such as WGS 84 geographic (EPSG:4326) and WGS 84/UTM 23S (EPSG:32723). To promote the use of open data and code, the full dataset used in this work is available in [
37].
The study initially imported the seven covariates and the field boundary (in vector format) into
Precision Zones. The spatial resolution was set to 10 m, and the execute command was run. This action resampled all rasters to a standard grid, ensuring pixel co-location across layers, and simultaneously clipped the images to the boundary extent. Given the number of layers and their potential collinearity, the routine performed Principal Component Analysis (PCA) to generate linear synthetic variables (PCs) [
26,
27] commonly used for management zone segmentation [
13,
22]. To determine the optimal number of management zones, the routine utilized the Elbow [
38] and Silhouette [
39] indices, allowing the identification of the ideal number of zones through the curves displayed in the plugin layout [
39]. Finally, the zones were generated, and both the chart and the CSV file containing the Elbow and Silhouette matrix were exported.
The final step for refining the zones involved reducing spurious noise. Because unsupervised classification (which groups pixels solely by value similarity) can produce small, spurious clusters of pixels from one zone embedded in another, the Precision Zones’ Modal Filter was applied to mitigate such noise. This filter performs a categorical majority operation on the zone raster, replacing the value of each pixel with the most frequent class in its neighborhood. For this case study, we set the radius to r = 5 pixels, corresponding to a 5 × 5 window around the central pixel.
Evaluation of the MZ efficiency in grouping soil data occurred within the Analyses tab of
Precision Zones. We imported the soil sampling points as a CSV file using UTM coordinates. To assess performance in aggregating homogeneous regions of P, K, and CEC separately, the plugin calculated the area-weighted Variance Reduction (VR%) (Equation (1)), as used in [
23,
25], and showed the respective boxplots, allowing a visual inspection of the zoning performance. The VR% quantifies how effectively the MZ segmentation captures the meta-attribute homogeneity across the field. This combination of the VR% metric and visual assessment enables verification that the MZ not only reduces within-zone variability but also maintains clear contrasts between zones. Moreover, the plugin can export several other statistical metrics, such as the coefficient of variation (CV%) and the within-zone standard deviation of the target variables, providing further support for selecting the number of zones [
24].
where:
C: number of MZ
Wmz,i: area of zone (m2)
Wmz,i: area of zone (m2)
WT: total field area (m2)
Vmz,i: variance of the data within zone
VT: variance of the data over the entire area
Although VR% is a robust metric for assessing management zone performance, some issues hinder its use and interpretation. First, it is observed that different studies operationalize the VR% calculation with minor methodological variations, which reduces direct comparability across studies [
18,
23,
25,
40]. Therefore, in this study, we explicitly define and standardize the VR% formulation, including area weighting and a full description of all terms in the equation (Equation (1)), to make the calculation transparent and reproducible. In addition, VR% is typically reported only as a percentage value, without a standardized interpretation, impairing intuitive evaluation by ordinary practitioners. Thus, based on tests we have conducted on management zones implementation and aiming to simplify the interpretation of results, as well as to standardize comparisons across attributes and different covariate combinations, we propose grouping VR% values into performance classes (
Table 1). This classification enables a more direct interpretation of the results, especially because VR% is still uncommon as a validation metric in this context, and it makes findings more communicable and comparable, analogous to classification schemes used for other model-validation metrics, such as the ratio of performance to interquartile range (RPIQ) [
41], which is highly used and cited in the literature.