SATeo
Home › Educational Guides › Time-Series Analytics
Time-Series Analytics

Polygon Zonal Statistics and Multi-Temporal Earth Observation Time Series

Aggregate vegetation, moisture, and backscatter metrics over vector boundaries directly in the cloud and stream compact JSON time series.

Why Statistical APIs Replace Raster Downloads for Vector Analytics

Most business applications in agriculture, insurance, and forestry ultimately care about numbers tied to vector boundaries—a parcel mean NDVI, a watershed snow-cover percentage, or a 90th-percentile drought score—rather than raw raster pixels. Downloading GeoTIFF files solely to run local zonal statistics wastes bandwidth, storage, and compute time.

A cloud Statistical API accepts a GeoJSON polygon, an evalscript defining target indices and cloud masks, and a temporal aggregation interval (such as 5-day, 10-day, or monthly buckets). It returns a few kilobytes of structured JSON containing sample counts, means, standard deviations, quantiles, and optional value histograms.

  • Zero raster storage required on client servers; responses arrive as compact JSON
  • Supports simultaneous calculation of multiple indices (e.g., NDVI, NDMI, NDRE) in one pass
  • Built-in valid vs. masked pixel counts track cloud coverage per time bucket
  • Quantiles (P10, P50, P90) reveal within-field spatial variability alongside the mean

Designing Temporal Buckets and Aggregation Intervals

Selecting the aggregation interval determines how noisy or smooth a time series appears. Five-day Sentinel-2 buckets capture rapid phenological transitions such as harvest mowing or sudden hail damage, whereas ten-day or dekadal intervals smooth out cloudy gaps across regions with frequent overcast skies.

Setting aggregation behavior to skip empty intervals or inspect noDataCount prevents downstream charting libraries from plotting artificial zeros during cloudy winter weeks. Interpolating missing dates only after verifying valid pixel percentages preserves scientific integrity.

Interpreting Percentiles and Histograms Over Heterogeneous Parcels

A simple arithmetic mean hides critical spatial anomalies inside large fields or diverse forest compartments. If half a parcel is waterlogged (NDVI 0.25) and half is vigorous (NDVI 0.85), the mean reports 0.55—looking deceptively average while masking severe crop loss.

Requesting percentiles (25th, 50th median, 75th) and 10-bin histograms inside the Statistical API payload exposes bimodal distributions immediately. A widening interquartile range (P75 minus P25) signals uneven emergence, irrigation nozzle failure, or localized pest outbreaks.

  • Use P50 (median) instead of mean when parcel borders risk stray mixed pixels
  • Track P75 - P25 spread as an automated field uniformity KPI
  • Use custom histogram bins to count exact hectares falling below stress thresholds

Scaling Across Thousands of Polygons Safely

Applications monitoring tens of thousands of farm cadastres or municipal parcels should normalize vector geometries before submission—repairing self-intersections, snapping ring orientation, simplifying overly dense GPS vertices, and setting spatial resolution (such as 10 m or 20 m) proportional to parcel area. Overly intricate GPS tracks with thousands of redundant vertices inflate request payloads without improving pixel sampling.

Splitting multi-polygon monitoring queues into parallel workers with bounded concurrency and exponential backoff respects API rate limits cleanly. Storing completed historical time buckets locally in a time-series database ensures daily cron updates only query the latest five-to-ten-day window rather than re-scanning entire multi-year archives on every refresh.

  • Simplify redundant sub-meter polygon vertices while keeping boundaries accurate to 1–2 meters
  • Persist completed historical intervals locally so incremental syncs query only recent dates
  • Log sampleCount and noDataCount alongside every stored observation for auditability

Statistical API Response Metrics and Analytical Applications

Output MetricJSON Field RoleSensitivity to OutliersPrimary Operational Use
meanAverage across clear pixelsModerateStandard regional baseline and seasonal curve plotting
stDevWithin-polygon dispersionHighDetecting uneven crop stands or mixed land cover
percentiles (P10/P50/P90)Order-statistic quartilesVery low (robust)Noise-resistant median vigor and tail stress tracking
sampleCount / noDataCountTotal vs. masked pixelsExact countQuality-gating cloudy intervals before charting
bins (Histogram)Pixel counts per intervalNoneArea-by-class reporting (e.g., flooded vs. dry ha)

Always divide valid pixels (sampleCount - noDataCount) by sampleCount to verify polygon coverage.

Worked Illustration: Detecting Irrigation Failure via Interquartile Spread

This worked illustration shows how Statistical API quantiles expose a broken center-pivot sector that an average NDVI metric would miss.

  1. Compare two 10-day Statistical API buckets for an 80-hectare irrigated field (8,000 pixels at 10 m).
  2. Week 1 (Healthy Uniform): mean = 0.76, P25 = 0.73, P50 = 0.77, P75 = 0.80 (IQR = 0.07).
  3. Week 2 (Pivot Quadrant Dry): mean = 0.65, P25 = 0.44, P50 = 0.72, P75 = 0.79 (IQR = 0.35).
  4. Evaluate uniformity trigger (IQR > 0.20): Week 2 IQR jumps 5x to 0.35 while P50 stays high, pinpointing localized sector stress.

Worked Illustration Summary: Tracking P75 minus P25 alongside the median flags localized quadrant failure immediately without downloading a single GeoTIFF.

Polygon Statistical API Implementation Checklist

  • Validate and close GeoJSON polygon rings (EPSG:4326) with no self-intersections prior to POST requests
  • Include an explicit dataMask band in the evalscript so masked clouds count into noDataCount
  • Request P25, P50, and P75 quantiles alongside mean for robust spatial diagnostics
  • Filter out output intervals where clear pixel fraction drops below 70% of polygon area
  • Match resolution (resx/resy in meters or degrees) to native sensor scale (10 m or 20 m)
  • Cache historical completed time buckets locally so daily updates only fetch new dates

Frequently Asked Questions

What happens if a polygon is smaller than a single 10 m pixel?

Sub-pixel polygons may register zero center-intersecting pixels at coarse resolutions. Request finer output resolution or ensure monitored geometries span at least 0.25 hectares for reliable Sentinel-2 sampling.

How do I convert histogram bin counts into exact hectares?

Multiply each bin's pixel count by the area of one pixel (for example, 10 m x 10 m = 100 sq m = 0.01 hectares) using an equal-area or UTM coordinate reference system.

Does the Statistical API support multi-polygon GeoJSON collections?

Yes, standard MultiPolygon geometries can be aggregated as a single entity, though splitting independent parcels into separate requests lets you inspect per-field clear coverage cleanly.

Can I run Statistical API queries on Sentinel-1 SAR as well as optical bands?

Yes. Outputting calibrated VV/VH backscatter in decibels from an evalscript works identically, delivering parcel-level soil moisture or flood area time series.

Primary Standards & Technical References

  • OGC Simple Features Implementation Standard — GeoJSON & Polygon Validity (RFC 7946)
  • ESA Copernicus Sentinel-2 Zonal Statistics & Biophysical Aggregation Best Practices
  • ISO 19107 Geographic Information — Spatial Schema for Vector Geometries

Related Earth Observation Guides