Skip to contents

n_cells and the coverage-weighted area_km2 come from zone_cell joined to cell; metrics is that zone's zone_metric keyed by metric_key (never by metric_seq, which is dropped and recreated every run). coverage carries the v7.1-only {component}_coverage rows when the release has them and is NULL otherwise — optional by presence, like the methods table.

Usage

app_zones(con, flds = NULL, chosen = NULL, zone_names = NULL, zone_bbox = NULL)

Arguments

con

a DBI connection

flds

zone fields to summarise (default: every fld in zone)

zone_names

optional data.frame(fld, key, name) from app_zone_names(); NULL (default) publishes every zone with name = NULL, exactly as before — this parameter is purely additive. A non-NULL value must carry fld/key/ name columns (stopifnot()), and a warning() fires when it names ZERO of the real zones of a field it lists — the wrong type or the wrong geometry file otherwise fails silently (every zone published with name = NULL).

zone_bbox

optional data.frame(fld, key, w, s, e, n) from app_zone_bbox(); NULL (default) publishes every zone with bbox = NULL, exactly as before — this parameter is purely additive, same shape of optionality as zone_names. A non-NULL value must carry fld/key/w/ s/e/n columns (stopifnot()).

Value

a named list zone_type -> list of zone objects

Details

A component with no row is ABSENT, not zero: that is how the release records "not reportable", and the app must render it as such.