Skip to contents

Versioning

Resolve which MST release to render, on which cell grid, and where its content-addressed COGs live — the registries that let ONE app serve every version instead of a forked app per release

atlas_access_default()
Default access for a version whose registry row does not say
atlas_allow_access()
Which access values THIS app instance may show
atlas_base_url()
Base HTTPS URL of the marine-atlas release tree
atlas_is_preview()
Is this process the preview (signed-in) app instance?
atlas_latest()
The promoted (latest released) atlas version
atlas_manifest()
A version's manifest — the contract between a release and the apps
atlas_preview_url()
Base URL of the signed-in preview host
atlas_resolve_ver()
Resolve a requested version to a real, published one
atlas_ver_access()
A version's access (public / restricted)
atlas_versions()
The atlas version registry
manifest_build()
Build a version manifest from that release's database
manifest_can()
Does this version support a named capability?
manifest_labels_backfill()
Backfill blank metric short labels on a manifest
preview_app_url() preview_docs_url()
URLs on the signed-in preview host
product_urls()
Where this release's sibling products live
validate_manifest()
Validate a version manifest
validate_manifest_app()
Validate a manifest's app block against inst/schema/app_manifest.schema.json
ver_token_secret()
Secret used to sign version tokens
ver_token_sign()
Sign a version token for a page
ver_token_verify()
Verify a version token; NULL unless it is genuine and unexpired
version_picker_html()
HTML for the version picker
bbox_spans_globe()
Does a bounding box span so much longitude that it cannot frame anything?
cell_from_lonlat()
Cell id at a longitude/latitude (inverse of cell_lonlat())
cell_lonlat()
Longitude/latitude of cell centers on a grid
grid_cellid_url()
Public URL of a grid's cell-id COG
grid_for_ver()
The grid a release's cell_id values index
grid_registry()
The grid registry
grid_spec_for()
Grid spec by id, for publish_cog()
lon_span() lon_span_agg()
Minimal longitude span of a distribution, antimeridian-aware
asset_catalog_add()
Add objects to the catalog (idempotent)
asset_catalog_check()
Validate a store catalog (assets.parquet)
asset_catalog_missing()
Store keys a release points at that the catalog does not list
asset_catalog_read()
Read the public catalog
asset_catalog_register()
Catalog every store object a release points at (idempotent)
asset_catalog_rows()
Catalog rows for objects a publisher has just built
asset_catalog_write()
Write the catalog as Parquet (zstd), validated
asset_enc()
Encoding tag of a distribution-file family
asset_key()
Object key in the unified store
asset_key_collisions()
Keys that name more than one content
asset_key_from_url()
The store key a pointer URL names, or NA when it is not a store object
asset_store_key()
Store key of a file family, from its source-content hash
cog_store_index()
Index the existing COG store
content_hash_encoded()
Fold the raster ENCODING into a payload hash
content_hash_sql()
Grouped content-fingerprint SQL
content_hashes()
Content fingerprint of every model in a surface table
content_hashes_df()
Content fingerprint of in-memory (cell_id, val) rows
content_key()
Object key for a content-addressed COG
content_url()
Public URL of a stored COG
native_hash_file()
MD5 of an object's bytes (the catalog's integrity column, never a store key)
native_key()
Object key of a stored original surface
native_raster_rows()
(cell_id, val) rows of a raster on an analysis grid
native_store_index()
Index the store of original surfaces
native_store_rewrite()
Rewrite original-surface rows to the content-addressed store
native_url()
Public URL of a stored original surface
native_vector_hash()
Content hash of one model's vector features (what reaches the tile)
native_vector_hashes()
Content hash of every model in a multi-model sf
pixel_hashes()
Pixel-content fingerprint of every model in a surface table
pixel_quant_sql()
SQL for the pixel value a writer stores
store_publish_gate()
The publish gate: a release owns pointers, never files
store_unreferenced()
Catalogued objects that no release points at

Spatial units

Identify a zone layer by its geometry rather than by the release that used it, so one Program Area is comparable across versions

validate_zone_sets()
Validate a zone-set registry table
zone_cells()
Cells covered by each zone, on a given grid
zone_geom_hash()
Order-invariant geometry fingerprint of a zone layer
zone_key_col()
The key column for a zone type
zone_set_group()
Group zone layers into distinct vintages by geometry
zone_set_key()
Compose (and validate) a zone-set key
zone_set_resolve()
Resolve a release's zone columns to zone-set keys via the registry

Atlas & database

Attach the released marine-atlas Parquet on S3, and open a version’s DuckDB

atlas_path()
Path to a release component under the atlas base
atlas_tbl()
Read a released derived table (tables/<name>.parquet) as a lazy relation
atlas_views()
Create named views over the released atlas tables
attach_atlas()
Configure a DuckDB connection to read the marine-atlas release from S3
require_duckdb()
Require a modern DuckDB (and optionally the spatial GEOMETRY extension)
sdm_db_con()
Connect to SDM DuckDB
sdm_db_path()
Path to SDM DuckDB
spp_db_con()
Connect to species taxonomy DuckDB

Ingest & merge

Bring source distributions onto the cell grid, mint stable model ids, and merge per-dataset surfaces into one surface per taxon

cells_from_aligned_raster()
(cell_id, val) from a raster ALREADY on the cell grid (no resample)
cells_from_ranges()
Rasterize range polygons onto the global 0.05° cell grid (whole range)
cells_from_raster()
Resample a raster SDM onto the global 0.05° cell grid
cells_pct_marine()
Percent of a model's cells that are marine (ocean)
density_annual()
Annual mean density from interval (monthly / seasonal) surfaces
density_to_suit()
Density → suitability-scale [0,100] transforms
cell_zone_major_sql()
SQL assigning each cell to its single majority zone
dps_sql()
Merge rule for NMFS DPS-listed species: the model stays the distribution, ER rides beside it
merge_sql()
v8 per-taxon merge rules (single source of truth)
supersede_sql()
Supersession predicate: one suitability dataset replaces another inside a mask
turtle_sql()
Spatial-ER (turtle) multiplicative merge rule
zone_exclude_sql()
SQL selecting the model cells a taxon x zone exclusion removes
assign_mdl_id()
Assign the dense integer mdl_id for a set of models
dataset_is_scored()
Which datasets actually fed the scored surface?
mdl_key_merged()
Compose a merged (ms_merge) model key
mdl_key_parse()
Parse mdl_key(s) into components
mdl_key_raw()
Compose a raw (per-dataset) model key
normalize_ds_key()
Normalise a legacy dataset key to the mdl_key grammar

Taxonomic

Match taxa from APIs, especially World Register of Marine Species (WoRMS)

clean_sci_name()
Clean a scientific name for taxonomic matching
match_taxa()
Match taxa to spp.duckdb via cascade
sp_cat_from_taxonomy()
Species category (sp_cat) from taxonomy
wm_rest()
Query WoRMS REST API with multiple requests
compute_er_score()
Compute extinction risk score from extrisk_code and flags
parse_noaa_status()
Parse NOAA protected_status field

Analyze

Score cells and zones, and summarize species for an area

build_zone_taxon()
Build the precomputed zone x taxon summary table
cell_grid_ncol()
Grid width (columns) a database's cell_model was tiled with
cell_grid_write()
Record a database's grid, so tile pruning cannot guess it wrong
cell_id_raster()
Cell-ID SpatRaster (the v7 grid)
cell_model_tile_check()
Assert a database's stored tile ids match the width it reports
cell_model_tile_sql()
SQL expression for a cell's spatial tile id
cell_model_tiles()
Spatial tile ids covering a set of cells
cells_in_polygon()
Cells intersecting a polygon
cells_in_pra()
Cells belonging to a Program Area zone
coverage_floor()
Flag which (zone, metric) pairs clear the coverage floor
coverage_sql()
SQL for the coverage of each zone by each component metric
mean_score()
Weighted mean of component scores
scores_for_cells()
Aggregate component scores across a set of cells
scores_for_pra()
Precomputed component scores for a Program Area
sdm_cols()
Resolve a release's column names for the cross-version queries
sdm_val_col()
Name of the measurement column in a release's table
species_for_cells()
Species table aggregated across a set of cells
species_for_zone()
Species table aggregated across a zone

Visualize

Map cell surfaces and COGs, and build the report widgets

add_cell_tiles()
Add an msens cell tile layer to a mapgl map
add_cells()
Add a raster cell layer to a map
add_pmfill()
Add a PMTile polygon fill layer to a map
add_pmlabel()
Add symbol label layers from sf point data
add_pmline()
Add PMTile outline line layers to a map
cell_stats()
Fetch msens cell value statistics for a SQL query
cell_tile_url()
Build an msens cell tile URL template
cog_point_value()
Value of a COG at a point, via titiler
cog_tile_url()
Build a titiler /cog tile URL template for a native COG
drawn_features_sf()
Parse mapgl's drawn-features Shiny input into sf
ggmap_areas()
Static ggplot map of labeled areas
ggplot_flower()
Build a flower-plot ggplot for component scores
map_cells()
Map raster cells with outlines and labels
map_pmtiles()
Map data on PMTile vector tiles
ms_basemap()
Basemap
plot_flower()
Flower plot of component scores (interactive or static)
tbl_species()
Species table (interactive DT or static gt)
widget_png()
Render an htmlwidget to a static PNG
zone_label_args()
Label arguments for add_pmlabel(), from zone_style()
zone_line_args()
Outline arguments for add_pmline(), from zone_style()
zone_style()
Line + label style for a spatial unit type

Publish & serve

Write COGs and PMTiles, build the STAC catalog, render reports

cog_from_tif()
COG from a delivered GeoTIFF, values bit-exact (the native representation)
grid_spec()
Grid spec for the global cell-id raster
publish_cog()
Publish one model's cells as a COG
publish_pmtiles()
Publish vector features as PMTiles (tippecanoe)
publish_pmtiles_from_gpkg()
Publish per-model PMTiles from an indexed GeoPackage
publish_pmtiles_models()
Publish per-model PMTiles — one file per mdl_key
registry_merge()
Merge a freshly built asset registry with the one already published
sdm_sql_b64()
Encode SQL as urlsafe base64 for the TiTiler sql= query parameter
stac_build()
Build the full static STAC catalog for a version
stac_catalog_alias()
Alias of the root catalog for another origin
stac_catalog_alias_write()
Write a catalog alias to disk
stac_catalog_register()
Register a version in a deployed root catalog (idempotent)
stac_cfg()
Default configuration (base URLs) for STAC generation
stac_dataset_collection()
Dataset Collection node
stac_model_cell_item()
Model-surface Item for a (DuckDB-backed) dataset
stac_root_catalog()
Root Catalog node
stac_sdm_props()
Build the SDM properties block shared by Collections and Items
stac_season_cog_item()
Seasonal per-species Item from the NCCOS season-COG metadata
stac_version_collection()
Version Collection node (parent of the dataset Collections)
report_parquet_summary()
Summarize a set of atlas Parquet files for a notebook's ## Outputs section
report_table()
House-style table for pipeline reports
atlas_bases()
Base URLs of every host the project serves from
url_audit()
Classify URLs by what serves them
url_audit_assert()
Stop when a URL would be served as bulk bytes from the VM

Pipeline

The targets DAG, content-addressed target manifests, Parquet staging and the version-equivalence gate

build_targets_list()
Build the targets list from msens: frontmatter
parse_qmd_frontmatter()
Parse msens: frontmatter from pipeline notebooks
force_target()
Should this target be forced to rebuild?
hash_parquet()
Order-independent content fingerprint of Parquet file(s)
hash_query()
Order-independent content fingerprint of a DuckDB table/query
write_manifest()
Write a deterministic, content-addressed target manifest
copy_atlas_parquet()
COPY a DuckDB relation/query to Parquet with the standard v8 options
write_atlas_parquet()
Write an atlas surface to Parquet (arrow path) with the standard v8 options
assert_within_tolerance()
Assert a delta table is within tolerance, else error (pure)
mass_conservation()
Mass-conservation ratio between a source model and its hex interpolation (pure)
pra_score_delta()
Program-Area composite-score delta between two version databases
rarity_class()
Rarity class from range size (pure)
score_delta()
Join two versions' scores and compute per-key deltas (pure)
score_delta_summary()
Summary statistics for a delta table (pure)
zone_crosswalk()
Crosswalk two zone layers by geometric identity
zone_score_delta()
Compare per-zone scores between two releases, across every metric
zone_scored_flds()
Which zone fields of a release carry a given metric
zone_scores()
Every zone-level score of one spatial unit, across all metrics

Read

Fetch data, spatial and non-spatial, especially from APIs

get_species_by_feature()
Get species by feature

Analytics

Usage logging shared across the apps, docs and workflows sites

ga_head()
Analytics <head> snippet as a Shiny tag
ga_js()
Analytics <head> snippet (GA4 + batched Sheet beacon)
ms_apps_script()
Apps Script source for the usage-log Sheet
ms_client_ip()
Best-effort client IP from a Shiny request
ms_event()
Build a tracking-event payload
ms_log_header()
Column header for the usage-log Sheet
ms_track()
Send a tracking event from the Shiny server to the browser
ms_track_query()
Time a query, log its shape, and re-raise any error
ms_track_session()
Hand the browser the session facts only the server knows

Data

Lookups for easy reference

ply_boemrgns
Polygons of BOEM Regions
ply_boemrgns_s05
Polygons of BOEM Regions, simplified to 5%
ply_ecoareas
Polygons of EcoAreas
ply_ecoareas_s05
Polygons of EcoAreas
ply_ecorgns
Polygons of Ecoregions
ply_ecorgns_s05
Polygons of Ecoregions
ply_planareas
Polygons of Planning Areas
ply_planareas_s05
Polygons of Planning Areas, simplified to 5%

Dormant

Retained but NOT part of the current pipeline. The H3 hexagon grid and its IDW interpolation were built for a v8 direction that was rolled back to the global 0.05 degree raster cell grid; nothing in workflows or apps calls them, and their SQL is stale under DuckDB 1.5 (their tests skip). Kept for a possible return to hexes — do not build on them without re-testing.

HEX_RES
H3 resolution of the v8 sampling grid (~5.16 km^2 per hexagon)
cell_i_grid()
Canonical global 0.5-degree cell index for lon/lat
hex_add_membership()
Flag hexes inside a polygon (H3 polyfill membership)
hex_centroids()
Centroids (lon/lat) for BIGINT H3 ids
hex_grid_weights()
Precompute IDW weights from a shared source grid to hex centroids
hex_id_from_lonlat()
H3 cell ids for lon/lat points
hex_id_to_string()
Hex-string form of BIGINT H3 ids (for display)
hex_interp_idw()
Interpolate source values onto hex centroids (inverse-distance weighting)
hex_ocean()
Enumerate the ocean H3 hex tiling from a raster mask (GEOMETRY ONLY)
model_hex_from_weights()
Interpolate one model's source values onto hexes with precomputed weights

Other

Other functions not defined by the concepts above

APP_UNIT_TYPES
The zone types that may become a drawable unit, best first
angular_distance()
Angular distance from a centre to each point, in degrees
app_alias_shards()
Build the app/alias/{xx}.json shards
app_boot()
Build app/boot.json
app_bundle_build()
Build the whole {ver}/app/ bundle into a directory
app_capabilities()
What a STATIC client can actually fetch, by anonymous HTTPS HEAD
app_cell_tile_check()
Assert every tile's cell ids satisfy the tile key at a given grid width
app_cell_tile_digests()
Per-metric multiset digest of the wide tiles, and of cell_metric
app_cell_tiles()
Write the wide app/cell/tile={t}/ Parquet tiles
app_datasets()
The release's datasets, normalised
app_flower_default()
Versioned flower-plot defaults, per subregion
app_id_chr()
Normalise an id column to the text every generation must publish
app_json()
Serialize an app/ object exactly as it is published
app_manifest_block()
The app block for manifest.json
app_model()
The mdl_id -> mdl_key mapping the cell_model join needs
app_one_file_per_partition()
Assert a partitioned bundle directory holds exactly one file per partition
app_palettes()
The 11-stop palettes the app must draw with
app_schema_path() app_schema_names()
Path to a published app/ JSON Schema
app_table_descriptor() app_table_manifest()
Describe a written app/ Parquet file for boot.json$tables
app_tables_match()
Assert boot$tables names exactly the Parquet objects under app/
app_taxa()
Build app/taxa.json, the picker index
app_taxon_shards()
Build the app/taxon/{xx}.json shards
app_taxon_table()
The normalised scored-taxon table (app/taxon.parquet and the shard source)
app_taxonomy()
The WoRMS hierarchy the Composition treemap joins, restricted to this release
app_units()
The drawable scored spatial units of a release
app_validate()
Validate an object against its published app/ schema
app_zone_bbox()
Per-zone WGS84 bounding boxes, for a search that zooms without a loaded tile
app_zone_names()
Zone names from a release's spatial-unit geometry
app_zone_taxon()
The normalised app/zone_taxon.parquet
app_zone_tbl()
The ONE zone table each spatial unit publishes
app_zones()
Per-zone summaries, so a report on a Program Area never loads a cell
app_zones_unique()
Assert every zone-keyed object holds each zone exactly once
b64url_encode() b64url_decode()
Base64url, RFC 4648 section 5, no padding
build_storage_index()
Generate index pages for a bucket tree
cell_i_grid()
Canonical global 0.5-degree cell index for lon/lat
cells_in_polygon_grid()
Cells a polygon covers, from the grid definition alone
cells_in_study_area()
Restrict a cell set to the release's study area
confusion_at()
Confusion counts at a threshold
geojson_sfc()
Build an sfc from parsed GeoJSON coordinate arrays
grid_for_con()
The grid a release's cell_id values index, read from the connection
heldout_threshold()
Held-out threshold at a fixed sensitivity
hex_grid_weights()
Precompute IDW weights from a shared source grid to hex centroids
mec_center()
Centre of the smallest circle containing every point
model_hex_from_weights()
Interpolate one model's source values onto hexes with precomputed weights
native_asset_backfill()
Backfill a v8-shaped native_asset for a model_asset-only release
native_asset_carry_forward()
Carry a patch release's native_asset forward from the release it patches
native_asset_restore_model()
Restore the gridded (model) representation of vector ranges
native_key_v8()
Spell a v1-v7 stable model key the way a later release's native_asset does
native_vintage_check()
Is a dataset the same source vintage in two releases?
parquet_digest()
Content digest of a Parquet table or dataset
parquet_manifest()
Digest every Parquet table in a release directory
parquet_sync_plan()
What differs between two Parquet manifests
place_codec_fixture()
The shared g1 codec vectors
place_encode() place_encode_strict() place_decode()
Encode places into a URL hash, and decode them back (g1)
place_fixture()
Read a place fixture
place_fixture_ids()
Every place fixture id
range_constrain_sql()
SQL for the range rule: which cells stay
range_hull()
Convex hull of occurrence points, in the longitude frame that fits them
range_region_sql()
SQL for the counts the regional test needs
region_effort_test()
The regional test: is the model contradicted where people looked?
s3_list_all()
List every object under a prefix
sens_threshold()
Threshold that keeps a fixed share of presences
sfc_geojson()
An sfc as parsed GeoJSON coordinate arrays
sphere_centroid()
Spherical mean of longitude/latitude points
storage_page()
One self-contained storage index page
study_area_views()
Recompute the study-area presets from an ecoregion layer
study_areas()
Canonical study areas — one set, every release
unwrap_ring() unwrap_polygon()
Unwrap a ring's longitudes, so no edge spans more than 180 degrees
view_zoom()
Zoom that frames a given angular radius
zone_tbl_for()
Zone table name for a spatial unit