raster-hexing

raster-hexing is a skill for Claude Code, Codex from boettiger-lab/data-workflows. It costs 92 tokens per session (5,272 once invoked), scanned A, original, BSD-3-Clause.

A guide to converting raster files such as GeoTIFFs and Cloud-Optimized GeoTIFFs into H3 hexagons, a grid made of hexagonal map cells. It explains how source pixels are combined into each cell and how tiled rasters are combined first.

In plain words
What is it for?
Use it to create raster workflows, choose reducers such as mean or sum, handle missing values and multiple tiles, and reprocess an existing raster.
Why use it?
It prevents incorrect results from using the wrong map resolution or pixel-combining method. It also provides the required workflow for creating a WGS84 cloud-optimized file before hexagon processing.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/boettiger-lab/data-workflows/raster-hexing
Any agent
npx skills add boettiger-lab/data-workflows --skill raster-hexing
Clone the repo
git clone --depth 1 https://github.com/boettiger-lab/data-workflows

Made for: Claude Code, Codex.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for raster-hexing

README.md
[![agentmods](https://agentmods.dev/badge/skills/boettiger-lab/data-workflows/raster-hexing.svg)](https://agentmods.dev/skills/boettiger-lab/data-workflows/raster-hexing)
Your own site
<a href="https://agentmods.dev/skills/boettiger-lab/data-workflows/raster-hexing"><img src="https://agentmods.dev/badge/skills/boettiger-lab/data-workflows/raster-hexing.svg" alt="Measured on agentmods" height="20"></a>
Per session 92 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 5,272 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00092 $0.05272
Opus 5 $0.00046 $0.02636
Sonnet 5 $0.00018 $0.01054
Haiku 4.5 $0.00009 $0.00527

Measured 4d ago against content hash a061f20873ae, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

raster-hexing scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 4d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/raster-hexing/SKILL.md · 189 lines

How it starts

The opening of the file, as written. The whole thing — 189 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Raster Hexing

Raster ingest produces COG + H3 hex only — no GeoParquet, no PMTiles. Always create the WGS84 COG first, then hex from that COG on NRP S3 (never from the original source URL).

Generating a raster workflow

cng-datasets raster-workflow \
  --dataset <name> --source-url <cog-url> --bucket <bucket> \
  --h3-resolution 8 --parent-resolutions "0" --value-column <band_name> \
  --hex-memory 32Gi --max-parallelism 61 \
  --output-dir catalog/<dataset>/k8s/<name>

Differences from vector:

  • Command: raster-workflow
  • Completions always 122 (one per h0 cell) — not configurable
  • Defaults: --h3-resolution 8, --parent-resolutions "0", --hex-memory 32Gi, --max-parallelism 61
  • --value-column — raster band name in output (default value)
  • --nodata — value to exclude (auto from metadata)
  • --hex-resamplinghow pixels aggregate into each cell (sum/mean/mode/max/min, default mean). Picking the wrong one silently corrupts the data — see "Choosing the aggregation reducer" below. As important as --value-column.
  • Always creates a WGS84 COG on NRP S3 first; hex reads from that COG

Multi-tile rasters (e.g. multiple UTM zones): repeat --source-url. Adds preprocess-cog step that mosaics into one WGS84 COG:

cng-datasets raster-workflow --dataset wyoming/rap-arte \
  --source-url s3://.../rap_arte_zone12.tif \
  --source-url s3://.../rap_arte_zone13.tif \
  --bucket public-wyoming \
  --target-extent "-111.1,40.9,-104.0,45.0" --band 1 --value-column arte \
  --output-dir catalog/wyoming/k8s/rap-arte

Extra options: --target-extent "xmin,ymin,xmax,ymax" (EPSG:4326 clip), --target-resolution <degrees>, --band <n> (1-indexed), --output-cog-name <key>.

⭐ For RASTERS, native resolution is set by the SOURCE PIXEL — match it, never oversample

The h8 default (see AGENTS.md, Hex sizing and resolution) is a vector convention. For a raster, native resolution is not a preference, it is a measurement: read the source pixel size and pick the H3 resolution that matches it. Hexing finer than the source pixel adds no information — it replicates each pixel value across many cells, costs ~7× rows and ~7× build time per resolution step, and publishes a hex whose apparent detail is a lie about the source.

Read the full file on GitHub · 189 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 4d ago First seen · 189 lines · 92 tokens per session scan A a061f20873ae

Subscribe to this mod's changes

raster-hexing is a skill published in the GitHub repository boettiger-lab/data-workflows (5 stars, last pushed 4d ago), licensed BSD-3-Clause. It adds 92 tokens to every session and 5,272 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.

Related

Other skills, from other repositories

biopython

Comprehensive molecular biology toolkit. Use for sequence manipulation, file parsing (FASTA/GenBank/PDB), phylogenetics, and programmatic NCBI/PubMed access (Bio.Entrez). Best for batch processing, custom bioinformatics pipelines, BLAST automation. For quick lookups use gget; for multi-service integration use…

K-Dense-AI/scientific-agent-skills · 76 tokens

exploratory-data-analysis

Perform bounded, local exploratory analysis of explicitly supported scientific files. Use for redacted CSV/TSV/JSON profiles; optional NumPy, HDF5, FASTA/FASTQ, and basic image metadata inspection; missingness/leakage audits; outlier and transformation sensitivity; and rigorous EDA report scaffolds. Other domain…

K-Dense-AI/scientific-agent-skills · 83 tokens

nature-statistics

Audit, revise, or draft manuscript statistical reporting for Nature / high-impact journal submissions. Use when the user asks to check statistical analysis sections, p values, confidence intervals, sample size, biological versus technical replicates, randomization, blinding, multiple-comparison correction, model…

Yuan1z0825/nature-skills · 139 tokens

evaluating-with-leakage-gates

Evaluate an OpenMed de-identification or clinical NER model against the leakage-first release gates G1a through G8, which gate releases on residual PHI leakage rather than on F1. Use when the user wants to run the OpenMed eval harness on a synthetic golden set, decide whether a de-id model is RELEASABLE or…

maziyarpanahi/openmed · 158 tokens

mapping-to-snomed

Maps clinical concept spans extracted by OpenMed to SNOMED CT concepts through a USER-SUPPLIED terminology server (the user's own Ontoserver, Snowstorm, or UMLS/UTS), never a bundled vocabulary. Use when the user wants to code findings, disorders, procedures, body structures, or substances to SNOMED CT, run an ECL…

maziyarpanahi/openmed · 205 tokens

mixed-precision

Use FP16/BF16 mixed precision to accelerate training and reduce memory. Use when optimizing GPU performance.

aiming-lab/AutoResearchClaw · 25 tokens