Analyze Territories
analyzeComputes territory statistics for one or more alignments, i.e. how balanced the territories are and how alignments compare: account counts, declared metric totals (e.g. Revenue), workload hours, balance scores, and cross-TAL comparison; hypothetical_moves previews a realign. Input: map_session_id (the open map as it is now), ts_handle, ts, or a completed build job_id (pass tal_ids when several TALs exist). metrics: omit for every declared column, or name them; workload and account_count are always available. Workload needs dwell (dwell_time, the build's recorded dwell, or the layer's dwell_time_field); without it the result has every other statistic, no workload, and workload_omitted.ask_user, the question for the user. analysis_panel=single with map_session_id fills the map's analysis dock (analysis_panel.status=pushed). territories[].workload_total is minutes; hours are in territory_metric_grids. Drive-time alignments count accounts inside each polygon. Returns a task.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ts | No | ||
| scope | No | ||
| job_id | No | ||
| metrics | No | ||
| tal_ids | No | ||
| max_depth | No | ||
| ts_handle | No | ||
| dwell_time | No | ||
| part_layer | No | ||
| compare_tals | No | ||
| analysis_panel | No | ||
| map_session_id | No | ||
| hypothetical_moves | No | ||
| visit_frequency_field | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||