Skip to main content
Version: 0.13.0

Change detection tool

Introduced 0.13.0

The ChangeDetectionTool, which an agent sees as FindChanges, compares two time windows over indexed regions. The answer reports, per class, what appeared, disappeared, grew, and shrank.

Set time_field to the capture-time field on each region. The vectorize processor writes captured_at when you set that ingest parameter. Dates are ISO-8601 (2024-07-12 or a comma-separated pair 2024-07-01,2024-07-07). Call WhenWasThisImaged to choose windows that contain documents.

Windows

baseline and compare are dates. A single date means that whole day; a comma-separated pair is an inclusive range. The answer repeats the windows it used.

When the baseline window has no documents, the answer states that the baseline is empty and names WhenWasThisImaged.

Totals and regions

By default the tool compares class totals — how many regions of each label, and how much of measure_field they carry — in one search.

Set detail to regions to name the individual polygons that appeared and left. The answer says which pass ran.

Parameters

ParameterRequiredDescription
indexYesThe index holding the regions.
time_fieldYesThe date field holding when each document was captured.
baselineYesThe earlier window: a date, or a comma-separated pair.
compareYesThe later window: a date, or a comma-separated pair.
label_fieldNoThe field holding each region's class or label.
measure_fieldNoA numeric field summed per class (typically area).
queryNoA phrase that restricts which regions count.
areaNoAn area of interest, as WKT.
fieldNoThe geometry field area is tested against.
detailNoSet to regions to name individual polygons.

Register a flow agent that runs the ChangeDetectionTool

POST /_plugins/_agent/agents/_register
{
"name": "Change_Agent",
"type": "flow",
"description": "compares two dates over indexed regions",
"tools": [
{
"type": "ChangeDetectionTool",
"name": "DemoFindChanges",
"parameters": {
"index": "land_cover",
"time_field": "captured_at",
"label_field": "label",
"measure_field": "area"
}
}
]
}
POST /_plugins/_ml/agents/<agent_id>/_execute
{
"parameters": {
"baseline": "2024-07-12",
"compare": "2024-07-19"
}
}