Backfill a v8-shaped native_asset for a model_asset-only release
Source: R/native_asset.R
native_asset_backfill.RdProduces one representation = 'model' row per model in model_asset (the gridded COG,
rescale 1-100, spectral_r, no bbox: exactly the constants .app_assets() substituted
before) and, for every INPUT model whose original is published by a reference release,
one representation = 'native' row copied from it (URL, type, source_layer, rescale,
colormap, bbox). Merged (ms_merge) models get only the model row, as in v8. native
rows carry no ms_merge_key (they must never be mistaken for a taxon's own surface). Rows are
keyed by mdl_key = as.character(mdl_seq), the way v1-v7's taxon_model keys models,
so app_taxon_shards()'s mdl_key-alone asset join still finds them. Inputs with no
matching original keep their single model row: the app then offers no toggle, and
nothing is invented.
Usage
native_asset_backfill(
model_asset,
crosswalk,
native_ref,
store,
taxon_key = NULL,
key_map = NULL,
...
)Arguments
- model_asset
data frame with
mdl_seq,ds_key,cog_url(the release's own)- crosswalk
data frame with
mdl_seqand the stablemdl_key(v1-v7 spelling)- native_ref
a later release's
native_asset(v8 shape); only rows withrepresentation == 'native'are used- store
data frame
asset_url(the reference row's current URL),hash: where each original lives in the content-addressed store (native_store_rewrite()). REQUIRED: a matched original with no mapping is an error, so a release never points at a versioned path.- taxon_key
the release's
taxonkey values (v1-v7:taxon.mdl_seq). Amodelrow whosemdl_seqis one of them carries it asms_merge_key, which is what.app_merged()reads to pick a taxon's own surface: v1-v7 do that for single-dataset taxa too, not only forms_mergemodels, and dropping it losesmergedon those cards (found in the R4-F dry run: 6,729 v7 taxa).NULLfalls back tods_key == 'ms_merge'.- key_map
optional data frame
mdl_seq,ref_key: v1-v7 models whose original is NOT reachable bynative_key_v8()spelling, matched some other way (IUCN ranges key by scientific NAME in v1-v7 and byid_noin v8+, so the caller matches them by an exact, unambiguous name and passes the v8mdl_keyhere). Overrides the derived key for those models only; aref_keyabsent fromnative_refis an error.- ...
passed to
native_url()(base,pmtiles_base)