name: gebco-bathymetry-transect
version: "0.1"
status: draft
category: features-objects
themes: [ocean, terrain]
family: bathymetry-transect-profile
description: >
  Seafloor depth profile along a transect line, sampled from GEBCO 2024 global
  bathymetry (15 arc-second COG). Places evenly-spaced points along the line and
  reads the elevation pixel under each — negative values are depth below sea
  level. Answers "how deep is it, and how does the seabed slope, along this
  path?" for any ocean transect. Windowed COG reads mean a single profile touches
  only a few kilobytes of the 4.6 GB global grid, not the whole file.

# Example transect: across the Monterey Submarine Canyon, California.
# Points run west (offshore, deep) to east (nearshore, shelf).
settings:
  n_points: 100                 # samples along the transect
  transect_start: [-122.30, 36.75]   # [lon, lat] offshore, deep
  transect_end:   [-121.85, 36.80]   # [lon, lat] nearshore, over the shelf

inputs:
  aoi:
    transect:
      start: [-122.30, 36.75]
      end:   [-121.85, 36.80]
    notes: >
      The transect is materialized as `n_points` GeoJSON points evenly spaced
      between start and end; each is sampled against the GEBCO COG.
  dataset:
    uri: "@gebco/gebco-2024"

layers:

  # ── SOURCE ──────────────────────────────────────────────────────────────
  source/gebco:
    type: raster
    uri: "@gebco/gebco-2024"
    description: GEBCO 2024 global elevation COG; single int16 band, metres, negative = below sea level.
    params:
      asset: GEBCO_2024.tif
      band: elevation

  # ── INPUT PREP ────────────────────────────────────────────────────────────
  # n_points GeoJSON points evenly spaced between transect_start and transect_end.
  # Line densification is a plain vector primitive (linear interpolation of the
  # endpoints); the recipe runtime materializes it from the settings. A first-
  # class `line_densify` op is the one small gap here — until it lands, this
  # layer is generated input, not an op-computed layer.
  source/transect-points:
    type: vector
    description: n_points evenly spaced along the transect line (GeoJSON points).
    generated_from:
      line: ["${settings.transect_start}", "${settings.transect_end}"]
      n: "${settings.n_points}"

  # ── RESULT ──────────────────────────────────────────────────────────────
  result/depth-profile:
    type: vector
    description: >
      Each transect point with its sampled seabed elevation (m). Ordered along
      the line, this is the depth profile — plot elevation vs along-track
      distance to see the canyon cross-section.
    compute:
      op: analysis_point_sample
      inputs:
        raster: { layer: source/gebco }
        points: { layer: source/transect-points }
      params:
        property_name: elevation_m

outputs:
  primary:
    - result/depth-profile       # GeoJSON — points with sampled seabed elevation
  show_your_work:
    - source/transect-points     # the exact sample locations

license:
  recipe: Apache-2.0
  output_dataset: CC-BY-4.0
  upstream_data:
    - { source: "@gebco/gebco-2024", license: CC-BY-4.0 }
