Precision Ag Yield Zone Analysis
Purpose
Precision AG Yield Zone Intelligence analyzes yield variability within fields, clusters yield-similar areas into management zones, and relates zones to underlying soil, topography, and management drivers. Enables hypothesis-driven precision management.
Typical Questions This Tool Helps Answer
- Which management zones have the highest yield stability score and which have the lowest, and how does adding terrain context change the zone boundaries?
- When I vary the number of zones from 3 to 6 using the same yield surface, do zone patterns remain spatially consistent enough to support stable management prescriptions?
- Which areas of the field have low zone confidence scores, indicating transition zones where the management class assignment is least certain?
Background
Precision agriculture workflows model spatial heterogeneity in soil, crop condition, trafficability, or yield using a combination of remote sensing, terrain context, and machine telemetry. Agronomic interpretation is strongest when temporal conditions and management history are considered alongside the map outputs.
Users should treat these models as decision-support surfaces for scouting, sampling, and intervention targeting. Confidence, QA flags, and scenario sensitivity should guide where to act first.
Yield-zone intelligence partitions fields into management-consistent productivity zones by combining yield history and contextual drivers. Zones should be treated as intervention hypotheses and validated agronomically.
Methodological Considerations
- Align input timing with agronomic windows; stale observations reduce actionability even when model quality is high.
- Use QA/confidence indicators to drive scouting and sampling intensity.
- Reassess thresholds across season stages so intervention logic tracks crop development dynamics.
Practical Interpretation Pitfalls
High map contrast is not always agronomic significance; validate intervention zones with field observations before broad prescription changes.
Inputs
| Argument | Type | Required | Geometry / Type Constraints | Description |
|---|---|---|---|---|
| yield_surface | Raster | Yes | Must be a readable raster. | Primary yield or normalized productivity surface. |
| terrain_context | Raster | No | Must be a readable raster. It is resampled to the yield_surface grid if needed. | Optional terrain proxy such as wetness or slope. |
Parameters
| Argument | Type | Required | Default | Description |
|---|---|---|---|---|
| profile | String | No | balanced | Supported values: fast, balanced, conservative. Changes how strongly terrain moderates the stability score. |
| zone_count | Integer | No | 4 | Number of management zones. Must be between 2 and 8. |
| max_zone_features | Integer | No | 5000 | Maximum number of polygon regions written to the GeoPackage. Must be greater than 0. |
| sweep_spec | JSON object | No | null | Optional sweep specification. When supplied, the workflow executes multi-run sweeps and emits sweep diagnostics. |
| output_prefix | String | Yes | - | Prefix used to derive all output artifact names. Must not be empty. |
The runtime also accepts the legacy alias output anywhere output_prefix would be used.
Outputs
Output artifact keys below are runtime outputs, not input parameters.
| Artifact | Runtime Output Key | Type | What It Contains |
|---|---|---|---|
Yield stability raster (${prefix}_yield_stability.tif) | yield_stability | GeoTIFF raster | Per-cell stability score in the range [0, 1]. |
Management zones raster (${prefix}_management_zones.tif) | management_zones | GeoTIFF raster | Per-cell integer zone assignments from 1 to zone_count. |
Management zones vector (${prefix}_management_zones.gpkg) | management_zones_vector | Polygon vector | Layer management_zones with fields ZONE_ID, ZONE, STABILITY, and CONF. One feature is written per contiguous zone region until the cap is reached. |
Zone confidence raster (${prefix}_zone_confidence.tif) | zone_confidence | GeoTIFF raster | Per-cell confidence score in the range [0, 1]. |
| Sweep run matrix (optional) | run_matrix_summary | CSV | Per-run matrix with parameter overrides and zone-confidence metrics. |
| Sweep sensitivity report (optional) | sensitivity_report | JSON | Sweep summary including normalized span and stability_class. |
| Sweep sensitivity report (optional) | sensitivity_report_html | HTML | Rendered sweep report. |
| Sweep stability map (optional) | stability_map | GeoTIFF | Per-cell sweep stability classes (3=high, 2=medium, 1=low). |
Summary contract (${prefix}_summary.json) | summary | JSON | Summary contract with top-level keys workflow, schema_version, generated_at_utc, schema_migration_notes, error_taxonomy, inputs, parameters, warnings, summary, output_semantics, confidence_contract, interpretation_warnings, and outputs. |
Optional report (${prefix}_report.html) | html_report | HTML | HTML rendering of the same summary content. |
Important summary keys
| Key | Meaning |
|---|---|
inputs | Contains yield_surface and terrain_context. |
parameters | Contains profile, zone_count, and max_zone_features. |
warnings | Holds truncation messages if the vector layer was capped. |
summary.valid_cells | Number of non-nodata cells assigned to zones. |
summary.zone_histogram | Per-zone cell counts. |
summary.zone_features_written | Number of vector features actually written. |
summary.zone_features_candidate_total | Number of contiguous regions detected before truncation. |
summary.zone_features_omitted | Number of omitted vector regions. |
summary.zone_vector_truncated | true when the GeoPackage is incomplete because of the feature cap. |
output_semantics | Machine-readable semantic tags for zone outputs and confidence diagnostics. |
confidence_contract | Standardized confidence metadata including method and low-confidence summary fields. |
interpretation_warnings | Explicit warnings about planning interpretation and transition-zone validation. |
outputs | Contains paths for yield_stability, management_zones, management_zones_vector, zone_confidence, and summary. |
Returned payload keys
The workflow returns these output keys:
yield_stabilitymanagement_zonesmanagement_zones_vectorzone_confidencerun_matrix_summary(withsweep_spec)sensitivity_report(withsweep_spec)sensitivity_report_html(withsweep_spec)stability_map(withsweep_spec)summaryhtml_report
Example
import whitebox_workflows as wbw
env = wbw.WbEnvironment()
env.precision_ag_yield_zone_intelligence(
yield_surface="yield_2024_interpolated.tif",
terrain_context="wetness_index.tif",
profile="balanced",
zone_count=4,
max_zone_features=5000,
output_prefix="yield_zones_2024",
)
References
- Stafford, J. V., & Werner, B. (2002). "Challenges for Practical Exploitation of Precision Farming." J. Agric. Eng. 33(1), 37-48.
Parameter Interaction Notes
profilechanges the relative influence of yield and terrain on the stability score.zone_countaffects both the number of classes and how narrow each confidence band becomes.max_zone_featuresonly affects the vector layer, not the raster outputs, so truncation can occur even when the rasters are fully valid.- If you omit
terrain_context, the workflow uses a neutral terrain term and the result becomes mostly yield-driven.
QA and Acceptance Criteria
- Verify the example uses the real runtime argument names.
- Verify
zone_countis within[2, 8]andmax_zone_features > 0. - Verify the GeoPackage fields are exactly
ZONE_ID,ZONE,STABILITY, andCONF. - Verify
summary.jsoncontains the documented top-level and nested keys. - If you intentionally cap
max_zone_features, verifywarningsandsummary.zone_vector_truncatedreport that truncation. - Verify the returned payload includes
yield_stability,management_zones,management_zones_vector,zone_confidence,summary, andhtml_report.
The workflow fails if required rasters cannot be read, if terrain_context still does not match the yield_surface grid after harmonization, if profile is unsupported, if zone_count falls outside [2, 8], if max_zone_features is 0, or if output_prefix / output is provided as an empty string.
Advanced Operational Guidance
- Use the rasters as the primary analysis outputs and the GeoPackage as a delivery convenience layer.
- Always check
summary.zone_vector_truncatedbefore distributing the vector layer downstream. - Keep scenario prefixes unique; the workflow writes a family of files from the same prefix.
- If terrain context comes from a different grid, inspect pilot runs because bilinear harmonization can soften abrupt terrain transitions.
Implementation Patterns
- Baseline run: omit
terrain_contextand produce a yield-driven zoning baseline. - Terrain-aware run: add
terrain_contextand compare shifts inzone_histogramand vector fragmentation. - Sensitivity run: vary
profileandzone_countto see whether management interpretations are stable. - Delivery run: choose a
max_zone_featureslarge enough to avoid truncation or explicitly document the truncation before handoff.
Related Tools
precision_irrigation_optimizationyield_data_conditioning_and_qaremote_sensing_change_detection
When To Use This Workflow
Use this workflow when you need an interpretable zoning package for field operations rather than just a classified raster. It is especially useful when you need to compare management scenarios and document whether the vector delivery layer is complete.
What this workflow helps you do:
- Build repeatable management zones from one required raster input.
- Compare scenarios through
profile,zone_count, and terrain inclusion. - Deliver both analysis rasters and a vector layer with explicit truncation reporting.
Results Delivery Checklist
- Deliver the three rasters, the GeoPackage, the JSON summary, and the HTML report together.
- Record the final
profile,zone_count, andmax_zone_featuressettings. - State clearly whether
terrain_contextwas used. - Check and report
summary.zone_vector_truncatedbefore distributing the GeoPackage. - Use a distinct
output_prefixfor every scenario package.
Common Questions
Q: Why can zone_confidence be low inside a zone that looks spatially coherent?
A: Confidence is based on how close a cell’s score is to the center of its assigned zone band, not on whether the polygon looks smooth on a map.
Q: What is the most common misread of management_zones_vector?
A: Treating it as a complete zone layer without checking summary.zone_vector_truncated. The rasters can be complete even when the GeoPackage is capped.
Q: Which settings matter most when testing scenario sensitivity?
A: zone_count and profile. zone_count changes class structure, while profile changes how strongly terrain influences the stability score.
Q: How should operational teams choose between the rasters and the GeoPackage?
A: Use the rasters as the analytic source of truth and use the GeoPackage for delivery only after confirming the summary shows no unacceptable truncation.