Imagery discovery worked examples#
What this demonstrates#
This skill searches an authoritative bounded catalog, ranks coverage hotspots and aligned
acquisition sets, and verifies genuine valid-pixel overlap for exact inspected media assets. The
catalog stage can mix EO and SAR records. The raster stage accepts self-contained GeoTIFF and JPEG
2000 (image/jp2) inputs under media contract 2.x.
Workflow#
Stage |
Host service or agent |
Offline skill script |
|---|---|---|
Discover records |
Search one authorized collection with bounded spatial, temporal, text, and metadata filters. |
None. |
Rank catalog geometry |
Preserve the exact returned candidate list and completeness warnings. |
Compute hotspots, aligned sets, common coverage, IoU, and GeoJSON from WGS84 catalog bounding boxes. |
Select media |
Inspect contract |
Reject missing or ambiguous asset provenance. |
Stage pixels |
Verify hashes and bounds. An |
Reproject dataset-valid masks to a bounded equal-area grid and measure overlap. |
The scripts never search the service, fetch a URL, choose an asset, or invent georeferencing from a catalog envelope.
Resolve a copied filename#
For S2A_MSIL2A_20260807T065321_N0512_R020_T39RZH_20260807T120617.SAFE, call
catalog_search with this exact metadata filter:
{"collection":"sentinel-sample","filters":{"filename":"S2A_MSIL2A_20260807T065321_N0512_R020_T39RZH_20260807T120617.SAFE"},"limit":20}
Follow any cursor, then catalog_get_record with the returned collection and ID. Verify
metadata.filename before handing the record to the sensor workflow. Do not search embeddings
for this identifier or accept another date, tile, or satellite as a substitute. If the tool
reports an error, existence is unverified; if several exact IDs match, request disambiguation.
Example 1: describe a collection envelope safely#
For authoritative summary bounds
[44.503231, 20.666439116955395, 64.930779, 31.770567], run extent with the collection name and
record count. The result explicitly reports longitude from 44.503231°E to 64.930779°E and latitude
from 20.666439°N to 31.770567°N because bbox order is always
[west, south, east, north]. It labels the geometry collection_union_bbox and warns that the
roughly 2.5 million km² envelope can contain areas with no imagery. It does not translate the
coordinates into a country, sea, city, or other place name.
printf '%s\n' '{"collection":"sentinel-sample","record_count":592,"bounds":[44.503231,20.666439116955395,64.930779,31.770567]}' \
| python3 scripts/analyze_bbox_overlap.py extent \
| python3 -m json.tool
Example input#
Rank a mixed EO/SAR catalog result#
The host has already returned this complete, bounded candidate set. These identifiers and footprints are synthetic but have the same shape as GeoNeMo server catalog records.
{
"records": [
{
"collection": "sentinel-sample",
"record_id": "s2-a",
"bbox": [55.0, 25.0, 55.2, 25.2],
"modality": "eo",
"product": "S2_L2A",
"sensor": "sentinel-2"
},
{
"collection": "sentinel-sample",
"record_id": "s1-a",
"bbox": [55.02, 25.02, 55.18, 25.18],
"modality": "sar",
"product": "S1_GRD",
"sensor": "sentinel-1"
},
{
"collection": "sentinel-sample",
"record_id": "s2-b",
"bbox": [55.08, 25.08, 55.24, 25.24],
"modality": "eo",
"product": "S2_L2A",
"sensor": "sentinel-2"
}
],
"set_size": 2,
"required_modalities": ["eo", "sar"],
"minimum_coverage": 0.5,
"minimum_iou": 0.3,
"rank_by": "alignment",
"limit": 3
}
Example output#
Representative structured output:
{
"ok": true,
"status": "complete",
"data": {
"geometry_basis": "catalog_bbox",
"exactness": "exact_within_candidates",
"evaluated_combinations": 3,
"evaluation_truncated": false,
"result_limit_applied": false,
"sets": [
{
"records": [
{"collection": "sentinel-sample", "record_id": "s1-a"},
{"collection": "sentinel-sample", "record_id": "s2-a"}
],
"common_bbox": [55.02, 25.02, 55.18, 25.18],
"common_location": {
"named_bounds": {
"west_longitude": 55.02,
"south_latitude": 25.02,
"east_longitude": 55.18,
"north_latitude": 25.18
},
"center": {"longitude": 55.1, "latitude": 25.1},
"display_location": "25.02° N to 25.18° N; 55.02° E to 55.18° E"
},
"common_area_km2": 286.6371123266517,
"minimum_common_coverage": 0.6400001169731009,
"minimum_pairwise_iou": 0.6400001169731009,
"positional_accuracy": "unknown",
"geometry_basis": "catalog_bbox"
}
]
},
"warnings": [],
"truncated": false,
"provenance": {"implementation": "analyze_bbox_overlap.py/2.2.0"}
}
Human-readable result#
The best qualifying pair is s1-a plus s2-a. Their catalog envelopes
share about 286.64 km², cover at least 64% of either envelope, and have pairwise IoU 0.64. This is
catalog-envelope evidence only; it does not establish valid pixels, registration, or similarity.
Running the same records with hotspots, minimum_count: 2, and limit: 3 finds a maximum depth
of three over [55.08, 25.08, 55.18, 25.18] and emits the overlap as GeoJSON.
Its deterministic display location is 25.08° N to 25.18° N; 55.08° E to 55.18° E; agents use
that field instead of relabeling positional GeoJSON coordinates.
Reproduce#
Reproduce the aligned-set result from the skill directory:
printf '%s\n' '{"records":[{"collection":"sentinel-sample","record_id":"s2-a","bbox":[55.0,25.0,55.2,25.2],"modality":"eo","product":"S2_L2A","sensor":"sentinel-2"},{"collection":"sentinel-sample","record_id":"s1-a","bbox":[55.02,25.02,55.18,25.18],"modality":"sar","product":"S1_GRD","sensor":"sentinel-1"},{"collection":"sentinel-sample","record_id":"s2-b","bbox":[55.08,25.08,55.24,25.24],"modality":"eo","product":"S2_L2A","sensor":"sentinel-2"}],"set_size":2,"required_modalities":["eo","sar"],"minimum_coverage":0.5,"minimum_iou":0.3,"rank_by":"alignment","limit":3}' \
| python3 scripts/analyze_bbox_overlap.py aligned-sets \
| python3 -m json.tool
Example 3: verify exact raster assets#
Typed inspection selected eo-rgb-042 directly from an affine asset. It selected vv-009 from a
SAR record with embedded GCPs, so the host staged the bounded georeferenced-window response as a
self-contained GeoTIFF. The second entry retains embedded_gcps as source provenance even though
the staged window itself has an affine transform.
{
"rasters": [
{
"collection": "imagery",
"record_id": "eo-042",
"asset_id": "eo-rgb-042",
"media_contract_version": "2.0",
"media_type": "image/tiff",
"media_role": "manifest",
"georeferencing_method": "affine_crs",
"file": "overlap-a.tif"
},
{
"collection": "imagery",
"record_id": "sar-009",
"asset_id": "vv-009",
"media_contract_version": "2.0",
"media_type": "image/tiff",
"media_role": "manifest",
"georeferencing_method": "embedded_gcps",
"file": "overlap-b.tif"
}
],
"max_pixels": 10000
}
The included synthetic fixtures produce:
{
"ok": true,
"status": "complete",
"data": {
"geometry_basis": "reprojected_dataset_valid_masks",
"extent_basis": "union_of_authoritative_raster_extents",
"analysis_bounds": [0.0, 0.0, 10.0, 10.0],
"exactness": "native_or_coarser_valid_mask_grid",
"target_crs": "EPSG:6933",
"grid": {
"width": 10,
"height": 10,
"pixel_area_m2": 1.0,
"coarsened": false
},
"valid_overlap_pixels": 80,
"valid_union_pixels": 100,
"valid_overlap_area_km2": 0.00008,
"valid_union_area_km2": 0.0001,
"valid_mask_iou": 0.8,
"minimum_valid_coverage": 0.8,
"rasters": [
{
"collection": "imagery",
"record_id": "eo-042",
"asset_id": "eo-rgb-042",
"media_contract_version": "2.0",
"media_type": "image/tiff",
"media_role": "manifest",
"georeferencing_method": "affine_crs",
"file": "overlap-a.tif",
"sha256": "f075e9a994dbcd6bcc93e880f6c6327b1aa3364c401f7b44fdd46f819ffab62d",
"valid_pixels_in_analysis_grid": 100,
"overlap_coverage": 0.8
},
{
"collection": "imagery",
"record_id": "sar-009",
"asset_id": "vv-009",
"media_contract_version": "2.0",
"media_type": "image/tiff",
"media_role": "manifest",
"georeferencing_method": "embedded_gcps",
"file": "overlap-b.tif",
"sha256": "4a1395596fc1a7b629c4c929bbd8d50d63af6035c5ff1d5f7a1a23eb23b0f7ed",
"valid_pixels_in_analysis_grid": 80,
"overlap_coverage": 1.0
}
],
"limitations": [
"Mask overlap does not prove registration, cloud-free content, or semantic similarity."
]
},
"warnings": [],
"truncated": false,
"provenance": {"implementation": "verify_raster_overlap.py/3.0.0"}
}
Human-readable result: all 80 valid SAR-window pixels overlap valid EO pixels. The union contains
100 valid cells, so valid-mask IoU is 0.8 and minimum per-raster overlap coverage is 0.8. The
result binds both exact asset IDs and hashes. A directly staged affine JPEG 2000 source uses the
same entry shape with media_type: image/jp2 and a .jp2 file.
Reproduce it from the skill directory with Python 3 and uv installed (uv==0.8.13 is used in
CI), using the checked-in evaluation rasters. 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 the cache has been populated:
work_dir="$(mktemp -d)"
base64 --decode evals/files/overlap-a.tif.b64 > "$work_dir/overlap-a.tif"
base64 --decode evals/files/overlap-b.tif.b64 > "$work_dir/overlap-b.tif"
printf '%s\n' '{"rasters":[{"collection":"imagery","record_id":"eo-042","asset_id":"eo-rgb-042","media_contract_version":"2.0","media_type":"image/tiff","media_role":"manifest","georeferencing_method":"affine_crs","file":"overlap-a.tif"},{"collection":"imagery","record_id":"sar-009","asset_id":"vv-009","media_contract_version":"2.0","media_type":"image/tiff","media_role":"manifest","georeferencing_method":"embedded_gcps","file":"overlap-b.tif"}],"max_pixels":10000}' \
| uv run --locked --script scripts/verify_raster_overlap.py verify --staging-dir "$work_dir" \
| python3 -m json.tool
Limitations#
completemeans the bounded computation finished; inspecttruncated,exactness, and warnings before describing it as exhaustive.best_evaluatedmeans the aligned-set combination budget was reached. It is not a global best.Catalog bounding-box overlap is a shortlist, not pixel evidence.
Valid-mask overlap does not prove sub-pixel registration, cloud-free content, or semantic similarity.
unusablemeans at least one raster contributed no valid analysis-grid cells. Its zero overlap, coverage, or IoU values are not evidence that two observable rasters do not overlap.Missing catalog, inspection, media retrieval, or georeferenced-window capability is reported as a limitation. The skill does not scan arbitrary files or substitute catalog geometry.