Changelog¶
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
[Unreleased]¶
0.21.0 - 2026-11-27¶
Added¶
Measured hex pod use kept beside the dataset (#369, #308).
merge-chunksprinted what a sub-h0 fan-out’s pods used, and a suggested--hex-memory,--hex-cpuand--hex-workers, only to its Job log, which goes with the Job’s TTL, and a successful merge then purged the markers the figures came from. It now also writes them to<dataset>.usage.json(<dataset>-fractions.usage.jsonfor a fractions build,<dataset>.year=<year>.usage.jsonper year with--years), outside the hex tree, with the build’s shape: workflow, source,h3_resolution,chunk_resolution, reducer, parent resolutions, h0 subset and, for raster, workers and chunk size. The file is written only after a merge succeeds and only when markers carry usage, and a failed write warns rather than failing the merge. Newmerge-chunksflags--usage-outand--build-shape, whichraster-workflowandmdim-workflowfill in. Nothing reads the file yet: it is the record that automatic sizing (#308) would be calibrated against.
0.20.0 - 2026-11-26¶
Added¶
--polyfill overlapwith--resolution-by-area(#363, #98). The two had been refused together. Each feature is now filled at the native resolution its area maps to, one tier at a time, and the output keeps the--resolution-by-areaunion schema (the id,native_res, oneh{r}column per resolution, NULL where r is finer than the row’s native resolution) withcover_fracadded.cover_fracis the share of the feature’s native-resolution cell, soSUM(cover_frac × cell area)over a feature’s rows is still its area.
0.19.0 - 2026-11-26¶
Added¶
--polyfill overlapwith a coverage fraction (#363). Vector hex gives a polygon the cells whose centre it contains, so a feature smaller than a cell gets one stand-in cell (#104), and two features that overlap by less than a cell can share no cell, which makes a hex join miss real overlaps.workflow --polyfill overlap(andvector --polyfill overlap) writes one row for every cell a polygon’s area touches, with acover_fraccolumn (FLOAT, the share of the cell’s area inside the feature, in (0, 1]). Cells wholly inside a piece get 1 without geometry work, and only boundary cells are intersected. H3’s own ‘overlap’ mode omits some cells, such as a cell whose centre a small hole covers, so the neighbours of boundary cells and the cells under hole vertices are tested as well. Fractions are planar ratios in lon/lat, H3’s edge convention; summed with cell areas they reproduce each polygon’s area. Antimeridian crossers are cut at 180 first. Points and lines keep their cells withcover_fracNULL, as does the stand-in cell of a zero-area polygon. Not yet available with--resolution-by-area. Ported from the data-workflows script validated on all of WDPA (data-workflows #1015). The default,--polyfill centre, is unchanged.
Changed¶
DuckDB 2.0.1 (#114, #280). The pin moves from 2.0.0, the release every version since 0.12.0 has run on, to the 2.0.1 patch release, with the h3 community extension v2.0.1 built for it (duckdb/community-extensions#3787). Multipolygons still return no cells from
h3_polygon_wkt_to_cells(#166), so the polygon-part path stays.
0.18.0 - 2026-11-20¶
Added¶
--hex-resampling totalfor per-area densities (#105).sumadds pixel values, which for a density in Mg/ha is a sum of densities: the carbon rasters came out 6–7 times below their published totals.totalmultiplies each pixel by its true area on the sphere (exactextract’sarea_spherical_km2weight) before adding, so each cell holds the amount (Mg) andSUM()over the table is the grand total, correct at every latitude and at nodata edges. It needs the new--value-units, whose per-area denominator sets the scale (/ha×100,/km2×1,/m2×10⁶).sumwith a per-area--value-unitsis refused,sumwithout one prints a warning at generation, and the hex pod warns when the band’s own units are per-area.--value-unitsis recorded asvalue_unitsin each partition’s metadata.CI requires a changelog entry (#114). A pull request that changes
cng_datasets/now fails thechangelogcheck unless it adds a line toCHANGELOG.mdor carries theno-changeloglabel. Releases had been reconciled against the changelog by hand, and #296 merged without an entry.
Removed¶
duckdb-bugreport.md. The H3 extension crash it reproduced (GetValueInternal on a value that is NULL) no longer occurs on DuckDB 2.0.0 with h3 v1.5.6. The workaround inh3_chunks.enumerate_chunk_cellsstays, since it is cheap.
0.17.0 - 2026-11-20¶
Added¶
raster-workflow --cutlineclips to a polygon (#344).--target-extentclips only to a box, so a build scoped to a country needed a hand-writtengdalwarp -cutlinestep.--cutline <vector>(GeoParquet, GeoPackage, GeoJSON, zipped shapefile; path or URL; any CRS) and--cutline-wherenow clip the COG step onraster-workflowandraster. Pixels whose centre falls outside the polygons become nodata, and the step refuses to run without a nodata value rather than write 0. A source already in EPSG:4326 keeps its grid: the extent is the polygons’ bounds snapped outward to the source pixels and cut to the source, and the warp isnearest, so values inside pass through unchanged, even for a continuous source warped otherwise withbilinear.
Fixed¶
A clip of a single source is no longer ignored (#344).
raster-workflowwith one--source-urland--target-extentadded the preprocess-cog step, but therastercommand only clipped a mosaic of several inputs, so the COG covered the whole source with no warning. One input with--target-extent,--target-resolutionor--cutlinenow goes through the same clip as several, inRasterProcessoras well.--target-resolutionon one source that is already a COG now adds the preprocess-cog step too; it used to be dropped.Repartition sorts a large h0 partition in id ranges (#339).
repartitionwrote each h0 partition with oneCOPY … ORDER BY, so DuckDB sorted every joined row of the partition, attributes included, before writing any. Its scratch grew with the partition’s row count rather than with the file it wrote: PAD-US 4.1 combined’s 700M-row partition was OOM-killed at 32Gi and, at 64Gi, spilled past a 200Gi disk limit for a 1.4 GB file. Each partition is now planned as contiguous_cng_fidranges, each range is joined and sorted on its own, and the sorted ranges are streamed in order into the onedata_0.parquet. The file is the same, rows and order. A feature’s rows never straddle two ranges. A range is 50M rows per 40GiB of--memory-limit(the ratio that worked on PAD-US), at most 50M;--sort-range-rowsorCNG_SORT_RANGE_ROWSoverrides it. A partition that fits in one range is written as before. Each partition’s row count is now checked against the chunks before it is uploaded, so a source with duplicate ids, which multiplied rows in the join without error, now fails. DuckDB’s thread count is now the pod’s cpu request (CNG_POD_CPU, which the generated manifest sets, or an enforced quota), else at most 8, rather than the host’s core count: at 48 threads in a 4-cpu pod, the same sort under a 3GiB limit passed or ran out of memory by chance, on the released code as well.A
fractionsbuild no longer overwrites themodebuild of the same layer (#343).raster-workflow --hex-resampling fractionswrote to the samehex/andhex-chunks/paths, and emitted the same job names, as amodebuild of the same--dataset. A categorical layer usually wants both, so running both replaced the first table with the second and the secondkubectl applycollided with the first build’s jobs. Afractionsbuild now writes<dataset>/hex-fractions/(staged inhex-fractions-chunks/), its jobs and ConfigMap are named<name>-fractions-*, and its sizes and checksums go to<dataset>-fractions.checksums.json. The COG and its render are shared, since both builds warp withnearestand write the same file. Every other reducer is unchanged. A workflow that worked around this with--dataset <name>/fractionsnow writes<name>/fractions/hex-fractions/; drop the/fractionssuffix to get<name>/hex-fractions/, the layout data-workflows already uses by hand.
0.16.0 - 2026-11-19¶
Added¶
Vector thumbnails drawn with the default style (#340).
cng-datasets vector-thumbnail --style --parquet --outputdraws the GeoParquet with a MapLibre style as a 512 × 384 PNG, using GDAL instead of a browser. It draws each fill, line and circle layer, applies the layer filters (so placeholder features hidden by a filter stay out of the picture and out of the frame), frames the drawn features in Web Mercator, and blends overlapping features at their opacity as MapLibre does. The thumbnail evaluates the expressions styles here use, and any other operator is an error, not ignored. On the published SGCN ranges collection it draws California with its filtered placeholders left out, in 6 seconds.Default MapLibre styles built from a PMTiles file’s data (#340).
cng-datasets style-profilelists a PMTiles layer’s drawable attributes beside the STAC column descriptions.cng-datasets stylebuilds the default style for a chosen column: categorical (the most frequent values, counted in the GeoParquet, the rest as Other, labels from the column’sCODE=meaningdescription) or continuous (six classes at rounded quantile breaks, or given breaks, with no data in grey), or a single colour with its reason. It is data-workflows’scripts/default-style.pymoved here, reading the GeoParquet with DuckDB instead of the MCP server. On a published collection the two produce identical JSON. The column is still chosen by the STAC author; everything after that choice is now deterministic and tested here.Raster workflows write a default render and thumbnail for each COG (#340). A new step after the hex step runs
cng-datasets cog-renderon the COGs the workflow wrote and writess3://<bucket>/<dataset>.render.json(STAC render-extension fields keyed by object key) and<cog stem>.thumbnail.pngbeside each COG. A band with a color table is drawn with it, resampled nearest. Any other band gets viridis stretched over its 2nd to 98th percentile, in real units when the band has a scale or offset; min to max, which every COG carries, leaves skewed data such as population at the bottom of the ramp. The thumbnail is drawn with GDAL from the COG’s overviews, with nodata transparent, so it needs no browser or tile server. The automatic render is a default:--colormap,--rescaleand--colormap-jsonoverride it for diverging, categorical or log-scaled data. A source that was already a COG is not this workflow’s output and gets no render.CI checks the emitted files against Portolan (#340).
tests/test_portolan_conformance.pybuilds a GeoParquet, its hex partitions and a COG with the workflow code, writes their sizes and checksums with the checksums step, wraps them in the smallest Portolan catalog, and runs rashid 0.4.0’s metadata and data passes. It fails on any error or warning from the rules about the files themselves (PTL-DAT-, PTL-AST-003/004, PTL-PRT-). A second test breaks a checksum and a hex file and expects both to be caught, so a data pass that read nothing cannot pass. CI installs rashid in its own virtualenv, because it would otherwise replace the image’s GDAL-linked rasterio, pyproj and shapely.
Documentation¶
Hex partitions in STAC (#340). The Kubernetes workflows guide gives the Portolan partition extension fields for each hex layout the tool writes (PORTO-FMT-017):
partition:schemehive,partition:strategyh3,partition:keysas objects with anameand atype(h0asint64, thenyearasint32with--years), and ans3://partition:glob, with a STAC snippet. The fields go beside the hex asset, which consumers look up by key. rashid 0.4.0 still reports that asset’s glob href (PTL-AST-012) and missing checksum (PTL-AST-003); the hex asset stays, and the deviation is raised with Portolan (#340). It also notes that theh0value in a path is the integer cell id and that the NRP endpoint has to be configured to read the glob.
0.15.0 - 2026-11-18¶
Added¶
Workflows write the size and checksum of every output (#340). Portolan asks each data asset for
file:sizeand a multihashfile:checksum(PORTO-CORE-028/029), which the STAC author in data-workflows cannot get without reading every byte again. The last step ofworkflowandraster-workflownow reads each output back from S3 and writess3://<bucket>/<dataset>.checksums.json. Each file gets its size, its sha2-256 multihash and its last-modified time, keyed by object key, ready to merge into its STAC asset. The hex directory, one asset with a glob href, also gets a total size and file count. The newcng-datasets checksumscommand does the same for datasets built before this step existed. The vector workflow now waits for the single-pod PMTiles step, which it used to leave running after the workflow finished, because the checksums read its output.
0.14.0 - 2026-11-18¶
Added¶
COGs carry their band statistics inside the file (#340). Portolan requires min/max/mean/stddev and the valid percentage on every band of a COG (PORTO-FMT-026 to 029), embedded rather than in an
.aux.xmlsidecar, and rashid 0.4.0 found none on our COGs. Both COG writers,create_cogand the mosaic path, now pass the COG driver’sSTATISTICS=YES, which computes them from the full-resolution data, excluding nodata, and stores them in the TIFF’sGDAL_METADATAtag.
Changed¶
Convert writes GeoParquet 1.1 with a bbox covering column (#340). Portolan requires GeoParquet 1.1 or 2.x and spatial statistics on every row group (PORTO-FMT-007/012), and rashid 0.4.0 failed convert output on both: DuckDB wrote GeoParquet 1.0.0, whose WKB column has no spatial statistics. The flat GeoParquet now carries a
bboxstruct column (xmin,ymin,xmax,ymax;<geometry>_bboxif the data already has abbox), declared as the geometry’s covering in a 1.1.0geokey, so every row group has min/max statistics a reader can prune on. This reverses #53, which dropped geoparquet-io’s bbox column on the belief that DuckDB already wrote row-group spatial statistics for the WKB column; it does not. The geometry stays plain WKB rather than the native ParquetGEOMETRYtype, which DuckDB 2.0 can also write but which changes the column type for every downstream reader. Thegeokey listsgeometry_typesas[](“unknown”) and has no filebbox, since both would need a second pass over the data. The covering column stays in the GeoParquet: hex partitions and PMTiles carry the same attributes as before, and a GeoParquet source’s own covering is replaced rather than kept alongside the new one.
0.13.0 - 2026-11-17¶
Added¶
Chunked PMTiles for very large vector datasets (#83).
workflow --pmtiles-chunks Nbuilds PMTiles in N parallel parts plus one low-zoom overview, merged withtile-join, instead of in one pod whose GeoJSONSeq outgrew its disk at tens of millions of features (NWI, 38M; NFHL, 5.6M). The parts are contiguous row ranges of the converted GeoParquet, which convert writes in Hilbert order, and build zooms from--pmtiles-split-zoom(default 7) up. The overview builds the zooms below from the whole dataset, simplified to half a pixel. The merge passestile-join -pk: without it, tile-join silently drops a merged tile over 500 KB and exits 0, which lost two z5 tiles on a test fixture. The newcng-datasets pmtiles-checkreads every tile’s size from a PMTiles directory and reports the tiles over the limit, and the merge runs it. The single pod stays the default.
0.12.7 - 2026-11-17¶
Fixed¶
Hex fills a feature already split at 180° in full (#328). A band round the globe or a polar cap whose only vertices away from ±180 were few and far apart, such as a box from -180 to 180, or a feature convert split at 180°, was taken for an antimeridian crosser and handed to H3 whole. H3 read its edges the short way and filled a single cell. A feature with vertices on both -180 and +180 that is valid read flat is now band-split like any other wide feature. A ring that really runs across 180° doubles back on itself read flat, so it is still filled the short way.
0.12.6 - 2026-11-17¶
Fixed¶
Hex pass 1 no longer fails on a chunk of several very large features (#329). Pass 1 writes a chunk’s cell lists in one parquet COPY, and DuckDB put a whole vector of lists in one page, which is capped at 2 GB. A chunk holding several features of tens of millions of cells each, such as the repeated monuments in the PAD-US combined layer, failed with “uncompressed page size out of range”. Pass 1 now bounds its row groups at 256 MB, which also ends the page.
0.12.5 - 2026-11-17¶
Fixed¶
Convert reprojects and repairs a GeoParquet source (#327). A GeoParquet source took a separate path that only added
_cng_fidand sorted the rows. It was not reprojected, split at the antimeridian or repaired, so a file in EPSG:3338 came out in metres, and an invalid feature stayed invalid, although the same data as a GeoPackage converted correctly. The CRS is now read from the file’s GeoParquet metadata (DuckDB carries it in the column type), and the geometry goes through the same reproject, split andST_MakeValidexpression as every other source. A GeoParquet already in EPSG:4326 or OGC:CRS84 keeps its coordinates.--simplify-toleranceon a GeoParquet source is now in target-CRS units, as for other sources.
0.12.4 - 2026-11-16¶
Fixed¶
k8sandsync-jobuse the same namespace as the workflow generators (#312). Both still defaulted tobiodiversity, so a sync job generated alongside a workflow landed in a different namespace, one capped at 200 pods. They now default togeo-workflows, through--profilelikeworkflow, and--namespacestill overrides it.K8sJobManagerandgenerate_sync_jobdefault to the same namespace.workflowpasses--no-spatial-orderand--csv-sample-sizeto its convert step (#311). Without them, the way out of a Hilbert sort that does not fit the convert pod (#276) and the CSV type-inference sample (#188) could only be reached by editing the generated YAML.
Documentation¶
A shapefile or GeoPackage source’s GeoParquet carries the OGR feature id (
OGC_FIDorfid) beside_cng_fid, which DuckDB spatial’sST_Readadds since DuckDB 2.0. The vector guide now says so.
0.12.3 - 2026-11-16¶
Fixed¶
Convert keeps a polygon that contains a pole (#322). Out of a polar CRS such as EPSG:3413 or EPSG:3031,
ST_Transformwrites a pole-containing polygon as a ring with a vertex at every longitude. The antimeridian split left it unchanged, because it is genuinely wider than 180°, andST_MakeValidthen reduced it to lines: a cap at 80° N came out with zero area, and an Antarctica-sized ring at 70° S as 24 km². A ring that winds all the way round in longitude is now closed along its pole and cut into -180…180, so the polygon keeps its area and still contains the pole, and its hexes fill over the pole. Polygons that cross 180° without containing a pole convert as before.
0.12.2 - 2026-11-16¶
Fixed¶
PMTiles keep every point at low zoom (#319). The generated tippecanoe command set no drop rate, so tippecanoe thinned points 2.5× per zoom below the max zoom: of 1,733 points across the contiguous US, z0 showed 1, z4 10 and z6 97, and a national view of a point dataset was nearly empty. The command now passes
-r1. The rate applies only to points, so line and polygon tiles are unchanged (checked tile for tile with tippecanoe 2.79), and--drop-densest-as-neededstill bounds tile size for a very dense point layer. Regenerate a point dataset’s workflow to pick this up.
0.12.1 - 2026-11-16¶
Fixed¶
Convert repairs an invalid feature that crosses 180° instead of failing (#315). The antimeridian split (#274) cuts each crosser with a box, and GEOS raises on invalid input, so one self-intersecting ring across 180° aborted the whole conversion; the same feature anywhere else converts, because
ST_MakeValidrepairs it after reprojection. The split now runs GEOSmake_validfirst, in the shifted frame where the feature has its true shape, so a crosser is repaired the same way as any other feature. This blocked PAD-US 4.1Combined, whose Alaska Maritime NWR proclamation is invalid in the source.Convert reads a source whose attribute table repeats a field name (#314). Shapefiles exported from ArcInfo coverages truncate names to 10 characters and can carry the same name twice, which DuckDB refused to bind. A repeated name now gets a numeric suffix (
C_FINT_LEN,C_FINT_LEN_2), which the log reports. The check runs once per source and changes nothing for a source without repeats.Raster hex reads a 360° source directly, except for a chunk at its edge (#313). Since #295, every chunk of a source covering 360° of longitude read through the wrapped VRT, even chunks nowhere near ±180. On the global ETH canopy-height source a chunk 105° from the antimeridian took 573 s that way against 213 s from a 38-tile regional VRT, with identical cells (about 5,900 res-2 units per layer at ~14 min instead of ~5). The wrapped VRT is now built, and read, only when a chunk’s window runs past the source’s edge; every other window is cut from the source itself.
0.12.0 - 2026-10-29¶
Fixed¶
A merged sub-h0 build keeps its
h0column (#172).merge-chunksread the parts with hive partitioning and excluded theh0key it read from the folder name, but DuckDB gives a folder key precedence over a file column of the same name, so the parts’ ownh0column was dropped as well. A--chunk-resolutionbuild therefore published files without theh0column that an unchunked build writes. A read with hive partitioning hid this by fillingh0back in from the folder name, which is also why the schema test passed. The merge now copies exactly the parts’ columns. That also keeps ayear=folder above the chunks from becoming ayearcolumn inside a multi-year build’s files.merge-chunkssucceeds on a fan-out that ran completely and found no data (#299). An h0 with no valid pixels writes no parts, so the merge raisedNo parquet parts foundand a correct build endedFailed. When--expect-chunkshas confirmed that every chunk ran and no marker claims data, the merge now exits 0, writes no partition and says the result is empty. It still fails when markers are missing, when no expected count is given, or when a chunk claims data but left no part.Raster hex reads cells on the antimeridian unwrapped, in the source’s own longitude frame (#295). A cell straddling ±180 was split into a MultiPolygon whose bounding box spans 360°, and exactextract reads the raster over that whole box: on a 10 m global source a seam cell took 7 s against 0.12 s unwrapped, and an antimeridian h0 has about 3,300 of them at resolution 8, so one h0 ran for many hours (66 min per 100k-cell chunk). Each cell is now one polygon, shifted by a multiple of 360° into the frame of the raster it reads. A source whose columns cover 360° is read through a VRT padded on both sides with its own columns, so a cell or a chunk window across the edge is one contiguous read, and a chunk straddling ±180 now gets a window instead of reading the whole source. This also fixes a silent loss for a geographic source written in a frame other than [-180, 180], such as a mosaic running -170…190: the prune dropped every cell between -180 and -170, and the -180 half of every seam cell read nothing. Projected sources keep their previous behaviour.
Changed¶
Armada pods are checked against the cluster’s size limit when the workflow is generated (#183). Every Armada pod has no controller, and NRP’s admission webhook refuses such a pod above 16 cores or 32Gi. The webhook’s message says “32 GB”, but server-side dry runs admit 34G and refuse 32.1Gi. A converted job past that limit used to pass
armadactl submit --dry-runand then fail at admission, job by job, after submission; the CHELSA hex at 64Gi would have produced 122 such failures. Converting to Armada now checks every job first and refuses with the jobs and sizes named, writing no Armada file. The limits are cluster settings (armada_max_cpu,armada_max_memory) in thenrpprofile, and an empty value turns the check off.merge-chunksreports what the fan-out’s pods used and suggests a size for the next build (#183). Each sub-h0 chunk’s completion marker now records its pod’s memory limit,memory.peak, peak anonymous memory (sampled each second, sincememory.peakcounts page cache that the kernel reclaims before killing anything), cpu request, worker count, lifetime mean cores and elapsed time. NRP enforces no cpu quota, so the generated hex manifests state the request asCNG_POD_CPU. Before merging,merge-chunkssummarises these for the whole fan-out and prints--hex-memory,--hex-cpuand--hex-workersfor the next build of the same shape. The worker count is kept as measured, because the memory figure depends on it. Memory is sized to the largest anonymous peak plus 25%, because it is the inelastic dimension and has a hard Armada limit; cpu is sized to the mean of the pods’ averages. It warns when the request was more than twice what was needed. Pod logs had these figures already, but Armada reaps its pods. This covers raster and mdim chunked builds; markers from older builds report nothing.raster-workflow --yearsbuilds an annual raster series as one collection (#172). With--years 1985,1990,2015-2025and a{year}placeholder in--source-url, the generated steps run once per year: the COG step becomes an indexed Job with one pod per year (writing<dataset>-<year>-cog.tif), the hex Job fans out over years × h0 cells or sub-h0 chunks, and the merge step merges each year’s chunks against the full chunk count. The hex output is one tree partitioned by year,hex/year=<year>/h0=<cell>/data_0.parquet, soyearis a column to a hive-partitioned read and a cross-year change is a self-join on the cell. This replaces the hand-written indexed Jobs of the Annual NLCD build. The ~200-pod check and--backend autonow count the hex Job’s total completions, and the orchestrator’s step timeouts scale with the number of years. A placeholder without--years, or--yearswithout a placeholder, is refused at generation.The vector polyfill cuts large polygons into pieces (#125). Before the polyfill, a polygon part with more than ~1 million estimated cells, or whose cells × vertices exceed 100 million, is cut by repeatedly halving its bounding box, and H3 fills each piece separately. The output is unchanged: a cell is in the fill exactly when its centre is inside the polygon, so the pieces’ fills add up to the whole fill. Two limits go away. First, the cost of a fill was cells × vertices, because H3 tests every candidate centre against every edge. A 200,000-vertex test polygon took 565 s at res 7 as one piece and 17.7 s as 233 pieces, with the same 155,727 cells; at res 8 it took 28 s instead of more than an hour. Second, a feature’s cells were one list value in Pass 1, capped by the 2 GB ceiling on one parquet value, so the #107 guard refused any feature over 134 million estimated cells. Each piece now has its own list, and the guard’s default rises to 1 billion cells, which is about what one hex pod’s 50Gi of scratch holds.
CNG_MAX_CELLS_PER_FEATUREstill overrides it. A large antimeridian crosser is cut at 180° into two ordinary parts first. Lines and invalid polygons are filled whole, as before. Pass 2 also writes one file per batch and merges them once, instead of rewriting a growing file for every batch, which cost I/O quadratic in the number of batches.The COG step writes sparse COGs (#251).
preprocess-cognow passesSPARSE_OK=TRUE, so a tile that is entirely nodata (or 0 without a nodata value) is left out of the file, in the full-resolution image and in the overviews, and the hex step’s coverage prune can skip it. Pixel values are unchanged: an unwritten tile reads back as nodata. GDAL (and so rasterio, terra and TiTiler), tifffile and geotiff.js 3.0 or later read these files identically to dense ones, and both GDAL’s and rio-cogeo’s COG validators accept them. geotiff.js 1.x and 2.x fail on them withbuffer error; that covers OpenLayers before 10.9.0 and georaster (as used by georaster-layer-for-leaflet), so a web map built on those cannot read a COG from this release.Raster hex skips the empty parts of a sparse source (#251). The prune that limits a chunk to the cells reaching the source (#215) tested only the source’s bounding box, so a source whose data is scattered across a large extent, such as coastlines or wetlands, enumerated and extracted every cell of that box. The descent now also asks the GeoTIFF’s tile index which tiles were written, without reading pixels, and drops any subtree over unwritten tiles; this also applies to global sources, which the bounding-box prune could not help at all. On Global Mangrove Watch at res 10, h0 position 40 (Indonesia and Malaysia, 26% of tiles written) went from 282,475,249 cells to 81,955,734 (29%), with the descent taking 69 s over the public endpoint; the work now follows the source’s written tiles rather than its extent. It is on only for a geographic source whose unwritten tiles read as a value already treated as nodata (the band’s nodata, or 0 without one), which is what makes dropping them safe; otherwise the log says why it is off. Output is unchanged.
CNG_HEX_PRUNE_COVERAGE=0turns it off. Only sources written sparse (GDAL’sSPARSE_OK) benefit, which the COG step now does too (below).Vector polyfill reads polygons as WKB (#166). Each polygon part now goes to
h3_polygon_wkb_to_cells(h3-duckdb v1.5.6) instead of being written out as WKT text and parsed back; the cells are identical. The WKB functions raise on a part that is not a polygon where the WKT ones returned nothing, so such a part, such as a line left in a GEOMETRYCOLLECTION, is given an empty list and falls back to its representative cell as before. Multipolygons are still split withST_Dump, because h3-duckdb still returns no cells for a WKT MULTIPOLYGON and the WKB function refuses one.Rows are in spatial order, so queries by place read far less (#276). Convert now writes rows in Hilbert-curve order and numbers
_cng_fidin that order, on all three input paths (ST_Read, GeoParquet, CSV points). Repartition orders eachh0partition by_cng_fidand then by the finest H3 column, so nearby features share row groups and a feature’s cells stay together. On the California partition of ACS block groups, a Los Angeles county join went from 13.1 s and 183 MB read to 2.5 s and 6 MB, and the partition shrank from 840 MB to 241 MB. A source that already has an id keeps it, and only its rows are reordered.--no-spatial-orderkeeps source order for a dataset whose sort will not fit the pod, and the convert Job now setsDUCKDB_MEMORY_LIMITso the sort spills rather than being OOM-killed. Raster hex is unchanged._cng_fidvalues change when a dataset is rebuilt, so ids stored from an earlier build will not match a new one.DuckDB 2.0 (#280). DuckDB 2.0 reads Parquet asynchronously, with several requests in flight, where 1.5 read sequentially; every remote read in the hex, repartition and merge steps goes through it. Three changes came with it. Every connection that loads
spatialnow setsgeometry_always_xy = true, which 2.0 requires before any axis-order-sensitive function (ST_Area_Spheroid,ST_Length_Spheroid, GDALCOPY TOwith an SRS) and which becomes the default in 2.1; the geometries were already (lon, lat), so the manualST_FlipCoordinatesbefore the spheroid functions is gone and results are unchanged. SQL lambdas use the Python-stylelambda x: ...form, since 2.0 disablesx -> .... And single-value reads usefetchall(), because 2.0 refuses other work on a connection while a result is only partly fetched.ibis is no longer a dependency (#291). It was used only to open DuckDB connections in
repartitionand the raster merge, with every query sent through as raw SQL, and the code already routed around it because it could not parse DuckDB’sGEOMETRY(OGC:CRS84)type. Both now use plainduckdbconnections, and the second connection repartition opened just to read the source schema is gone. This also clears one blocker for DuckDB 2.0 (#280, ibis-project/ibis#12196).
0.11.4 - 2026-10-26¶
Changed¶
The image has one GDAL and one GEOS (#285). rasterio, pyogrio, pyproj, shapely and exactextract were installed as wheels, each bundling its own copy of GDAL, PROJ or GEOS, so the image held three GDALs (3.14.0dev, 3.12.2, 3.12.4) and
raster/cog.pyloaded two of them in one process, each with its own config options, credentials and caches. They are now built from source against the base image’s libraries, and the build fails if any binding reports a different GDAL or GEOS. PROJ drops from four copies to two: the osgeo base links GDAL to a private PROJ that ships no headers, so pyproj links Ubuntu’s libproj, which GDAL’s dependencies already load.
0.11.3 - 2026-10-26¶
Fixed¶
Convert splits features that cross the antimeridian when it reprojects to EPSG:4326 (#274). DuckDB’s
ST_Transformhas no dateline split, so a polygon that is continuous in a projected source came out with a ring running the long way round, spanning about 356° of longitude, with its area overstated (PAD-US: 29 features, one of them 28% too large). Features whose reprojected extent is wider than 180° are now split at 180° after reprojection. All other features still go through DuckDB. Layers with features near 180° (Alaska, the Pacific, Fiji/Kiribati) that were built from projected sources should be rebuilt.mdimtreats values outside the CF valid range as missing (#278). It applied_FillValueand scale/offset but notvalid_min,valid_maxorvalid_range, which GDAL’s multidimensional API leaves to the caller, so out-of-range pixels were hexed as real data. NOAA Coral Reef Watch degree heating weeks on 2026-10-24 had 2,413 pixels abovevalid_maxat Arctic ice edges; over H3 base cell 5 the hex output had 620 cells above the valid maximum of 100 and a maximum of 158.67, and now has none. The range is compared in stored units, before scale and offset, as CF specifies. GDAL’s classic netCDF driver, used by therasterpath, already did this.The mosaic COG step’s local scratch scales with the data, not the grid (#277).
preprocess-cogfor several--source-urltiles wrote every warped group and the merged intermediate as uncompressed GeoTIFFs, about twicegrid pixels × bytes per pixelof local disk however well the source compressed: roughly 1.2 TB for a 30 m global tiled source whose zips total 0.12 GB. Intermediates are now tiled, ZSTD-compressed and sparse. Tiles already in the target CRS on one pixel grid are mosaicked through a VRT instead of warped, which also leaves their pixel values exactly as they were. For integer bands the extra fill codes are collapsed as a lookup table on read (#209), not rewritten in place. The single-source COG step’s intermediate is compressed the same way. The COG driver’s invalidCOPY_SRC_OVERVIEWSoption is dropped; the driver already reuses the intermediate’s overviews.
0.11.2 - 2026-10-26¶
Fixed¶
The image could not import pyarrow (
ghcr.io/boettiger-lab/datasetsbuilt on 2026-10-26, including v0.11.1). The image pinnednumpy<2for GDAL bindings that were once built against NumPy 1, and pyarrow 26 requires NumPy 2, so every step that reads or writes Parquet failed. The base image moved to Ubuntu 26.04 in April, and its GDAL bindings are built against NumPy 2.3, so the pin is removed instead of capping pyarrow, and NumPy now has a floor of 2.
0.11.1 - 2026-10-26¶
Added¶
workflow --convert-memorysizes the convert pod (#275). Before this flag existed, the convert pod silently used--hex-memory, so a convert that ran out of memory could only be fixed by raising hex memory too, or by editing the manifest by hand. Without the flag, the convert pod still uses--hex-memory, as before.The PyPI package now links to the repository, issues and changelog (#262).
Fixed¶
preprocess-cogno longer warps categorical rasters with bilinear resampling (#272). With--hex-resampling modeorfractions, the warp to EPSG:4326 now usesnearest. Bilinear invented class codes along every class boundary and blended codes with nodata. Continuous sources still warp bilinear. Categorical datasets built throughpreprocess-cog(multi-tile mosaics,--band, or a reprojected source) should be rebuilt.The PMTiles job no longer aborts on nodes with 256 or more cores (#273). tippecanoe’s thread count now comes from the pod’s CPU quota rather than the node’s core count, rounded down to a power of 2 and capped at 128. From 256 threads upward tippecanoe caps its shard count at 745, which is not a power of 2, so it aborted.
0.11.0 - 2026-10-05¶
Added¶
mdim-workflowcan fan out over time, and does so automatically when one chunk spans the whole grid (#267). Splitting over space makes every pod fetch every chunk of such a source. NEX-GDDP-CMIP6 stores one global day per chunk, so a global 122-pod run would move about 2.6 TB per series instead of ~21 GB. With--fan-out time(chosen byautofrom the first input’s chunk shape), each pod processes one input file, or a slice of a single input, across every h0, reading each chunk once. It writespart-t{unit}-*.parquetinto each h0 partition, and the existingmerge-chunksstep concatenates them.Slices of a single input are cut only between
--time-aggkeys. A pod whose input starts or ends mid-month or mid-year refuses to run, since concatenation would duplicate that key.A unit wholly outside
--time-start/--time-endexits cleanly and is recorded as complete.A time fan-out followed by the merge was tested to produce exactly the same rows as the spatial fan-out. One time unit was checked on a real NEX-GDDP file: 10 global daily chunks in a single 6 MiB read.
0.10.0 - 2026-10-05¶
Added¶
cng-datasets mdim: hex a (time, lat, lon) cube without per-slice COGs (#181). Reads zarr, netCDF, or anything else GDAL’s multidimensional API opens, using chunk-aligned slab reads. A series split across files (e.g. NEX-GDDP’s one netCDF per year) can be passed as several--inputs. DuckDB does the H3 indexing, the reduction and the write.Several
--variables become columns, and time stays a column instead of a fan-out.--time-agg none|month|year, plus--time-start/--time-end. CF time is decoded on the Gregorian,noleap,all_leapand360_daycalendars.Placement is
aggregate(pixel centres into cells) when pixels are finer than cells, orsample(cell centres read their pixel) when they are coarser. Neither is area-weighted, sosumis refused.Output uses the same
hex/h0=*layout, chunking and completion markers asraster. The chunk listing, footprints, output paths and markers now live incng_datasets/h3_chunks.py, shared by both.Why GDAL: the DuckDB
zarrextension (v0.1.1) scanned whole stores rather than pruning chunks. On the LOCA2 store, a 1-day, 1° query read 483 MiB without finishing, where GDAL moved one 72 MiB chunk. NEX-GDDP netCDF reads in place over/vsicurl/.cng-datasets mdim-workflowgenerates the cluster fan-out: setup-bucket → onemdimpod per chunk → merge at--chunk-resolution> 0. It sharesraster-workflow’s chunk listing, indexed-Job spec, merge step and orchestrator (the shared pieces are_hex_fanout,_indexed_hex_job_specand_count_chunks). Generation opens the first input to fail fast on a wrong variable, calendar or time window.
Fixed¶
--layeron a multi-source zip selects that source, and a missing layer is an error instead of a segfault (#216). DuckDB’sST_Readsegfaults (SIGSEGV, no traceback) when asked for a layer its source doesn’t contain. It does this on shapefiles and GeoPackages alike (DuckDB 1.5.4).--layeron an archive was passed to every source in it, so a zip with a point and a polygon shapefile crashed whichever layer was asked for. That covers the published UNEP-WCMC coral reef release. A--layertypo on a single source crashed the same way. Now:--layernarrows an archive to the sources that hold the layer.An explicitly listed source that lacks the layer, or a layer found nowhere, raises an error naming the available layers.
Sources that can’t share one table are refused before they’re merged, with a message pointing at
--layer. That means different geometry types, or different columns: the merge is positional, so equal column counts in a different order used to put values under the wrong names without an error.
0.9.0 - 2026-09-29¶
Added¶
workflow --chunk-size Nsets the number of features per hex chunk (#237). The generator never went below 1000 features per chunk, and no flag could change that, so any vector dataset under 1000 features got a single hex pod however large its polygons were. Hex memory follows the H3 cells of the features in a chunk, not how many features there are, so a small-count, large-feature layer is exactly the case that needs small chunks. The 847-feature ecoregions layer at res 8 now generates the 170 × 5 fan-out that production runs from a hand-tuned manifest. The default is unchanged. If the requested size would need more than--max-completionschunks, it is still raised to fit, and the generator now says so instead of overriding an explicit memory decision without a word. This is a manual control; sizing chunks automatically from feature size is #124.
Changed¶
Behaviour change: vector hex chunks are planned by estimated H3 cells, not a fixed feature count (#124). A hex pod’s memory and runtime follow its features’ cells, and those are extremely skewed: on IUCN ranges at res 6 the median feature is 345 cells and the largest 2.5 M. Measured on three published layers, the largest chunk under the fixed rule was 2.2–2.4× the mean (207 M cells on EPA L4 ecoregions), and lowering the count by hand made it worse (8–36×).
workflownow emits a plan step between convert and hex.cng-datasets vector-planestimates each row’s cells and cuts the GeoParquet into contiguous row ranges at a cells budget (--cells-per-chunk, default 5 M), never exceeding the old 1,000 features per chunk. Point layers are therefore chunked as before, and heavy polygons are split further; the same three layers balanced to 1.0–1.2×. The plan pod reports its chunk count as its termination message, and the orchestrator patches the hex Job’s completions to match before applying it. The hex YAML as generated carries an upper bound (min(--max-completions, rows)), so apply it throughworkflow.yaml. A hex index past the end of the plan exits cleanly; that is the fallback for a hand-applied or Armada hex job. If the budget needs more chunks than--max-completionsallows, it is raised to fit, with a warning. A plan that no longer matches the GeoParquet fails the hex pod instead of dropping rows.--chunk-size N(#237) still gives fixed chunks and turns planning off.
Fixed¶
Vector hex pods bound DuckDB to the pod, not the node (#255). Vector DuckDB connections never set
memory_limit, so DuckDB sized its buffer manager at 80% of the node’s RAM: an 8Gi hex pod on a 250 GiB node believed it had about 200 GiB. It never spilled, and a large feature was OOM-killed by the cgroup instead. The raster hex step had the same bug, fixed in #227. The vector hex job now carriesDUCKDB_MEMORY_LIMITat 85% of--hex-memory, and every vector DuckDB connection applies it, normalising Kubernetes spellings like8Gi(#217). Hex pods now spill to/tmpwhere they used to be killed, so a very large feature may need more--hex-storage.Workflow orchestrators stop when a step fails, instead of waiting out its timeout (#258). Each step was awaited with
kubectl wait --for=condition=complete, which never returns for a Job that has failed. A dead hex step therefore held the vector orchestrator for its full 48 h, lookingRunningthroughout. Both the vector and raster orchestrators now wait with await_jobhelper that returns onCompleteand exits immediately onFailed, printing the Job’s failure reason and thekubectl logscommand to run. Repartition’s incomplete-output error now lists a failed hex index as the likeliest cause, ahead of the #170 truncation it used to blame.The oversized-feature guard works everywhere, not just between 90°W and 90°E (#253). The #107 guard measures each feature with DuckDB’s
ST_Area_Spheroid, which reads coordinates as (latitude, longitude), while every geometry here is (longitude, latitude). Any feature beyond ±90° longitude measuredNaN. BecauseNaNsorts above every number, one such feature also hid the chunk’s real worst feature, so the guard was off for any chunk touching the Americas west of the Mississippi, East Asia or Australia. There, an oversized feature hit the raw C++ page-size assertion again instead of the guard’s clear error. On the published ecoregions layers, 404 of 847 and 4,007 of 5,896 features measuredNaN. Areas are now computed on flipped axes and match a known answer at any longitude. Output data was never affected; only the guard.
0.8.3 - 2026-09-28¶
Added¶
The image ships 7-Zip (#245). ArcGIS map, project and layer packages (
.mpk,.ppkx,.lpkx), which USGS ScienceBase uses for data releases, are 7z archives around a file geodatabase. GDAL,/vsizip/and Python’szipfilecan’t open them.7zis now on PATH inghcr.io/boettiger-lab/datasets, so stage jobs no longer need anapt-get installat runtime, which fails when the pod can’t reach the apt mirrors.
Changed¶
--window-reads autonow windows any remote source, including at the default--chunk-resolution 0(#209). Previously only sub-h0 chunking windowed, so each pod in the default 122-pod fan-out copied the whole COG to local disk: 4.1 GB per pod for LANDFIRE CONUS, now the largest use of ephemeral storage in the hex step since #226 removed the fill-collapse intermediate. Each h0 pod now reads only its own window, plus the H3 protrusion margin. Windows are now written with ZSTD compression and the band’s predictor, so a large window can’t take more disk than the compressed COG it replaces.--window-reads neverrestores whole-file localization. The output is identical.
Fixed¶
Raster hex no longer crashes on an all-nodata h0 when writing to S3 (#238). With
--hex-resampling fractionsand--nodata, an h0 that overlaps the raster but contains only nodata filters every row out, and the partition that had just been written was then deleted withos.remove()— which cannot delete ans3://object. Every such index in a 122-completion Job failed with exit 1 and left a 0-row partition behind. The row count is now checked before anything is written, so an empty chunk writes nothing and returns cleanly, whether the output is local or remote.--hex-resampling sumno longer writes a0.0row for every cell without data (#232). Empty cells were dropped by testing the value for NaN. That works formean,max,minandmode, but an emptysumis0.0, so it was never dropped. One CONUS build wrote 2.5 billion rows, 95% of them zero, for totals that were still correct. Cells are now kept only when they cover at least one valid pixel (exactextract’scount> 0), for every single-value reducer. Cells over pixels that genuinely measure zero are still written.sumlayers built before this fix have correct totals but many extra zero rows, and are worth rebuilding.
0.8.2 - 2026-09-28¶
Fixed¶
Polygons crossing ±180° are no longer filled the long way round the globe (#241). Any feature whose planar longitude bbox spanned more than 180° was cut into 90° longitude bands (the #145 fix for circumpolar features), and that included narrow features that merely cross the antimeridian. For those, the pieces covered the wrong-way ~359° region: a ~150 km² box at 180°E/52°N hexed to 54,521 res-7 cells around the globe instead of 28. Large crossers hit the #167 fail-fast error; smaller ones wrote those cells without any error. Crossers are now identified by their vertex longitudes (a gap of more than 180°) and left to H3, which fills them the short way. Circumpolar features are still split. The size guard,
--resolution-by-areabinning and the sub-cell fallback point also use the short-way extent. This also fixes single-part lines that jump across 180°. Datasets with features crossing ±180° should be rebuilt.workflowfails on a source it can’t read instead of inventing a feature count (#235). When counting failed (a 404, a typo in the bucket name, missing credentials), the generator assumedmax_completions × 1000features, exited 0 and wrote a complete, plausible-looking 200-way hex fan-out. For a small source that made each chunk up to 200× larger than a real count would. It also suggested a--chunk-sizeflag thatworkflowdoesn’t accept. It now exits non-zero before writing anything, with an error naming the source and the cause. For a source that is right but can’t be counted from where you generate (for example, not uploaded yet), pass--expect-features N: the hex job is then sized from that count, which the convert step already enforces at runtime.
Documentation¶
AGENTS.md: verify tool changes in cluster Jobs, never on the dev pod (#246). New section Verifying Changes to the Tool: reproduce an issue’s MRE on the released image before writing code, then test the branch in a short Job that clones it inside the image. It includes a copy-paste manifest. A new What NOT To Do bullet rules out building environments or running tests, MREs or the CLI on the shared dev pod.
0.8.1 - 2026-09-28¶
Fixed¶
Line hex no longer drops cells the line passes through (#239). Lines were buffered by one average H3 edge length in degrees and polyfilled by center containment. A degree of longitude is only
cos(lat) × 111 km, so the east–west buffer shrank with latitude (half an edge at 60°), and H3 cells vary ~2× in size, so even at the equator cells larger than average fell outside it. On the 4.0M-segment global coastline build at res 8, 14–17% of segment start-point cells were missing at 45–75° latitude. Lines are now given a ~1 cm sliver buffer and polyfilled with H3’soverlapcontainment, which yields exactly the cells the line intersects, at any latitude and on both the fixed- and variable-resolution paths. Output for lines changes: no missed cells, and no longer the extra cells whose centers merely lay within an edge of the line. Polygon and point hexing are unchanged. Line datasets hexed before this fix should be rebuilt.
0.8.0 - 2026-09-21¶
Added¶
Every published parquet records what built it. The hex partitions, the merged
data_0.parquet, the vector repartition output and the GeoParquet now carrycng_datasets_version,built_at,gdal_version,duckdb_versionand — when the environment setsCNG_IMAGE— the image, in the file’s own key-value metadata rather than a sidecar, so the stamp survives every copy, sync and re-publish:SELECT key, value FROM parquet_kv_metadata('…/h0=*/data_0.parquet'). Nothing recorded this before, and generated manifests pin…/datasets:latest, which is rebuilt on every push tomain— so the code that produced a dataset was not necessarily a released version, and there was no way to find out which. That matters when a build turns out to have been wrong: the multi-band mislabel (#214) published 384,922,346 rows of one variable documented as another, and answering “which datasets came from a version with that bug” meant correlating S3 timestamps against git history, per dataset, by hand. A dataset with no stamp predates 0.8.0 and should be checked against 0.7.0’s correctness fixes (#214, and #213/#218). The library versions are there because two of this project’s sharper problems were environment-dependent rather than code-dependent — a GDAL withoutWarpOptions(cutlineWKT=)(#197) and one without OGR’s Parquet driver — and neither was answerable after the fact from the dataset alone. A stamp that cannot be built is omitted rather than raised, so provenance can never be the reason a dataset fails to write
Changed¶
The worker builds its cells in DuckDB, straight to a file, instead of as Python geometry. A chunk’s
vecwas a GeoDataFrame of shapely polygons parsed from boundary WKT — measured at ~201 MiB per 100,000-cell chunk, in every worker, for every chunk: 125 MiB of WKT strings, 32 MiB of shapely objects and 35 MiB of GeoDataFrame, about 2.1 KB per cell. DuckDB now generates the boundaries and writes them to a FlatGeobuf that exactextract reads by path, so the process holds no geometry at all. Expressed as a CTE rather than a temp table, so DuckDB pipelines generate → filter → write instead of materialising the chunk; the boundary is computed twice, once per statement, which is cheap against holding 100,000 polygons. Measured at +137 MiB against +246 MiB for the route it replaces, and what remains is inside a component with a configuredmemory_limitthat spills, rather than Python objects that only grow. The antimeridian keeps the tested path: a cell with vertices either side of ±180 has a planar polygon that is a ~360° ribbon, and integrating that instead of its true footprint is #88 — those are still split with shapely, as a second vec source over the same ops, which at resolution 8 is ~2,300 of an h0’s 5.7M cells and for most h0s none at all. Equivalence with the in-memory construction is asserted on values, at mid-latitude and across the seam, and needs no special driver so it runs everywhere (#173)exactextract writes its results to disk itself, instead of through pandas. exactextract is C++ and can serialise through GDAL, so a chunk’s rows need never become a Python object in the worker at all: it writes a parquet file, and DuckDB normalises it into the part the parent reads. The pandas writer remains the fallback, because
output="gdal"needs an OGR driver that can write the result — Parquet, which the runtime image (ghcr.io/osgeo/gdal:ubuntu-full-latest) ships and most distribution GDALs do not. Which writer runs is feature-detected, never assumed from the local environment: assuming it is how thecutlineWKTgap reached a release (#197).include_geomis false, so what reaches disk is the statistics and the cell id, not the cell boundaries — at 100k cells per chunk those would dwarf the values they describe. Thefractionsreducer benefits most: exactextract’s parallelunique/fracarrays were exploded withnp.repeatover object arrays, and are now list columns that DuckDBUNNESTs. The transient-read retry (truncated Ceph tile reads under concurrency) is shared by both paths rather than duplicated, so they cannot acquire different ideas about what is worth retrying. A cell with no covered pixels is reported by the two writers differently — pandas as a null, GDAL as a float NaN — andIS NOT NULLdoes not catch a NaN, so cells whose value was NaN were briefly published by the new path. Both writers now testIS NOT NULL AND NOT isnan(...), and the partition-integrity suite asserts the absence of NaN as well as of nulls. Note the idiom that does not work: DuckDB definesNaN = NaNas TRUE, so the IEEE-754x = xtest is a no-op there, which is pinned by its own test. That defect existed only in the runtime image, because that is the only environment with the driver the GDAL writer needs, and CI is where it was caught.CNG_HEX_GDAL_WRITER=0forces the pandas route for a like-for-like comparison, and the equivalence of the two is asserted acrossmean,modeandfractionswherever both are available (#173)The hex step accumulates in DuckDB, not in pandas, and every process in the pod is now sized from the pod. Each worker writes its chunk straight to a parquet part and returns the path; the partition is then one DuckDB statement over those parts, so the parent holds nothing proportional to the cell count. It previously collected every worker’s rows as a pandas frame, held them all in a list and
pd.concat-ed them — which allocates the result while the inputs are still referenced, doubling the process’s peak at exactly its largest moment (measured at 1.95× the list it consumes). exactextract can only emit pandas, GeoJSON or an OGR datasource, so one frame per chunk is unavoidable; holding all of them was not. Alongside it, three things in a hex pod that defaulted to a share of the host rather than the pod: DuckDB’s buffer manager (80% of host RAM — nowDUCKDB_MEMORY_LIMITat 85% of the pod, in both the parent and each worker, which also turns its behaviour under pressure from fail into spill), GDAL’s block cache (per worker process, 5% of host RAM — 12.6 GiB each on a 251 GiB node, nowGDAL_CACHEMAX=512MB), and the worker count, which #227 had already dealt with. The block cache is the one that scales with the fan-out, since a hex pod runs many processes and only the single-process preprocess-cog step had ever bounded it. Every aggregation now also prints the memory model’s prediction beside the peak actually reached, so the constants are corrected by production rather than by argument; the peak is read from the cgroup only when the cgroup is actually bounded, since an unbounded one reports every process on the machine (#173, #209)
Fixed¶
--h0-subset/--h0-cellsare no longer ignored on the serial path.process_all_h0_regions— whatcng-datasets rasterruns when given neither--h0-indexnor--chunk-index— looped overrange(122)and never consulted the subset, which applied only toenumerate_chunk_cells. So the flag parsed, validated its range, printed the restriction it had resolved (✓ H3 base cells [...] → h0 grid positions [...]) and then processed the entire grid anyway, reportingProcessing h0 grid position 0 ... 121whatever was asked for. That is the same shape of defect as #213 and #218 in a different register: nothing fails, and the output covers ground the caller did not ask for. The positions now come from the grid through the sameenumerate_chunk_cellsthe workflow generator andprocess_chunkuse, so the list cannot drift from the grid it indexes into, and the hardcoded 122 is gone with it. A serial run also now refuses achunk_resolutionwithout a chunk index, which the CLI already refused — reaching the library directly would otherwise aggregate whole h0 cells into files named as sub-chunk parts (#215)The fill-code collapse no longer writes the whole grid to every pod’s disk. exactextract honours one band nodata, so a categorical source’s extra fill codes (#108) were remapped by staging an uncompressed copy of the entire source. That copy is
grid pixels × bytes per pixel— independent of the source’s compression, and independent of the chunk the pod is working, so all 122 pods wrote the same full-grid file: 34 GB per pod for the LANDFIRE CONUS Int16 grid, against theephemeral-storage: 40Githe generator itself emits. Every pod on the two largest layers of a tranche was evicted, and an ephemeral eviction surfaces as exit 137 — byte-identical to an OOM kill inkubectl get pods— so it reads as a memory problem and was first chased as one, through a 64 → 128 Gi raise that changed nothing while the pods died at 21–23 GiB. The remap is a pure per-pixel value substitution, which GDAL can express as a VRT<LUT>on a ComplexSource: no pixels are written at all, the file is a few kilobytes, and the table is applied on read. Identity is anchored at both ends of the band’s range so the only values the table moves are the fill codes themselves. Integer bands only — a lookup table interpolates between its entries, so a float source would be silently distorted; float sources keep a materialised copy, now compressed with the predictor that matches the band type. A source that cannot be expressed exactly (a float band, a fractional code, a primary the band type cannot hold, a 64-bit band past the 2^53 a LUT’s doubles represent) is refused rather than approximated, because a quietly wrong value is worse than a large temporary file. Note which sources were affected: the generator’s preprocess-cog step already collapses the codes once, but it is skipped when the source is already a single-band COG needing no clip — so the full fill list reached the hex pods precisely when the input was in the best shape (#209, #108)
Changed¶
An unreadable CPU quota no longer means “use every core on the node”. The hex worker count defaults to the pod’s cgroup CPU quota, and when that cannot be read it fell back to
os.cpu_count()— which inside a pod is the node’s core count, not the pod’s limit. On NRP that meant⚠ No cgroup CPU quota readable — falling back to 256 host CPUsinside a pod limited tocpu: 8: a 32× oversubscription of a shared node (#215). It is a memory setting more than a CPU one — peak RSS is roughlyworkers × bytes-per-cell × cells-per-chunk— and the worker term dominates: the same LANDFIRE res-10 layer, unchanged in every other respect, peaked at 190.5 GiB and completed no slice in 3 h 40 m at 48–64 workers, against ~37 GiB with all six complete at 8 (#173). The fallback is now 8 (capped by the machine), and the warning names the core count it declined to use. The two failure modes are not symmetric — too few workers is slower, too many is an OOM kill after hours of un-checkpointed work on a shared node — so when the pod’s limit is unknown the default is the one measured to finish. The quota read is also split from the decision that uses it (_cgroup_cpu_countnow returnsNonerather than guessing), since a container whose/sys/fs/cgroupis the host root reportsmaxwhile genuinely being limited, and that is a fact about the container rather than an answer to “how many workers” (#195, #215, #173)The hex step enumerates only the cells the source can reach. A chunk used to enumerate every descendant of its chunk cell —
7^(res − chunk_res), 5,764,801 for a res-8 h0 — whatever the raster covered, so the cost of hexing was set by the cell and the grid rather than by the data. A 196×169 pixel raster in California paid for all 5,764,801 cells, a 196× overshoot, which is why a fan-out over many small rasters cost the same per raster as a continental one and could not be run in a working day (#215). The chunk’s hierarchy is now descended a level at a time: a subtree whose footprint misses the source is dropped whole, and one that lies entirely inside it is taken whole without descending, so the work follows the source’s perimeter rather than its area. Measured at res 8: 5,764,801 → 29,418 cells on that raster (196×), 20.5× on an antimeridian seam raster, 16.5× polar, and still 2.0× on a CONUS-scale source — and the descent is faster than the enumeration it replaces in every one of those cases, because it never materialises the ids it is about to discard. Each chunk now prints what it kept (✓ 29,465 of 5,764,801 cells reach the source (0.5% of the chunk)), which is the figure that explains its peak memory and runtime, at the point it is decided rather than afterwards. The prune is lossless by the same margin the sub-chunk overlap test already used, and the gate is exhaustive rather than sampled: against every one of the 5,764,801 children of an h0 it drops none of the cells that genuinely touch the raster. Antimeridian cells are the sharp edge — a cell wrapping the dateline has a planar box that can exclude 86° of longitude it actually covers, so it is judged on its true two-interval footprint, and a fixture picked to isolate exactly that is part of the suite.CNG_HEX_PRUNE_CELLS=0restores the full enumeration for a like-for-like comparison (#215, #173)
0.7.0 - 2026-09-20¶
Added¶
--h0-cellsonrasterandraster-workflow: the same fan-out restriction as--h0-subset, given as H3 base cell numbers rather than h0 grid positions, converted against the grid at generation time and echoed (✓ H3 base cells [9, 19, 20, 21, 34, 36] → h0 grid positions [12, 14, 20, 50, 71, 78]). The two flags are one restriction in two numberings, so passing both is refused rather than resolved by a precedence rule nobody would think to look up (#213)
Fixed¶
Generated raster merge jobs no longer die on their first statement.
raster-workflowwrote the merge pod’sDUCKDB_MEMORY_LIMITas a Kubernetes quantity (16Gi), andmerge-chunkshands that straight toSET memory_limit, which DuckDB rejects —Unknown unit for memory: 'gi'; it accepts onlyKiB/MiB/GiB/TiBorKB/MB/GB/TB. Every chunked raster build was affected, and the failure landed after the whole hex fan-out had run, so the cost was a completed multi-hour build that could not be consolidated without hand-editing manifests. The generator now emits DuckDB’s spelling, andmerge-chunksandrepartitionboth normalise whatever reaches them, since the env var is also set by hand during recovery. Translation is in one place (cng_datasets/duckdb_memory.py) and the regression gate is DuckDB itself rather than a string comparison — a string check would not have caught the original either, because16Gilooks entirely reasonable. The merge’s DuckDB limit also drops to 85% of the pod’s memory, matching what the repartition step has always done:memory_limitbounds DuckDB’s buffer manager, not the process, so a limit equal to the cgroup’s trades a parser error for an OOMKill (#217)The hex path no longer silently reads band 1 of a multi-band raster.
cng-datasets raster --output-parquetpassed the source to exactextract with no band index, and exactextract defaults to the first band;--bandwas documented as “mosaic only” and was never consulted when hexing. Nothing in the run, the output schema or the parquet said which band was used, and the value column is named by--value-columneither way — so the output looked correct and carried a label asserting it was something it was not. This published 384,922,346 rows of annual forb & grass cover documented as perennial cover, two variables in the same 0–100 domain that no value-range or schema check could tell apart (#214). Two changes: hexing a multi-band source with no band selected is now refused outright — a job that fails at submission is far cheaper than a dataset that has to be re-measured against the source to be doubted — and--bandis honoured on every path, not just the mosaic. The band is selected once, at the source, as a single-band VRT view, so nodata detection, the windowed read, the fill-code collapse, exactextract and the warp all see a raster with exactly one band and no later step can pick differently.--bandonraster-workflowis unchanged in behaviour (it adds a preprocess-cog step that subsets the band) but its help no longer says “multi-tile only”, which it never was--h0-subset’s own validation messages no longer describe the accepted range as “122 H3 base cells”. The range check cannot distinguish the two numberings — both run 0–121, so every base-cell list passes it — which made that sentence the one place a caller’s wrong list felt actively confirmed. The out-of-range error now names positions, states that base cell numbers share the range and are a different numbering, and points at--h0-cells; the empty-subset error gives the CONUS list in both numberings. Reported separately as #218 with the measured consequence: a western-US build derived base cells9, 19, 20, 34, 36by two independent methods, passed them to--h0-subset, and would have hexed open ocean and Antarctica for four of the five — roughly 80% of the dataset missing, with the job reporting success (#218, #213)--h0-indexand--h0-subsetare no longer documented as “h0 base cells”. They are positions in the h0 grid’s ownicolumn, which is an arbitrary permutation of the 122 base cells: position 12 is base cell 9, and exactly one of the 122 positions coincides with its own base cell. Both numberings run 0–121, so a base-cell list — which is what you get from the obvious approach of computing coverage with the H3 library — is accepted without complaint and resolves to entirely different cells. The job then succeeds, writes the expected number of partitions, and covers the wrong geography, which no structural check can catch. The mislabel is corrected in the CLI help, the generated manifest comment and the generator docstring;--h0-cellsabove gives the base-cell list a correct path; every pod now logs what its position resolved to in its first lines (h0 cell: 577199624117288959 (h3 8029fffffffffff, H3 base cell 20)) so a mis-specified subset is visible at start-up rather than in the finished product’s extent; anddocs/raster_processing.mdcarries the measured CONUS mapping plus the query that reconstructs it. That last part matters because the mapping was not derivable from any published artifact: readings3://public-grids/hex/h0-valid.parquetin row order sorts by cell id and therefore by base cell, giving position == base cell for all 122 rows — a confident, self-consistent, wrong answer. It is theicolumn, not the row order (#213)
0.6.0 - 2026-09-13¶
Added¶
--armada-queueonworkflowandraster-workflow. A submitted Armada job set carriesqueueat the top andnamespaceon each job: the queue is Armada’s scheduling and accounting entity, the namespace is where the pods are actually created. NRP maps them one-to-one by convention, not by format, and the generators hardwiredqueue = namespacewith no way to say otherwise. It still defaults to the namespace (#183)namespaceis now a cluster-profile field, so a site sets it in one place rather than on every command.--namespacestill overrides it (#201)cng-datasets gapfill: emits an Armada job set that re-runs exactly the sub-h0 chunks that never completed. Armada exposes no retry service on NRP —armadactl get retry-policiesreturns Unimplemented — and a preempted job is not rescheduled, so a transient fault leaves a permanently missing chunk; at an observed ~0.1% failure rate a few-thousand-unit fan-out loses one or two every run, which makes gap-fill a pipeline stage rather than an exception. Gaps come from the completion markers on S3, so this needs no Armada and no Kubernetes access — it runs as an ordinary S3 client after a job set finishes, whatever submitted it; only re-submitting needsarmadactl. Exits 0 when nothing is missing and 1 when a job set was written, so a pipeline can branch on it the way it would ondiff. The k8s backend does not need this:backoffLimitPerIndexretries a failed index in place, which is precisely the budget conversion cannot carry across (#183, #173)duckdb-bugreport.md: a minimal reproducible case forINTERNAL Error: Calling GetValueInternal on a value that is NULL, which the H3 extension raises when a list-returning function reads a dictionary-encoded Parquet column — and which invalidates the DuckDB connection, so every later query in the process fails too. Dictionary encoding is the default in every common Parquet writer and applies to any column with repeated values, so this is reachable from ordinary data; the report isolates encoding from row count with controls, lists the four affected functions (all of which return a list from a scalar argument), and relates it to upstream #136 and #120. Worked around here by expanding the chunk list one h0 at a time with the cell as a literal
Changed¶
The merge pod’s ephemeral storage default drops from 100Gi to 50Gi, the house limit.
geo-workflowsenforces no cpu, memory or pod quota — only priority-class bans — butbiodiversitycaps pods at 200, and sizing for the stricter namespace keeps a build portable between them. The merge holds one partition at a time and deletes it after upload, so it never needed the larger figure.tests/.../TestResourceNormsnow asserts 50Gi ephemeral and 200 concurrent pods against the emitted manifests, so a future default cannot quietly exceed them. Note the pod limit binds onparallelism, notcompletions: apods: 200quota counts pods alive at once, so an 842-completion fan-out at parallelism 61 is fine (#201)Behaviour change: the default Kubernetes namespace is now
geo-workflows, notbiodiversity, in both theClusterConfigdefault and the built-innrpprofile. Generated manifests, the workflow RBAC and — because the Armada queue follows the namespace — the queue a converted job set submits to all move with it. Pass--namespace biodiversityto keep the old target
Fixed¶
A partly failed sub-h0 fan-out can no longer be published as a complete dataset.
merge-chunksconsolidated whatever part files it found and then, with cleanup on, purged the chunks prefix — so a build that lost chunks produced a short dataset, exit 0, with the evidence deleted. Counting parts cannot detect this: a chunk that does not overlap the raster legitimately writes none, so a missing part is indistinguishable from a chunk that never ran. Every chunk now records a completion marker whether or not it wrote data, and--expect-chunks N(emitted automatically byraster-workflow, which sized the fan-out) makes the merge refuse to run unless that many chunks completed. The missing chunks are enumerated, not counted: a count answers “48 of 49” and leaves you to find the one, which on a few-thousand-unit fan-out is the entire problem, so the error names the indices andcng-datasets gapfillre-runs precisely those. Checked before anything is read or written, so a refused merge costs nothing and leaves every chunk in place. The risk was concentrated on the Armada backend, whose converted jobs carry no retry budget (#183) and which is where--backend autoroutes a large fan-out (#173)
0.5.0 - 2026-09-10¶
Added¶
--chunk-resolution Nand--max-hex-memory SIZEonraster-workflow, closing the loop on #173: the engine gained sub-h0 chunking in 0.4.0 but nothing emitted it, so the memory win was unreachable from generated output — the same gap--hex-workersclosed forCNG_HEX_WORKERS.--max-hex-memorypicks the coarsest chunk resolution whose estimated peak fits the budget, coarsest rather than finest because each extra level multiplies the pod count about sevenfold and every pod schedules, pulls the image and reads the source. The estimate is7 ** (h3_resolution - chunk_resolution)cells times a measured 121 bytes per cell, a constant taken from the res-9 run in #173 because peak RSS grows sub-linearly in cell count; it reproduces all three measured points (282M cells → 31.8 GiB modelled against ~32 measured, 40.4M → 4.55 against 4.6, 5.8M → 0.65 against 0.68). It models the cell enumeration, which is the term that scales with chunk size — reported at generation time as a floor, not a guarantee (#173)A merge step on sub-h0 raster builds. Chunks are staged to
hex-chunks/and consolidated intohex/h0=*/data_0.parquet, so nothing reading the published tree ever sees half-merged parts and the layout does not depend on how finely the build was chunked. Emitted into the workflow ConfigMap and sequenced after the hex step; converted alongside every other step under--backend armada(#173)--backend autoonraster-workflow: routes to Armada once the chunk count exceeds the ~200-pod namespace guideline, and to k8s below it, printing which it chose and why. Fine chunking is what makes an external queue necessary, which is #183’s finding 1 seen from the scheduler side and the reason #39 was blocked on this work. An explicit--backend k8spast the guideline is warned, not overridden — silently switching what an operator asked for is the same class of surprise this work exists to remove (#39, #183)--merge-memory/--merge-storagefor the merge pod (defaults 16Gi / 100Gi). The merge streams one partition at a time, so neither tracks the dataset’s size
Changed¶
Behaviour change (scheduling): hex and COG pods no longer default to
priorityClassName: opportunistic; the default and the built-innrpprofile now omit it, giving default priority 0. On NRPopportunisticis priority -2000000000, the lowest available, and preemption exposure scales with pod runtime — so the class was applied to exactly the pods least able to absorb it: multi-hour, un-checkpointed work that restarts from zero. Measured on a real LANDFIRE build (#201), six identical res-10 slices spread 5x in runtime, ~7 h to a projected ~52 h, with every pod saturating its full CPU request — contention, not scheduler CPU starvation. The counterfactual from an earlier build: raising priority while halving parallelism improved per-pod runtime, 117 min against 3h32m for identical work, so the old default was likely slower as well as riskier. Trade-off to know before upgrading:opportunisticlets a build exceed its namespace quota and default priority does not, so a large fan-out that relied on that will now hit the quota rather than running slowly. Pass--priority-class opportunisticto restore it (#201)Behaviour change (retries): the hex fan-out no longer carries
backoffLimit: 0. That is a job-wide budget, so one pod failure anywhere failed the whole fan-out. It is replaced bybackoffLimitPerIndex(default 2) andmaxFailedIndexes(default 1), so a flaky slice retries instead of taking hundreds of healthy ones with it, and a systematic failure stops the Job rather than burning hours on the rest.backoffLimitis deliberately omitted rather than set alongside them: Kubernetes ignores the job-wide budget once a per-index one exists, and emitting both misleads anyone reading the manifest. Configurable via--hex-retriesand--max-failed-indexes. Note the existingpodFailurePolicyalready ignoredDisruptionTarget, so preemption was always retried — the gap this closes is every other way a multi-hour pod can die: an OOM, a truncated Ceph read, a node going away without setting the condition. Filed againstraster-workflow; the vector generator had the same shape and is fixed with it (#201)The merge job’s
backoffLimitgoes from 0 to 2. It runs after hours of hex work, and a transient S3 failure should not throw that away (#201)Chunk enumeration moved to a shared
enumerate_chunk_cells, used by bothRasterProcessorand the workflow generator. The generator sizes a Job’s completions from this list and a pod indexes into it; computing them separately would let them disagree, and a fan-out narrower than the list drops whole chunks with a clean exit (#173)
Fixed¶
A fan-out past a 50,000-chunk ceiling is now refused at generation. Nothing stopped
--chunk-resolution 10, or a--max-hex-memorysmall enough to select it: the generator would try to materialise a 282-million-entry chunk list and hang before writing a single manifest, and had it succeeded it would have emitted a Job of 282 million pods. The bound is checked from7 ** chunk_resolutionbefore any enumeration, so the check itself costs nothing (#173)
0.4.0 - 2026-09-09¶
Added¶
--simplify-toleranceoncng-convert-to-parquetandworkflow:ST_SimplifyPreserveTopologyapplied after reprojection, so the tolerance is in target-CRS units (degrees for EPSG:4326; ~0.0001 ≈ 10 m). Large high-vertex sources such as national FEMA NFHL at full FIRM precision are far finer than the H3/tile target needs and overflowed the PMTiles ephemeral cap, which previously forced a hand-rolled DuckDB simplify job. PreserveTopology avoids collapsing polygons to invalid or empty geometry (#132)First-class CSV lat/lon point input on
cng-convert-to-parquet..csv/.tsvsources now route to a dedicated path:read_csv_auto+ST_Point(lon, lat)in EPSG:4326, wrapped inST_MakeValid, carrying every source column as an attribute and adding the synthetic_cng_fid. Columns are resolved from--lat-column/--lon-columnor auto-detected from common names (Latitude/lat/y,Longitude/lon/lng/x,decimalLatitude), so a standard CSV needs no flags at all. NULL coordinates yield NULL geometry rather than crashing, and out-of-range values warn (the usual sign of swapped columns). CSV with lat/lon columns is the common distribution format for point observations — species occurrences, sensor stations — and previously required a bespoke DuckDB job (#78)--trim-stringsoncng-convert-to-parquetandworkflow: strips spaces, tabs, CRs and LFs from the ends of every VARCHAR column during conversion. Upstream sources sometimes carry stray whitespace in categorical fields — WDPA stores the fully-no-take category as'All 'in the source GDB itself — so every consumer’sWHERE NO_TAKE = 'All'silently returns zero rows. Emitted as a DuckDB star-REPLACE, so column order, non-string columns, geometry handling and the_cng_fidwrapper are untouched, and interior whitespace is left alone since it is usually meaningful. Off by default: no attribute value is mutated unless asked (#180)cng-datasets pmtiles-columns <source>pluscng_datasets/vector/pmtiles.py: read tile-accuratetable:columnsfrom a PMTiles footer. tippecanoe writes only a subset of source columns into the vector tiles, so the PMTiles schema differs from the source Parquet schema, and STAC collections here are authored by hand — the only way to know which fields survived was to byte-range the footer with a throwaway script. Parses the PMTiles v3 header over a local path or anhttp(s):///s3://byte range, fetching only the header and metadata blob and never the multi-GB tile body (#140)--window-reads {auto,always,never}oncng-datasets raster: a chunk reads only its own window of the source COG instead of localizing the whole file. Full localization is a fixed cost per pod, so total transfer scaled with the fan-out rather than with the data — tolerable across 122 h0 pods, ruinous across the thousands that sub-h0 chunking creates (a 2 GB COG at h2 would move ~12 TB). A COG is internally tiled, so GDAL fetches only the tiles the window touches. Measured on a 4 MiB tiled fixture: at h2 chunking, 14.5 MiB windowed against 196 MiB of whole-file copies (13.5x); at h3, 20 MiB against 1.37 GiB (68.6x). The windowed total grows slowly with depth (4 → 12 → 14.5 → 20 MiB) while the copy total grows linearly with the chunk count, which is the point — transfer becomes proportional to the data, not to how finely it was chunked.autowindows when--chunk-resolution > 0and the source is remote: a window over a local file transfers nothing and would only decode and re-encode the region (#173, lever C)--chunk-resolution N/--chunk-index Koncng-datasets raster, plus acng-datasets merge-chunksstep. The unit of work was fixed at one h0 base cell — the only chunk knob — so peak memory tracked the densest h0’s native-cell count regardless of how small the raster’s own footprint was: ~282M cells and ~140 GiB measured at res 10, which is why large builds needed an oversized flat memory request that then struggled to schedule.--chunk-resolutionmakes the unit an h0’s res-N descendant instead, cutting the largest chunk’s cell count ~7x per level (measured in #173: h1 4.6 GiB, h2 0.68 GiB, against ~32 GiB for a whole h0). H3 nests exactly, so descendants tile their parent with no seams to dedup and no gaps — unlike bbox tiling, where a native cell straddling an edge would be split or double-counted. Sub-chunks writepart-{cell}.parquetandmerge-chunksconsolidates each h0 back to the single publishedh0={cell}/data_0.parquet, streamed per partition, so the layout does not depend on how finely the build was chunked.--h0-subsetis accepted here too, applied at chunk granularity. Default behaviour is unchanged: at--chunk-resolution 0the index-to-cell mapping, the geometry source and the output path are all exactly as before (#173)--hex-workers,--hex-chunk-sizeand--hex-cpuonraster-workflow.CNG_HEX_WORKERS— the number of chunks a hex pod holds in flight — is the one lever that reliably brings a hex pod’s peak memory down, but nothing emitted it, so a generated manifest could not set it and a hand-tuned one lost it on regeneration with nothing in the diff to explain the OOM that followed. Peak RSS is roughly workers × chunk size × bytes per cell;--hex-memoryis not an equivalent lever, since a request large enough to matter makes the pod contend for scarce large-RAM nodes and converts a retryable OOM into an unschedulable pod.--hex-cpualso makes the previously hardcoded CPU request configurable. The generator now prints the resulting pod profile (cpu 4, memory 32Gi, 4 workers × 100000 cells/chunk) so an oversubscribed pod is visible before it is applied. Onlyraster-workflowgets these: the vector hex step runs no worker pool and never reads the variables, so emitting them there would be a knob that does nothing (#195)--expect-features Noncng-convert-to-parquetandworkflow: the row count the conversion is expected to produce, known independently by the caller. The conversion exits non-zero when the written count differs, so a silently truncated source fails the job rather than flowing into the hex and PMTiles steps. Every conversion now also logsWrote N rowsunconditionally — previously the tool never reported a count anywhere, so a run that converted a third of its input produced a log byte-identical to a complete run and there was no signal, for a human or a pipeline, that most of the data was missing (#186)--lat-column/--lon-columnon theworkflowsubcommand, passed through to the convert step. They existed oncng-convert-to-parquetbut not onworkflow, so a CSV point source could not be a--source-urlfor a generated pipeline at all — it had to be pre-converted in a separate job (#188)--csv-sample-sizeoncng-convert-to-parquet, for a CSV too large to scan in full (#188)--h0-subsetonraster-workflow: the h0 base cells the source overlaps, e.g."12,14,20,50,71,78"for CONUS. The hex job then runs one completion per listed cell instead of all 122, and the completion index selects from the list. A regional raster previously started 116 pods (95%) that each localized a multi-GB COG, found no overlap with their h0 and exited — the reason large regional recipes in the catalog were hand-edited away from generator output. The list is sorted and de-duplicated so an index maps to the same cell across regenerations; cells outside 0-121 are rejected, and a subset naming all 122 collapses to the default fan-out. Parallelism is capped at the completion count, and the generated script fails loudly if the completion index has no cell rather than silently processing the first one (#191)--armada-priority-classonworkflowandraster-workflow: the Armada priority class was previously unreachable from the CLI, sinceconvert_workflow_to_armadaneither accepted nor forwarded one. Accepts a shorthand (default,preemptible,high) or a literal class name, and the generated-workflow summary now reports the class in effect (#183)
Changed¶
Behaviour change (regenerated vector workflows): hex completions are now right-sized to the chunk count.
_calculate_chunkingderivedchunk_size = ceil(total_rows / max_completions), which drove chunk size down to spread work across up tomax_completionschunks — shredding a small dataset into ~200 tiny pods, each pulling the multi-GB image and claiming a namespace-quota slot for a few dozen features (5,697 features → chunk size 29 → 197 pods). Chunk size is now floored at 1000, so completions isceil(total_rows / 1000)for small and medium datasets (5,697 → 6 pods) and only grows above the floor once the dataset would otherwise exceedmax_completions(711,583 → chunk size 3558, completions 200). 1000 matches the effective chunk size the old formula already produced at the 200k-feature scale, so per-pod memory and time are unchanged for large builds. Regenerating a small or medium workflow will emit a very different completion count — that is the fix, but it changes the manifest (#144)The H3 child-protrusion margin is now a measured constant (
_H3_PROTRUSION_MARGIN = 0.25of a chunk’s latitude extent) rather than an arbitrary half-extent. Sampled across the globe at chunk resolutions 1-3 for descendants 1 to 4 levels down, the protrusion converges rather than compounding — 0.127 at one level, 0.150 by three, unchanged at four — so one depth-independent margin is sound and 0.25 carries a ~1.7x safety factor. Both facts are pinned by tests, so a future H3 release that widens the bound fails here rather than in a build’s output. The two callers now take different sides of the trade deliberately: pruning a chunk keeps a looser 2x margin because a false positive costs one pod that exits in seconds, while a read window uses the measured bound directly because it pays for its margin in bytes on every chunk. Tightening it roughly halved windowed transfer at every chunk depth (#173)Generated raster hex jobs now pin
CNG_HEX_WORKERSandCNG_HEX_CHUNK_SIZEexplicitly, defaulting the worker count to one process per requested CPU. Previously neither was emitted and the pod sized its own pool from the cgroup CPU quota — which reads as unlimited whenever the container’s/sys/fs/cgroupis the host root rather than its own namespace, so the count silently became the node’s core count. One manifest therefore ran 48 workers on one node and 64 on another, on a pod requesting 4 CPUs, and its peak memory followed: measured 145-185 GiB against a 192 GiB limit, versus 115-144 GiB for the hand-written equivalent that set the variable. A hex pod’s memory profile is now a property of its manifest rather than of the node it lands on. Expect slower but bounded hex pods at the default; pass--hex-workersto trade back. When the quota genuinely cannot be read,cng-datasets rasternow says so and names the fallback instead of proceeding silently (#195)Breaking (Armada backend): converted jobs now default to the non-preemptible
armada-defaultinstead ofarmada-preemptible, and a k8sopportunisticpriority class no longer maps ontoarmada-preemptible. An opportunistic k8s pod is preempted but recreated by its Job controller; a preempted Armada job is not rescheduled at all, and the Job-level retry settings do not survive conversion — so the old default turned multi-hour work into preemptible work with no retry and no rescheduling. Pass--armada-priority-class preemptibleto opt back in, which is the right default once units are small enough that losing one is cheap (#183)
Fixed¶
Behaviour change (may fail builds that previously passed):
repartition_by_h0now hard-fails when the count of distinct hexed features is lower than the count of source features with non-null geometry, reporting both. The k8s hex Job covers onlymax-completions × chunk-sizefeatures, so a source larger than that cap — when the generator could not count it up front — was silently truncated, and every presence-based downstream check still passed. A build that was quietly losing features will now stop. SetCNG_SKIP_COMPLETENESS_CHECK=1to bypass it for sources with known-degenerate geometries (#170)A chunk whose features all have null geometry no longer aborts the whole indexed Job. It produced a zero-row intermediate, so Pass 2 never created the local file and the final
COPYfailed with “No files found”. Such a chunk now writes an empty partition carrying the correct output schema and returns cleanly — so expect empty partition files where a build previously died (#169)A non-geometry attribute column named
GEOMETRY,SHAPEorGEOMno longer shadows the real geometry column. ADOUBLEcarried over from a source DBF aborted the hex job withST_GeometryType(DOUBLE)._find_geometry_columnnow resolves by DuckDB type first — aGEOMETRY-typed column wins regardless of name — and falls back to name matching only when no typed geometry column exists (#171)Behaviour change (a hang becomes a clear failure): a polygon whose ring crosses the antimeridian now fails immediately instead of hanging for hours. Such a ring polyfills its full planar cartesian span — a near-global cell set — so
h3_polygon_wkt_to_cellsenumerated billions of cells and stalled Pass 1 CPU-bound at low RAM, taking the whole indexed Job with it. The #107 oversized-feature guard missed it becauseST_Area_Spheroidmeasures the geodesic short-way region, so a narrow dateline strip reads as tiny (or NaN for a self-wrapping ring). The guard now estimates cells from planar area for features whose longitude span exceeds 180°, matching what the polyfill actually walks, and keeps the accurate geodesic estimate below that. The error names the antimeridian and points to splitting at ±180° upstream; a clean multipolygon of islands either side of the dateline has small planar area and still hexes normally (#167)Pruning a chunk against its own H3 boundary no longer drops native cells. H3’s hierarchy is only approximately containing — a child cell can protrude beyond its parent’s boundary polygon — so the overlap test that skips a chunk not covering the raster excluded chunks whose children genuinely did overlap. The result was a silently short output: exit 0, a clean log, and a cell count that looked plausible. Caught by the new sub-chunk correctness gate, which asserts sub-chunked output is row-for-row identical to the h0 baseline. The overlap test now takes a margin of roughly one cell edge, scaled by 1/cos(latitude) so it does not under-cover near the poles; the asymmetry is deliberate, since a false positive costs one pod that exits in seconds and a false negative costs data (#173)
--method warp-centroidnow reports its GDAL requirement instead of crashing partway through a build. The path clips every h0’s warp withWarpOptions(cutlineWKT=...), which GDAL 3.8.4 (Ubuntu noble) does not accept, so the method failed with a bareTypeError: WarpOptions() got an unexpected keyword argument 'cutlineWKT'from inside the warp — after the pod had already localized the COG, and reading like a bug in the tool rather than a missing dependency. Nothing declared the requirement. It is now detected by feature (not by version number, since bindings can lag the library) when the processor is constructed, before any raster is opened, and raises naming the requirement and the remedy. It deliberately does not fall back toexact-extract: that is a different aggregation, not a slower one (#173)The raster hex step no longer materialises a boundary WKT string for every H3 cell before starting work.
_native_cells_for_h0fetched(cell_id, boundary_wkt)for all of an h0’s children at once and handed both to the workers; the WKT was ~96% of that list (183 bytes per cell against 8 for the id alone), and materialising it was ~85% of the parent process’s peak RSS. A cell boundary is a pure function of its id, so each worker now derives its own chunk’s boundaries with the sameh3_cell_to_boundary_wkt, and the parent carries a plain uint64 array. Measured on one h0: peak RSS for the cell enumeration falls from 18.3 GiB to 4.6 GiB at res 9 and from 4.0 GiB to 0.68 GiB at res 8 — a res-10 h0 is projected to fall from ~128 GiB to ~32 GiB, which is what makes the largest builds fit in a normal pod. Output is byte-identical: verified over a full h0 formean,modeandfractions(#173, phase 1)CSV point input now types columns from the whole file instead of DuckDB’s default 20480-row sample. A numeric column that is entirely NULL within that head sample was typed
VARCHAReven when cleanly numeric over the whole file, soSUM()on it failed outright until the consumer added a cast — fatality and evacuation counts published as strings. This bites any CSV ordered by time with columns introduced in a later reporting era, which is the normal shape for incident and observation records. All threeread_csv_autocalls (the DESCRIBE, the coordinate range check and the write) now take the samesample_size, so they agree on the schema;--csv-sample-sizerestores a bounded sample for a file too large to scan (#188)A source CRS with no EPSG code and no authority string now drives reprojection instead of being discarded.
detect_crsreturnedNonefor such a CRS, andbuild_read_reproject_queryreadsNoneas “no reprojection needed”, so the geometries were written unchanged while the GeoParquet presented them as lon/lat — a MODIS sinusoidal source converted to projected metres tagged EPSG:4326, with exit code 0 and a singleWarning:line. Every MODIS-derived product ships such a CRS. Detection now returns the CRS’s full WKT definition, whichST_Transformaccepts, so the existing reprojection path handles it unchanged. The three ways a source can lack a code are also reported distinctly: a definition without a code (reprojected), a dataset that declares no CRS (assumed to be in the target CRS, as before), and detection failing outright (still assumed, but the reason and the consequence are now printed at normal verbosity rather than only under--verbose) (#187)Every generated step manifest now carries
metadata.namespace. Onlyworkflow.yaml,configmap.yamlandworkflow-rbac.yamlhad it, so applying a step manifest directly — which the docs sanction for step-by-step control — targeted whatever namespacekubectldefaulted to: an RBAC error namingdefaultrather than the missing field, or, on a permissive cluster, the job silently running in the wrong namespace. Filed againstraster-workflow, but the vector generator’sconvert,pmtiles,hex,repartitionandsetup-bucketmanifests had the same gap and are fixed with it (#190)raster-workflowno longer flattens a hierarchical--datasetin the S3 paths it writes.--dataset a/bpublished its hex tos3://<bucket>/a-b/hex/— the Kubernetes object name, which must flatten/— instead ofs3://<bucket>/a/b/hex/, so a raster ingest landed outside its own dataset prefix and the STAC hex and COG hrefs pointed into different trees. The hex job now takes the S3 dataset path separately from the k8s name, as the vector generator already did, and the intermediate COG follows the same convention ({dataset}-cog.tif, mirroring the vector{dataset}.parquet). Flat dataset names are unaffected (#189)Converting a k8s Job to Armada now warns when Job-level retry settings (
backoffLimit,backoffLimitPerIndex,maxFailedIndexes) are dropped, naming what is lost; conversion readsspec.template.spec, so these were silently discarded. Settings that grant no retries (a0value) are not reported, and the warning additionally flags the preemptible case, where a preemption loses the whole unit (#183)rasternow warns when a build has no path toh8, the catalog’s universal join key, naming the consequence: the output cannot be joined against the rest of the catalog. Two cases, both previously silent — the target resolution is coarser than h8 (detect_optimal_h3_resolutiontargets ~3x the source pixel edge, which agrees with the catalog at fine pixels but lands on h6 for a ~1 km global raster, so a caller who omitted--h3-resolutiongot a non-joinable dataset with only an informational log line), or the target is finer than h8 and h8 is not among--parent-resolutions, whose raster default is0alone. Resolution detection itself is unchanged (#182)Stale default Armada queue in
convert_workflow_to_armada(biodiversity→geo-workflows); the workflow generators pass the namespace explicitly, so this affects direct API callers (#183)
0.3.1 - 2026-07-21¶
Fixed¶
.zenodo.jsondropped an unresolvable NSF grant identifier that caused Zenodo DOI minting to fail on the 0.3.0 release; the archive/DOI can now be minted (#165)
0.3.0 - 2026-07-20¶
Fixed (added retroactively)¶
These five shipped in 0.3.0 but were never written up; recorded here so the history matches what was released rather than what was remembered.
A
.gdbFile Geodatabase ons3://is localized beforeST_Read. An FGDB is a multi-file directory, which DuckDB-spatial cannot open overs3://, and/vsis3on a directory FGDB is flaky across nodes. Remote.gdbsources are now rclone-copied to a local temp dir first, mirroring the raster path’s_localize_input, and cleaned up in the convertfinallyblock (#152)A non-Parquet vector source on
s3://is rewritten to its public HTTPS endpoint wrapped in/vsicurlbeforeST_Read. GDAL cannot open a bares3://path without/vsis3credentials, which the convert tool does not set, so a GeoJSON source failed atST_Readeven though CRS and geometry detection over httpfs had already succeeded (#153)Duplicate
(feature, cell)rows are removed from vector hex output. Pass 1 dumps each feature into one row per part and Pass 2 unnests every part’s cell array independently, so a cell touched by two or more parts of the same MultiPolygon was emitted once per part — byte-identical duplicate rows that silently inflated every downstreamSUMand area aggregate (found onca30x30-ecoregion). De-duplicated on the fully assembled per-chunk file, which is where it is correct: one feature’s parts can span Pass-2 batches, but each feature lives entirely within one chunk (#150)RasterProcessor.__init__no longer crashes on a global equal-area projection. Source bounds were reprojected corner-by-corner, and for e.g. World Mollweide the rectangle corners fall in the projection’s undefined oval domain, soTransformPointraised “Point outside of projection domain” before any work started. Now usesgdal.AutoCreateWarpedVRT— the machinerygdalwarpitself uses — with a whole-globe fallback, since these bounds only clip or skip h0 regions and over-approximating is safe where under-approximating would drop data (#151)The PMTiles job raises its soft file-descriptor limit before invoking tippecanoe. On high-core nodes
os.cpu_count()reports the node’s full core count, so tippecanoe’s per-thread per-tile temp shards exhausted the container’s default softnofilelimit (often 1024) and aborted with “Too many open files” (#154)
First release published to PyPI (pip install cng-datasets) via trusted publishing.
Fixed¶
Vector H3 hex now splits circumpolar / transmeridian polygons (longitude-bbox span > 180°) into sub-180° longitude bands before polyfill, so they fill their full band instead of collapsing to ~1 cell. H3
polygon_to_cellsreads a >180° ring as the minimal-area (complement) side; a full −180…180 band (e.g. CCAMLR’s Southern-Ocean RFB) previously produced ~1 cell instead of millions. Narrow (<180°-span) polygons keep the original fast path unchanged (#145)workflownowshlex.quotes each--source-urlwhen interpolating it into the generated convert command, so URLs carrying&query strings (common for ArcGIS Hub / REST download endpoints) no longer break thebash -cstep apart into background jobs (#147)
Added¶
--resolution-by-areafor variable-resolution (size-stratified) H3 hex tiling: each feature is hexed at the native resolution its planarST_Areamaps to, so very large polygons use a coarse resolution while small ones keep fine edges — avoiding the Pass-2 OOM / 2 GB parquet-page limit without dropping the whole dataset to a coarse resolution. Output carries a uniform union schema (one column per resolution, finer columns null in coarser tiers) plus anative_rescolumn, preserving flat equality joins. The #107 oversized-feature guardrail now estimates each feature’s cells at its own native resolution, so large features back off automatically (#98)
0.2.0 - 2026-06-13¶
Added¶
--methodflag for raster→H3 aggregation: mass-conservingexact-extract(default) and opt-inwarp-centroid(#86)max/min/mode--hex-resamplingreducers for peak/richness and categorical rasters (#96, #80)Multi-value
--nodatawith categorical-safe COG overviews (#108)LineString geometry support in H3 hex tiling via buffering (#69)
Multi-cluster configuration (
ClusterConfig) and reusable YAML cluster profiles (--profile) for non-NRP deployments (#57, #58)
Changed¶
Breaking: default raster→H3 reducer is now
mean(wasaverage) and the default algorithm is the mass-conservingexact-extractpath; rasters built before this should be reprocessed (#84)Removed the
geoparquet-iodependency — DuckDB 1.5 writes GeoParquet natively (#56)CI lint (
ruff) is now blocking (#90, #94); agent/dev instructions are Docker-based (#97)cng-convert-to-parquetalways creates a row-unique_cng_fidon both convert paths (#43)
Fixed¶
Mass-conserving area-weighted raster→H3 aggregation, fixing ~50% mass loss (#84)
BLOB→
GEOMETRYcast for MULTIPOINT/WKB sources on both convert paths, fixing null geometries in PMTiles (#61)Post-hex-build
UBIGINTassertion on allh{N≥1}columns + intra-partition_cng_fidordering for row-group pruning (#102, #103)Sub-H3-cell polygons retained via representative-point fallback (#104); antimeridian/polar boundary cells split correctly (#92)
Deterministic, lazy PROJ configuration (
proj.dbMINOR ≥ 7) (#72, #91, #101); M/3D geometry flattened to 2D (#50, #51, #59)Non-COG source auto-detection and
/vsis3/COG write (#66, #68); rclone-config mount in raster hex job (#99);TIPPECANOE_MAX_THREADSin the PMTiles job (#77)Bucket CORS exposes range-read headers (#35, #79, #87); network-free workflow-generation tests (#112)
[0.1.1] - 2026-01-01¶
Changed¶
Made GDAL an optional dependency (install with
pip install -e ".[raster]")Tests requiring GDAL array support now skip gracefully when unavailable
Updated documentation with GDAL installation instructions
Fixed¶
Test suite now passes in virtual environments without system GDAL
All 50 core tests pass, 9 GDAL-dependent tests skip cleanly
0.1.0 - 2026-01-01¶
Added¶
Raster Processing Pipeline
Complete
RasterProcessorclass for COG creation and H3 tilingAutomatic H3 resolution detection from raster pixel size
Support for processing by h0 regions (memory-efficient global processing)
COG optimization for cloud rendering (titiler-compatible)
Parent resolution support for hierarchical aggregation
Configurable value columns and nodata handling
CLI commands for raster processing
Vector Processing (Existing)
H3 hexagonal tiling for polygon and point datasets
Two-pass processing to avoid OOM with large datasets
Chunked processing with configurable batch sizes
Parent resolution support
Repartitioning by h0 cells for efficient querying
ID column auto-detection and handling
Kubernetes Integration
Job generation for parallel processing
Indexed jobs for chunk-based workflows
Resource configuration (CPU, memory, parallelism)
Support for h0-based regional processing
Storage Management
S3 bucket configuration and CORS setup
Rclone integration for multi-cloud syncing
Credential management
CLI Tools
cng-datasets vector- Vector processingcng-datasets raster- Raster processingcng-datasets k8s- Kubernetes job generationcng-datasets storage- Storage managementcng-datasets workflow- Complete dataset workflows
Documentation
Comprehensive package README
Dataset-specific READMEs with examples
API documentation in docstrings
Example scripts and notebooks
Contributing guidelines
Testing
Unit tests for vector processing
Unit tests for raster processing
Integration tests for S3 and H3 operations
Mock tests for external services
Test fixtures and utilities
Changed¶
Updated H3 edge length values to match official h3geo.org specification
Improved resolution detection with informative user feedback
Enhanced error messages and logging throughout
Fixed¶
H3 edge length accuracy (using official values)
Resolution override behavior with helpful messages
Memory efficiency for large polygon processing