Geo layer tool
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
| Parameter | Required | Description |
|---|---|---|
index | Yes | The index to search. |
field | No | The geometry field. If omitted, the tool discovers a geometry field in the index. |
query | No | A query_string expression that narrows which features match. Omit it to match everything. |
sample | No | How 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" }
}
Related tools
- Density regions:
FindConcentrations - A path something already travelled:
FindTracks - A path on an indexed network:
FindRoute