# catalog/operations/vector/union.yaml

id: vector_union
name: Union
description: >
  Compute the geometric union of two feature sets. Returns features
  that represent the combined area of all input geometries.
version: 1.0.0
category: vector
type: vector-to-vector
default_implementation: native

inputs:
  - name: features1
    type: vector
    format: geojson
    description: First feature set
    required: true
  - name: features2
    type: vector
    format: geojson
    description: Second feature set
    required: true

# Structural op — operates on any vector geometry uniformly.
requires: {}

outputs:
  - name: union
    type: vector
    format: geojson
    description: Union of the two feature sets

params: {}

cache_policy:
  ttl_days: 30
  invalidate_on: [source_update]

# backends: audited 2026-08-14 (defect 50). A key means a runtime that DISPATCHES this op —
# folia-engine `dispatch_op` (products/sdk/folia-engine/src/lib.rs), a `registerOp`/OP_TABLE
# entry in packages/compute, `_BUILTIN_OP_MAP` in folia/compute.py, or a backend manifest
# (folia/backends/*/backend.yaml).
backends:
  js:
    function: vector_union
    dispatch: packages/compute/src/ops/wasm-bridge.ts
  python:
    function: geo.vector.union
    dispatch: folia/compute.py _BUILTIN_OP_MAP

display_hints:
  map:
    renderer: maplibre

ui:
  icon: plus-square
  color: "#32CD32"
