Skip to contents

content_hashes() over the PIXELS a COG would hold: val quantised as the writer does (pixel_quant_sql()), pixels below 1 dropped (they are NoData in the integer families), and - for a dataset whose models can repeat a cell - collapsed to one value per cell by max(), the rule the merge consumes (turtle_sql() / merge_sql() take max(val) per cell). The result is exactly what content_hashes_df(native_raster_rows(<the painted COG>)) returns, so "does this object hold the rows its key says?" is one equality, and the key is known before any file is built.

Usage

pixel_hashes(
  con,
  from,
  by = "mdl_key",
  quant = c("trunc", "round_trunc", "none"),
  min_pixel = 1,
  dedup = c("none", "max")
)

Arguments

con

open DuckDB connection

from

table name, read_parquet(...) expression or parenthesised subquery with by, cell_id and val

by

grouping column (e.g. mdl_key)

quant

see pixel_quant_sql()

min_pixel

keep only pixels with a quantised value >= this (default 1; -Inf keeps all)

dedup

"none" or "max" (collapse repeated cells by max(val) BEFORE quantising)

Value

data frame by, n, content_hash