Points in Territory
points_in_territoryLists which account points from one point layer fall inside a territory polygon or a drive-time (isochrone) area. Per territory: point_count, metric_sums (metrics, else the layer's declared metric fields), and a sample of sample_size points (default 25, max 200; 500 across all territories) with label and metric fields, or only the fields you name. Counts and sums cover every inside point. The full list is never inline: it is in points_artifact, via download_url (GET with the API key) or share_with_user (one-hour key-less link for the user). Synchronous, read-only; needs map_session_id or ts_handle. territory_id names one leaf (id or unique display name), territory_ids several; omit both for every leaf in the TAL (tal_id, else the active or sole TAL). point_layer defaults to the sole layer with points; point_filter (e.g. {tier: 'Gold'}) filters before counting. A point counts in every containing polygon; overlaps lists shared points. Unknown ids return UNKNOWN_TAL_ID / UNKNOWN_TERRITORY_ID / UNKNOWN_POINT_LAYER with the available values.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "points_in_territory"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| fields | No | Point properties to keep on sample points and in points_artifact. Omitted: the sample carries label plus the metric fields, and the artifact carries every property. | |
| tal_id | No | Territory alignment to query. Defaults to the active TAL, or the sole TAL with leaf polygons. | |
| metrics | No | Numeric point columns to sum per territory. Defaults to the layer's declared metric fields. | |
| ts_handle | No | Territory Solution reference (tsh_...) from a build, ingest_accounts, import_geojson, import_designer_project, or get_map_visualization; Territory Solutions are not accepted inline. | |
| point_layer | No | Point layer id or exact unique label. Optional when the solution has one layer with points. | |
| sample_size | No | Points shown inline per territory; the server lowers it so at most 500 sample points come back across all territories. point_count and metric_sums always cover every inside point; points_artifact lists them all. | |
| point_filter | No | Optional attribute filter (column -> value or list of values, matched case-insensitively, e.g. {"tier": "Gold"}) applied to the point layer before counting and listing. | |
| territory_id | No | One leaf: its stable territory_id or exact unique display name. Mutually exclusive with territory_ids. | |
| territory_ids | No | Several leaves (stable ids or exact unique display names). With neither territory_id nor territory_ids, every leaf in the TAL. | |
| map_session_id | No | Open map session (msess_...) from get_map_visualization. Its Territory Solution is the input; omit ts_handle when set. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| error | No | Present when ok is false. | |
| result | No | Present when ok is true. | |
| warnings | No |