Image regions tool
The ImageRegionsTool, which an agent sees as FindImageRegions, reads a raster and returns the regions in it as labelled polygons — cropland, water, built-up, a burn scar — with areas. The work runs through _ingest/pipeline/_simulate; the labelled polygons are the tool's return value.
Two backends, one contract
When you pass values (class ids to keep), the tool uses vectorize: it reads the labels from the pixels. score is 1.0 (the class is read from the pixel value).
Otherwise it uses image_segment: a segmentation model finds the regions. score is the model's confidence. Configure that model on the image_segment ingest processor. This tool takes no separate model_id.
Every answer names which backend produced it.
Parameters
| Parameter | Required | Description |
|---|---|---|
uri | Yes | The raster to read (https, s3, gs, azure). |
band | No | Which band holds the classes, for vectorize. |
values | No | Comma-separated class values to keep. Their presence selects vectorize. |
window | No | Pixel window to read, as x,y,width,height. |
max_regions | No | How many regions to describe. Default is 20. |
Register a flow agent that runs the ImageRegionsTool
POST /_plugins/_agent/agents/_register
{
"name": "Raster_Agent",
"type": "flow",
"description": "reads what is in a raster",
"tools": [
{
"type": "ImageRegionsTool",
"name": "DemoFindImageRegions"
}
]
}
POST /_plugins/_ml/agents/<agent_id>/_execute
{
"parameters": { "uri": "https://example.com/scene.tif" }
}
Related tools
- Features already in an index:
FindFeatures - What changed between two dates:
FindChanges