Skip to content

v0.16.0

Choose a tag to compare

@cboettig cboettig released this 19 Nov 19:23
· 15 commits to main since this release
ac874ae

Added

  • Vector thumbnails drawn with the default style (#340). cng-datasets vector-thumbnail --style --parquet --output draws 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-profile lists a PMTiles layer's drawable attributes beside the STAC column descriptions. cng-datasets style builds the default style for a chosen column: categorical (the most frequent values, counted in the GeoParquet, the rest as Other, labels from the column's CODE=meaning description) 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.py moved 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-render on the COGs the workflow wrote and writes s3://<bucket>/<dataset>.render.json (STAC render-extension fields keyed by object key) and <cog stem>.thumbnail.png beside 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, --rescale and --colormap-json override 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.py builds 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:scheme hive, partition:strategy h3, partition:keys as objects with a name and a type (h0 as int64, then year as int32 with --years), and an s3:// 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 the h0 value in a path is the integer cell id and that the NRP endpoint has to be configured to read the glob.