get_patch_data
Retrieve patch variables as a 2D grid for heatmaps or spatial analysis. Optionally get summary statistics or downsample large worlds.
Instructions
Get patch data as a 2D grid (useful for heatmaps / spatial analysis).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| attribute | Yes | The patch variable to report (e.g. 'pcolor', 'grass'). | |
| max_cells | No | Upper bound on the number of grid cells returned in full-grid mode. When the world exceeds the cap, rows and columns are evenly downsampled (nearest-neighbor) to fit; the response includes a ``downsampled_from`` field so the AI knows it's seeing a subsample. Default 10000 (≈ 100×100). Set to 0 to disable the cap (not recommended for large worlds). | |
| summary_only | No | If True, return shape + min/mean/max/std/unique-count instead of the full 2D grid. For a 100×100 world this trims ~10k cells of JSON to ~6 numbers — useful when you just want to know "is this attribute distributed widely?" without enumerating every patch. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |