PRO Production

Workflow-grade Pro analysis with audit-ready outputs.

workflow pro

## Workflow Narrative

Route Event Governance

### Who It Is For

- Departments of Transportation managing pavement/paving event datasets.
- Pipeline operators maintaining linear segment datasets (coating, pressure class, material type).
- Rail and powerline operators tracking inspection or maintenance event inventories.
- GIS production teams responsible for LRS data quality before system integration.

### Primary User

DOTs, pipeline operators, rail/powerline operators, and telecom managers.

### What It Does

- Validates route event datasets (line segments with from/to measures) against production governance rules.
- Detects overlapping events (events sharing measure ranges on the same route).
- Detects measure gaps (discontinuities between sequential events).
- Detects descending intervals (to_measure < from_measure).
- Optionally validates business/domain rules from a JSON rule set, including enum, regex, and numeric min/max checks.
- Optionally auto-corrects detectable violations: flips descending intervals, trims overlapping events to the prior event boundary.
- Produces QA-passed governed events, a per-violation issue log, optional remediation queue CSV, corrected event layer (when auto_fix=true), and a machine-readable governance report.

### How It Works

- Loads the event layer and groups events by route identifier field.
- **Detection pass** — for each route: flags descending intervals (violation: `monotonic_measures`), sorts events by from_measure and scans for overlaps (violation: `no_overlaps`, severity error) and gaps (violation: `no_gaps`, severity info).
- **Domain validation pass** (when `domain_rules_json` is provided) — evaluates configured per-field `allowed_values`, `regex`, `min`, and `max` rules and emits `domain_validation` errors for out-of-policy attributes.
- **Auto-fix pass** (when `auto_fix=true`) — applies descending swap then overlap trimming in sorted order; marks fully consumed events (zero-length after trim) as uncorrectable deletions.
- Outputs `governed_events`: all features that either had no errors or were successfully auto-corrected, with added `GOVERNANCE_STATUS` and `CORRECTIONS` attributes.
- Issues CSV captures `event_id, route_id, rule_violated, severity, description, measure_start, measure_end` per violation.
- Remediation queue CSV prioritizes corrective action by issue class for data steward follow-up.
- Governance report JSON captures `total_events, passed_events, failed_events, pass_rate_percent, rules_violated, severity_distribution, correctable_count, domain_rules_applied`.

## Inputs

Parameter | Type | Required | Description
--- | --- | --- | ---
`events` | Vector path | Required | Event layer (GeoPackage, GeoJSON, Shapefile) with route ID and from/to measure fields
`route_id_field` | string | Required | Field name containing route identifiers
`from_measure_field` | string | Required | Field name for interval start measure
`to_measure_field` | string | Required | Field name for interval end measure
`gap_tolerance` | float | Optional | Gaps smaller than this value are not flagged (default 0.0)
`overlap_tolerance` | float | Optional | Overlaps smaller than this value are not flagged (default 0.0)
`auto_fix` | bool | Optional | Enable auto-correction of descending intervals and trimming of overlaps (default false)
`domain_rules_json` | path | Optional | JSON file defining per-field validation rules with `allowed_values`, `regex`, `min`, and `max` checks
`governed_events` | vector path | Required | Output path for QA-passed events with GOVERNANCE_STATUS and CORRECTIONS attributes
`issues_csv` | path | Required | Output CSV path for per-event issue log
`corrected_events` | vector path | Optional | Output path for auto-corrected events (only written when auto_fix=true)
`governance_report` | path | Required | Output JSON path for governance summary report
`remediation_queue_csv` | path | Optional | Optional prioritized remediation queue with recommended corrective action

## Outputs

Output | Type | Contents
--- | --- | ---
`governed_events` | Vector | QA-passed events; attributes include GOVERNANCE_STATUS ("PASSED"/"CORRECTED") and CORRECTIONS (correction type or "none")
`issues_csv` | CSV | Per-violation log: event_id, route_id, rule_violated, severity, description, measure_start, measure_end
`corrected_events` | Vector | Only written when auto_fix=true; lists corrected events with CORR_TYPE, ORIG_FROM, ORIG_TO, CORR_FROM, CORR_TO columns
`governance_report` | JSON | Summary: total_events, passed_events, failed_events, pass_rate_percent, rules_violated, severity_distribution, correctable_count, domain_rules_applied
`remediation_queue_csv` | CSV | Prioritized queue with rule category, severity, and recommended corrective action

## Python Example

    env = WbEnvironment(license_tier="pro")

    result = env.run_tool("route_event_governance_for_linear_assets",
        events="pavement_events.gpkg",
        route_id_field="ROUTE_ID",
        from_measure_field="FROM_MEAS",
        to_measure_field="TO_MEAS",
        gap_tolerance=0.5,
        overlap_tolerance=0.1,
        auto_fix=True,
        domain_rules_json="output/route_event_rules.json",
        governed_events="output/governed_events.gpkg",
        issues_csv="output/issues.csv",
        corrected_events="output/corrected_events.gpkg",
        governance_report="output/governance_report.json",
        remediation_queue_csv="output/remediation_queue.csv",
    )

    import json
    report = json.loads(open(result["governance_report"]).read())
    print(f"Pass rate: {report['pass_rate_percent']:.1f}%  "
          f"({report['passed_events']}/{report['total_events']} events)")

## License Notice

Use of this function requires a license for Whitebox Workflows Professional (WbW-Pro). Please visit www.whiteboxgeo.com to purchase a license.

## Project Links

WbW Homepage User Manual Support WbW