Local data download and table filtering in cc_get_db()

  • local_data parameter cc_get_db(local_data = TRUE) now downloads parquet files to a local cache directory and creates TABLEs instead of remote VIEWs. Files are only downloaded if missing or if refresh = TRUE, making repeated calls idempotent.
  • tables parameter cc_get_db(tables = c("species", "ichthyo", ...)) filters which tables to load from the catalog. Useful for excluding large tables like CTD data when building app-specific databases.

Native GEOMETRY storage in cc_get_db()

  • storage_compatibility_version = 'latest' cc_get_db() now uses a named DuckDB driver with autoload_known_extensions and latest storage format, matching calcofi4db’s get_duckdb_con() pattern. Ensures native GEOMETRY type is used for spatial queries.

Require DuckDB >= 1.5.1 for native GEOMETRY

  • Requires duckdb >= 1.5.1 Added minimum version constraint to ensure the native built-in GEOMETRY type is available for spatial queries.

ERD diagrams render as PNG in Quarto via mermaid-cli

  • knit_print.cc_erd() now renders Mermaid diagrams to PNG via mmdc (mermaid-cli) at 2x scale with transparent background, saving to knitr::fig_path() for proper Quarto HTML output. Lightbox applies automatically via _quarto.yml settings.
  • Fallback chain: mmdcDiagrammeR::mermaid() htmlwidget → raw mermaid code block.

New cc_tbl() unified table accessor

  • cc_tbl() New function providing unified access to any CalCOFI database table. Returns lazy dplyr::tbl() for non-spatial tables, sf object for spatial tables (via DuckDB EXCLUDE + ST_AsWKB), and pivoted-wide sf for _spatial table (requires layer argument). Optional geom_col selects alternate geometry columns (e.g., geom_ctr for grid centroids).
  • cc_erd() gains a rels parameter to accept pre-parsed relationship lists inline (as alternative to rels_path), matching the calcofi4db build_relationships_json() list format.
  • knit_print.cc_erd() now outputs raw mermaid code blocks for Quarto native rendering (respects mermaid-format: png and lightbox settings in _quarto.yml) instead of rendering via DiagrammeR widget.
  • Enable reading of partitioned parquet files, eg table ctd_measurement (15 GB) partitioned by cruise_key, in online DuckDB for improved performance and scalability.
  • Fixed database functions: cc_get_db(), cc_list_versions()
  • Updated vignette “Get started” to using the online DuckDB and latest functions.
  • Added deprecation warnings to old functions that made API calls to Postgres database in favor of new direct data querying abilities with the online DuckDB.
  • Added cc_read_sf() to read spatial tables in DuckDB connection as sf objects.
  • Highlights DuckDB as the primary data access method
  • Quick Start Section - Shows cc_get_db() as the main entry point
  • Convenience Functions - Documents the new read functions:
  • Version Control Section - Shows how to:
    • List versions with cc_list_versions()
    • Connect to specific versions
    • View release info and notes
  • Custom Queries Section - Documents cc_query() and cc_describe_table()
  • API Functions - Kept the existing API functions as a secondary option
  • Added interpolation functions pts_to_rast_idw() and rast_to_contours(). Renamed map_contours() to pts_to_contours_gam() and moved concept from “visualize” to “analyze”.

  • Added to cc_places:

    • “NOAA Aquaculture Opportunity Areas”
    • “BOEM Wind Planning Areas”
    • “National Marine Sanctuaries”: “Chumash Proposed Action”
  • Fixed nearshore cc_grid to include sta_pos == 60. Renamed cc_grid_areas to cc_grid_zones with new categories for sta_shore (“nearshore” OR “offshore”) and sta_pattern (“standard”, “extended”, “historical”) per #4. Updated cc_places to have the 6 combinations of cc_grid_zones.
  • Added cc_places with three categories for places: 1) CalCOFI (Core, Extended, Nearshore, Offshore); 2) Integrated Ecosystem Assessment (California Current); and 3) National Marine Sanctuary (Cordell Bank, Channel Islands, Greater Farallones, Monterey Bay, Olympic Coast). Augmented cc_grid* with missing cells to reduce slivers when intersecting.
  • cc_grid_area -> cc_grid_areas data for showing study areas with combinations of sta_dpos nearshore (5), offshore (10) and outside (20); where area_dpos can be one of: "5", "10", "20", "5,10", "10,20" or "5,10,20"
  • Added cc_grid, cc_grid_ctrs showing the CalCOFI station sampling at varying seperation distances of station positions (sta_pos) in the CalCOFI coordinate system from nearshore (5), to offshore (10) to outside the 113 station extended repeated area (20), per Station Positions – CalCOFI}
  • handle defaults with plot_depth(), streamline headings in article and descriptions in functions
  • Added plot_depth() and example data bottle_temp_depth
  • stations_t_degc -> bottle_temp_lonlat
  • rename tbl_to_contour_ply() to map_contours()
  • Added tbl_to_contour_ply() and example data area_calcofi_extended stations_t_degc
  • ∆ order of stations columns
  • Added authors
  • Added a NEWS.md file to track changes to the package.