Agent recipe · Available · tested on 0.53.0

Hexagon binning (H3 or custom hexagons) with statistics

Can an AI agent turn points into a hexagon map, in 2D or 3D, that I can share?

Yes. A map-v1 analysis step runs the hexbin operation in the viewer's browser when the link opens: points are summarised in H3 cells (or Turf hexagons of a chosen side) by count, density per km², or the sum, mean, min or max of a numeric field. The result is a coloured, optionally 3D layer. Polygon data becomes points first with the random-points step (the dot-density recipe), chained with { "step": 0 }.

Ask for it like this

  • “Make a hexagon map of these points”
  • “Bin these incidents into H3 hexagons and extrude them in 3D”
  • “Show average price per hexagon”
  • “Make a population hexagon map from census blocks”

Inputs

Accepts: Point FeatureServer layer, Point GeoJSON or CSV with coordinates, Points made by an earlier random-points step. Engines: maplibre, arcgis.

  • source: A point layer, or { "step": n } for an earlier step's points.

Optional:

  • method: h3 (default; resolution 0-15, 7 is about 5 km², 8 about 0.74 km², 9 about 0.1 km²) or turf with cellKm (hexagon side).
  • statistic: count (default), density (points per km² of each cell's own area), or sum, mean, min, max of a numeric field.
  • field: Numeric field for sum, mean, min and max. Blank and non-numeric values are skipped and reported; a cell with no numbers gets null, not 0.
  • extrude: true raises cells by the statistic (MapLibre 3D).
  • keepEmpty: true keeps cells with no points (count 0) across the data or study area.
  • overlay: A polygon layer as the study area: whole cells that touch it are kept, never clipped.
  • area: "view" reads only features in the current map view; use with a camera for layers beyond the limit.

Steps

Discover → inspect → plan → validate → execute → verify → share. Each step names where it runs; none is a hosted REST endpoint.

  1. discover: Read llms.txt, this recipe and api/capabilities.json; note the engine and execution environment you actually have. (Declarative URL; https://gismap.online/llms.txt, https://gismap.online/api/capabilities.json, https://gismap.online/api/manifest.json)
  2. inspect: Read the source metadata: geometry type, field names and types, spatial reference, extent, sentinels and query support. Query real values before filtering; never invent fields. (Declarative URL, Standalone JavaScript, In-browser API; <layer URL>?f=pjson, sources.inspect, sources.detectSentinels, layers.metadata)
  3. plan: Confirm point geometry and the feature count. Pick a resolution from the area (about 1,000 to 20,000 cells reads well) and a statistic; check that the field is numeric. Up to 100,000 points are read: filter with where (or use area "view" with a camera) when the layer has more, and say so. (Standalone JavaScript; sources.inspect)
  4. validate: Add { "operation": "hexbin", "input": 0, "options": {...} } to analysis and validate the spec; unknown options and bad inputs are reported. (Standalone JavaScript, In-browser API; mapSpec.validate)
  5. execute: Return the #map=json: link; the browser bins the points when it opens. In a running page, analysis.run("hexbin", { input, options }) does the same and returns a summary and binning metadata. (Declarative URL, In-browser API; https://gismap.online/schemas/map-v1.schema.json, mapSpec.createLink, analysis.run)
  6. verify: Open the link: the hexagon layer is listed with a choropleth on the statistic, and the summary does not start with "Incomplete:". Report skipped points and an incomplete read if either appears. (In-browser API; layers.list)
  7. share: Return the link. Results are recomputed for each viewer; the link carries the steps, not the cells. (Declarative URL; mapSpec.createLink)

Result

map-v1 with a point layer (or a random-points step) and an analysis step { operation: "hexbin" }. Schema: /schemas/map-v1.schema.json.

  • Interactive hexagon map link · Declarative URL
  • Hexagon GeoJSON layer in the page (h3_id or cell_id, point_count, cell_area_km2, density_km2, field statistics, complete) · In-browser API

Verify before reporting success

  • Input is points
  • Cell count is readable (not over 100,000)
  • Legend names the statistic
  • Summary has no "Incomplete:" or the gap is reported
  • Skipped points reported

Report prepared, validated, loaded, rendered and verified separately, and partial or failed when they apply. A generated link alone is only prepared.

Limitations

  • Reads up to 100,000 points; MapLibre holds at most 50,000 features of a big ArcGIS layer, so filter it or use area "view".
  • Points only: lines and polygons are not split by area; turn polygons with a count into points with random-points first.
  • Cells are recomputed in each viewer's browser; nothing is stored on a server.
  • 3D cells need the MapLibre engine; ArcGIS 2D colours them flat.

If something goes wrong

  • "Too many cells": lower the resolution, use a larger cellKm, drop keepEmpty or narrow the area.
  • "Incomplete:" in the summary: add a where filter or area "view" with a closer camera.
  • "needs a numeric field": choose a numeric field or use count or density.

Examples

Example · rendered · checked 2026-11-20

Ventura County population in 3D hexagons

Prompt: “Make a 3D hexagon map of Ventura County's population from the 2020 census blocks.”

Data: California Census 2020 Redistricting Blocks (Esri, U.S. Census Bureau)

Open the result

map-v1 JSON
{
  "version": 1,
  "title": "Ventura County population in hexagons",
  "basemap": "topo-3d",
  "camera": {
    "center": [
      -119.08,
      34.17
    ],
    "zoom": 10.4,
    "heading": 350,
    "tilt": 55
  },
  "legend": true,
  "layers": [
    {
      "url": "https://services.arcgis.com/P3ePLMYs2RVChkJx/arcgis/rest/services/California_Census_2020_Redistricting_Blocks/FeatureServer/0",
      "type": "feature",
      "title": "Ventura County census blocks (2020)",
      "where": "County_Name = 'Ventura County' AND P0010001 > 0",
      "visible": false
    }
  ],
  "analysis": [
    {
      "operation": "random-points",
      "input": 0,
      "options": {
        "field": "P0010001",
        "unitsPerPoint": 20,
        "seed": 1
      },
      "title": "People, one dot per 20",
      "visible": false
    },
    {
      "operation": "hexbin",
      "input": {
        "step": 0
      },
      "options": {
        "method": "h3",
        "resolution": 8,
        "statistic": "sum",
        "field": "represents",
        "extrude": true
      },
      "title": "Population per H3 cell"
    }
  ]
}

What was checked:

  • Opened on MapLibre: 7,843 blocks loaded, 42,232 dots (hidden) and 1,408 H3 resolution 8 cells drawn in 3D with a legend; no console errors.
  • The same link with ?tutorial=hex-population starts a seven-step tutorial.
  • ArcGIS engine not checked.