OxiGDAL QC - Quality Control & Validation Suite
A comprehensive quality control and validation suite for geospatial data in OxiGDAL. Provides automated detection, reporting, and repair of data integrity issues for both raster and vector datasets, with configurable validation rules and multi-format report generation.
Features
- Raster Quality Control: Completeness, consistency, and spatial accuracy checks for raster datasets
- Vector Quality Control: Topology validation and attribute completeness checks for vector features
- Metadata Validation: ISO 19115 and STAC metadata standards compliance checking
- Rules Engine: Flexible, configurable quality rules via TOML with custom validators
- Automatic Fixes: Safe, strategy-based automatic repairs for common data quality issues
- Multi-Format Reporting: HTML and JSON report generation with severity classification
- Error Handling: Comprehensive error types with severity levels (Info, Warning, Minor, Major, Critical)
- Issue Tracking: Detailed issue detection with location information and remediation suggestions
- 100% Pure Rust: No C/Fortran dependencies, fully integrated with OxiGDAL ecosystem
Installation
Add to your Cargo.toml:
[]
= "0.1.0"
With Optional Features
[]
= { = "0.1.0", = ["html"] }
Available Features:
std(default): Standard library supporthtml(default): HTML report generation with XML formattingpdf: PDF report generation (future)
Quick Start
use *;
use RasterBuffer;
use RasterDataType;
Usage
Basic Raster Quality Control
use *;
use RasterBuffer;
use ;
// Check raster completeness (valid vs invalid pixels)
let buffer = zeros;
let completeness_checker = new;
let completeness_result = completeness_checker.check_buffer?;
// Check raster consistency (data type, CRS, bounds alignment)
let consistency_checker = new;
let consistency_result = consistency_checker.check_buffer?;
// Check spatial accuracy with geographic bounds
let bbox = new?;
let geotransform = from_bounds?;
let accuracy_checker = new;
let accuracy_result = accuracy_checker.check_raster?;
Vector Quality Control
use *;
use ;
// Create a feature collection
let point = new;
let feature = new;
let collection = FeatureCollection ;
// Check topology validity
let topo_checker = new;
let topo_result = topo_checker.validate?;
println!;
// Check attribute completeness
let attr_checker = new;
let attr_result = attr_checker.validate?;
println!;
Metadata Validation
use *;
use HashMap;
let mut metadata = new;
metadata.insert;
metadata.insert;
metadata.insert;
metadata.insert;
metadata.insert;
metadata.insert;
let checker = new;
let result = checker.check?;
println!;
println!;
Rules Engine with Custom Validators
use *;
use HashMap;
// Create a rule set
let mut ruleset = new;
// Add a threshold rule
let rule = new
.description
.category
.severity
.threshold
.build;
ruleset.add_rule;
// Execute rules against data
let engine = new;
let mut data = new;
data.insert;
let issues = engine.execute_all?;
if issues.is_empty
Automatic Fixing with Strategies
use *;
use ;
let point = new;
let feature = new;
let collection = FeatureCollection ;
// Use different fix strategies
let conservative_fixer = new;
let = conservative_fixer.fix_topology?;
println!;
println!;
Quality Report Generation
use *;
let mut report = new;
// Add report sections with detailed results
let section = ReportSection ;
report.add_section;
report.finalize;
// Generate HTML report (with html feature enabled)
let html_report = report.to_html?;
API Overview
Core Modules
| Module | Purpose |
|---|---|
raster |
Raster data quality control (completeness, consistency, accuracy) |
vector |
Vector data validation (topology, attributes) |
metadata |
Metadata standards compliance checking |
report |
Multi-format report generation (HTML, JSON) |
rules |
Configurable validation rules engine |
fix |
Automatic data quality issue remediation |
error |
Comprehensive error types and severity levels |
Primary Types
Raster Checks:
CompletenessChecker- Detects missing or invalid pixelsConsistencyChecker- Validates data consistency (CRS, bounds, etc.)AccuracyChecker- Checks spatial accuracy and georeferencing
Vector Checks:
TopologyChecker- Validates geometry validity and topological rulesAttributionChecker- Ensures required attributes are present
Metadata & Reporting:
MetadataChecker- ISO 19115 and STAC compliance validationQualityReport- Generates comprehensive QC reportsRulesEngine- Executes custom validation rules
Data Repair:
TopologyFixer- Fixes common geometry issuesFixStrategy- Conservative, Moderate, or Aggressive repair modes
Error Types
The crate defines specialized error types for different failure modes:
InvalidConfiguration- Rule or checker configuration errorsInvalidInput- Input data validation failuresValidationRule- Rule engine validation errorsTopologyError- Geometry topology issuesAttributeError- Feature attribute problemsMetadataError- Metadata validation failuresRasterError- Raster-specific errors
Severity Levels
Issues are classified by severity:
- Info: Informational messages requiring no action
- Warning: Minor issues that don't prevent usage
- Minor: Issues that should be reviewed
- Major: Significant quality concerns
- Critical: Data is unusable or severely compromised
Error Handling
This library follows the "no unwrap" policy. All fallible operations return Result<T, E> with descriptive error types. Use the ? operator for convenient error propagation:
use *;
All QcError variants implement std::error::Error for seamless integration with error handling libraries like anyhow and eyre.
Pure Rust
OxiGDAL QC is 100% Pure Rust with no C/Fortran dependencies. All functionality:
- Works out of the box without external system libraries
- Leverages the OxiGDAL ecosystem for geospatial operations
- Implements standards-compliant algorithms in Rust
- Provides safe, zero-cost abstractions over geospatial data structures
Performance
The library is optimized for:
- Large rasters: Efficient pixel-level analysis without full data materialization
- Large feature sets: Streaming geometry validation
- Batch operations: Process multiple checks in a single pass
- Memory safety: Rust's ownership system prevents data corruption
Examples
See the tests directory for comprehensive usage examples:
qc_test.rs- Complete integration tests demonstrating all QC checks
Example scenarios:
- Raster completeness and consistency validation
- Vector topology and attribute validation
- Metadata standards compliance
- Report generation in HTML and JSON
- Automatic geometry repair strategies
- Custom rule engine execution
Documentation
Full API documentation is available at docs.rs.
Key documentation sections:
Integration with OxiGDAL
OxiGDAL QC is tightly integrated with the OxiGDAL ecosystem:
- Uses
oxigdal-corefor raster and vector data types - Leverages
oxigdal-algorithmsfor advanced spatial operations - Compatible with
oxigdal-geojsonfor vector data I/O - Part of the cohesive geospatial processing pipeline
Contributing
Contributions are welcome! Areas for enhancement:
- Additional metadata standards (Dublin Core, MIAOW, etc.)
- Performance optimizations for large-scale datasets
- Additional automatic fix strategies
- Custom report format templates
- Extended validation rules library
Please ensure:
- No use of
unwrap()orpanic!() - Comprehensive error handling with
Resulttypes - Adequate test coverage for new features
- Documentation with examples
License
This project is licensed under Apache-2.0.
See LICENSE for details.
Related COOLJAPAN Ecosystem Projects
- OxiGDAL Core - Core geospatial data structures
- OxiGDAL Algorithms - Spatial algorithms
- OxiGDAL GeoJSON - GeoJSON I/O
- OxiBLAS - Pure Rust BLAS operations
- Oxicode - Pure Rust serialization (bincode replacement)
- OxiFFT - Pure Rust FFT implementation
- SciRS2 - Scientific computing ecosystem
OxiGDAL QC is part of the COOLJAPAN ecosystem - Pure Rust, high-performance geospatial and scientific computing libraries.