Skip to main content
Version: 0.13.0

Geo layer tool

Introduced 0.13.0

The GeoLayerTool, which an agent sees as FindFeatures, answers where are the things matching this?

It returns three complementary views of the same result:

  • A count and geographic extent.
  • A vector tile URL: a {index}/_mvt/{field}/{z}/{x}/{y} template for every matching feature.
  • A sample of features as GeoJSON.

Every answer states whether the listed features are the complete set or a sample, and it states that before the listing. The count comes from the search total, so a sample of twenty out of two million is reported as two million. POST a query body to the tile URL as on the vector tiles page.

Parameters

ParameterRequiredDescription
indexYesThe index to search.
fieldNoThe geometry field. If omitted, the tool discovers a geometry field in the index.
queryNoA query_string expression that narrows which features match. Omit it to match everything.
sampleNoHow many features to list as GeoJSON. Default is 10. The maximum is 50.

Register a flow agent that runs the GeoLayerTool

POST /_plugins/_agent/agents/_register
{
"name": "Features_Agent",
"type": "flow",
"description": "finds where matching features are",
"tools": [
{
"type": "GeoLayerTool",
"name": "DemoFindFeatures",
"parameters": {
"index": "districts"
}
}
]
}
POST /_plugins/_ml/agents/<agent_id>/_execute
{
"parameters": { "query": "airport" }
}