Change analysis worked example#
What this demonstrates#
This skill measures material change between exactly two authoritative optical EO acquisitions. It aligns bounded staged rasters, measures observable coverage and normalized difference, extracts ranked regions, and writes hashed evidence images. A host vision provider may then interpret one focused region, but interpretation never replaces the deterministic measurement.
Workflow#
Stage |
Host service or agent |
Offline skill script |
|---|---|---|
Select scenes |
Search the authorized catalog for two co-located times. |
None. |
Select assets |
Inspect media contract |
Reject missing asset provenance, companions, or incompatible media. |
Stage rasters |
Verify size and checksum. Stage bounded native affine GeoTIFF/JP2 media, or request a bounded |
Accept only self-contained files beneath the staging directory. |
Measure change |
None. |
Reproject to bounded EPSG:6933, normalize, measure observable difference, extract regions, and hash PNG evidence. |
Interpret evidence |
Run the versioned |
None; no model call is embedded in the skill script. |
Example input#
The checked-in fixtures are two synthetic, 16×16 affine GeoTIFFs. Their media fields model the
typed inspection response and bind each file to one exact asset. A comparable affine JPEG 2000
asset is also accepted when media_type is image/jp2 and the staged filename ends in .jp2.
The host also retains acquisition time outside the strict script payload:
{
"before_acquired_at": "2024-07-01T10:00:00Z",
"after_acquired_at": "2025-07-01T10:00:00Z"
}
{
"before": {
"collection": "imagery",
"record_id": "optical-2024",
"asset_id": "rgb-2024",
"media_contract_version": "2.0",
"media_type": "image/tiff",
"media_role": "manifest",
"georeferencing_method": "affine_crs",
"file": "change-before.tif"
},
"after": {
"collection": "imagery",
"record_id": "optical-2025",
"asset_id": "rgb-2025",
"media_contract_version": "2.0",
"media_type": "image/tiff",
"media_role": "manifest",
"georeferencing_method": "affine_crs",
"file": "change-after.tif"
},
"threshold": 0.25,
"minimum_region_pixels": 4,
"region_limit": 10,
"max_pixels": 10000
}
If inspection instead reports embedded_gcps or safe_annotation_gcps, the host requests the
bounded georeferenced-window and stages its image/tiff response. The input retains the source
asset ID and reported georeferencing method so the result does not lose lineage.
Example output#
The fixtures produce this geo_change.v3 result:
{
"ok": true,
"status": "detected",
"data": {
"schema_version": "geo_change.v3",
"status": "detected",
"analysis_bounds_wgs84": [
0.0,
0.0,
0.00016582668497940498,
0.00012541810400852347
],
"before": {
"collection": "imagery",
"record_id": "optical-2024",
"asset_id": "rgb-2024",
"media_contract_version": "2.0",
"media_type": "image/tiff",
"media_role": "manifest",
"georeferencing_method": "affine_crs",
"sha256": "e8a7e7fc0133712af2c4906a844dd27ce94af96951b438ed3685adbe865a8a0d"
},
"after": {
"collection": "imagery",
"record_id": "optical-2025",
"asset_id": "rgb-2025",
"media_contract_version": "2.0",
"media_type": "image/tiff",
"media_role": "manifest",
"georeferencing_method": "affine_crs",
"sha256": "2584adabfaf828ee73444c9429022d5e6e41a8a6f5a2c13f5bea4a8b420239ba"
},
"grid": {
"crs": "EPSG:6933",
"width": 16,
"height": 16,
"pixel_area_m2": 1.0,
"coarsened": false,
"extent_basis": "union_of_authoritative_raster_extents"
},
"quality": {
"alignment": "metadata_aligned",
"observable_pixels": 256,
"observable_fraction": 1.0,
"source_valid_pixels": {"before": 256, "after": 256},
"source_observable_coverage": {"before": 1.0, "after": 1.0},
"minimum_source_observable_coverage": 1.0
},
"measurement": {
"threshold": 0.25,
"changed_pixels": 211,
"changed_area_km2": 0.000211,
"changed_fraction_of_observable": 0.82421875,
"normalization": "per_scene_bandwise_p02_p98"
},
"regions": [
{
"pixel_count": 211,
"area_km2": 0.000211,
"bbox_wgs84": [0.0, 0.0, 0.00016582668497940498, 0.00012541810400852347],
"mean_severity": 0.5547580122947693,
"maximum_severity": 0.9499806761741638
}
],
"evidence": [
{
"kind": "normalized_absolute_difference",
"file": "change-out/difference.png",
"sha256": "3406675587fe0e0366dabbef47f87b8255a741aac533054b56925406391b5445"
},
{
"kind": "thresholded_change_mask",
"file": "change-out/change-mask.png",
"sha256": "f50cb1bf876870a2490ba381dc618f9e078b1453a70c606ddfa8c457d8870fa1"
}
],
"limitations": [
"Metadata alignment is not an independent sub-pixel registration estimate.",
"Per-scene percentile normalization can suppress scene-wide brightness change.",
"Changed pixels do not establish object identity or cause."
]
},
"warnings": [],
"truncated": false,
"provenance": {"implementation": "analyze_change.py/3.0.0"}
}
Human-readable result#
Between the host-held acquisition times 2024-07-01T10:00:00Z and
2025-07-01T10:00:00Z, all 256 analysis cells are observable and 211 exceed the 0.25 normalized
difference threshold. One qualifying region covers 211 m². The status is detected, but the
measurement alone does not identify an object or establish why the pixels changed.
Optional semantic interpretation#
After measurement, the host may ask its versioned vision provider a focused question about the bounded before/after crop for the largest measured region. A representative provider response is:
{
"protocol_revision": "geonemo-change-vision/v1",
"answer": "The later crop is consistent with a new rectangular roof or paved surface, but temporary materials or seasonal surface exposure remain plausible.",
"observations": ["A rectangular bright region is visible only in the later crop."],
"interpretations": ["The region may be a roof or paved surface."],
"uncertainties": ["The bounded images do not distinguish a permanent structure from temporary materials."],
"limitations": ["The images do not establish construction cause or timing."]
}
Human-readable combined result: the deterministic mask establishes substantial observable change in the region. The schema-valid host vision result separates its observation, possible interpretation, uncertainty, and limitation. Provider/model alias and prompt revision are recorded by the host alongside this response, not inserted into the strict provider response object. It is not evidence of construction cause or timing.
Reproduce#
Run from the skill directory with Python 3 and uv installed (uv==0.8.13 is used in CI); no
catalog or model access is required. On a clean machine, the first command may download only the
exact packages in the adjacent lock. The lock does not vendor wheels, so add --offline only after
that cache bootstrap:
work_dir="$(mktemp -d)"
mkdir "$work_dir/change-out"
base64 --decode evals/files/change-before.tif.b64 > "$work_dir/change-before.tif"
base64 --decode evals/files/change-after.tif.b64 > "$work_dir/change-after.tif"
printf '%s\n' '{"before":{"collection":"imagery","record_id":"optical-2024","asset_id":"rgb-2024","media_contract_version":"2.0","media_type":"image/tiff","media_role":"manifest","georeferencing_method":"affine_crs","file":"change-before.tif"},"after":{"collection":"imagery","record_id":"optical-2025","asset_id":"rgb-2025","media_contract_version":"2.0","media_type":"image/tiff","media_role":"manifest","georeferencing_method":"affine_crs","file":"change-after.tif"},"threshold":0.25,"minimum_region_pixels":4,"region_limit":10,"max_pixels":10000}' \
| uv run --locked --script scripts/analyze_change.py analyze --staging-dir "$work_dir" --output-dir change-out \
| python3 -m json.tool
The command also writes change-out/difference.png and change-out/change-mask.png beneath the
staging directory. Verify their returned hashes before presenting them as evidence.
Limitations#
detectedmeans the bounded observable comparison exceeds the threshold and region criteria.no_material_changemeans adequate observable coverage was measured and no qualifying change was found. It is not a claim that nothing changed outside the observed data or threshold.indeterminatemeans coverage or data quality is insufficient; never rewrite it as no change.Unsupported inputs such as absent georeferencing fail with
status: erroranderror.code: invalid_input; they are not successfulunsupportedresults.Metadata alignment is not a sub-pixel registration estimate. Normalization may suppress scene-wide brightness shifts. Changed pixels establish neither identity nor cause.
If catalog search, inspection, bounded media retrieval, georeferenced-window, or requested semantic comparison is unavailable, report that missing capability instead of fetching an arbitrary URL or inventing an interpretation.