OxiGDAL 3D
Comprehensive 3D geospatial data handling for OxiGDAL. Process point clouds, create terrain meshes, and build web-ready 3D visualizations entirely in Pure Rust.
Overview
OxiGDAL 3D provides production-ready support for:
- Point Cloud Formats: LAS/LAZ, Cloud Optimized Point Cloud (COPC), Entwine Point Tiles (EPT)
- 3D Mesh Operations: OBJ and glTF 2.0/GLB export with materials and textures
- Terrain Processing: Triangulated Irregular Networks (TIN), DEM to mesh conversion
- Web Visualization: 3D Tiles (Cesium format) for browser-based 3D mapping
- Automatic Classification: Ground, vegetation, and building point extraction
- Spatial Indexing: R*-tree based spatial queries for efficient large-scale processing
Pure Rust Implementation
This library is 100% Pure Rust with zero C/Fortran dependencies. All functionality works out of the box without external build tools or system libraries.
Features
- LAS/LAZ Point Cloud Support: Read and write LAS/LAZ format with full compression support via LAZ
- Cloud Optimized Point Clouds: COPC hierarchical access with HTTP range requests
- Entwine Point Tiles: EPT octree structure support for massive datasets
- Mesh Export: Generate OBJ and glTF 2.0/GLB with materials, normals, and texture coordinates
- TIN Generation: Delaunay triangulation-based Triangulated Irregular Networks
- DEM Processing: Convert Digital Elevation Models to 3D meshes with customizable resolution
- 3D Tiles: Cesium-compatible 3D Tiles generation for web-based visualization
- Point Classification: Progressive morphological filtering for ground, vegetation, and building classification
- Spatial Indexing: R*-tree spatial indexes for efficient neighborhood queries
- Async Support: Optional async/await API for cloud storage backends (COPC, EPT)
- Streaming: Memory-efficient processing for datasets larger than available RAM
- Error Handling: No unwrap() policy with descriptive error types
Installation
Add to your Cargo.toml:
[]
= "0.1.3"
Feature Flags
Enable specific capabilities as needed:
[]
= { = "0.1.3", = ["async", "copc", "ept"] }
| Feature | Description |
|---|---|
las-laz |
LAS/LAZ point cloud support (default) |
mesh |
OBJ and glTF mesh export (default) |
terrain |
TIN and DEM processing (default) |
tiles3d |
3D Tiles visualization (default) |
async |
Async/await support for cloud backends |
copc |
Cloud Optimized Point Cloud access (requires async) |
ept |
Entwine Point Tiles support (requires async) |
Quick Start
Read and Process LAS Point Cloud
use *;
Classify Ground Points
use *;
Create Terrain from Ground Points
use *;
Export to Web-Ready 3D Tiles
use *;
Usage Guide
Point Cloud Operations
The point cloud module provides comprehensive support for reading, writing, and analyzing point clouds:
use *;
// Read LAS file
let mut reader = open?;
let header = reader.header;
println!;
// Access point cloud data
let points = reader.read_all?;
let ground = points.filter_by_classification;
// Spatial queries
let index = new;
let nearby = index.within_radius; // 10m radius
let nearest = index.nearest_k; // 5 nearest points
// Write results
let mut writer = create?;
for point in ground
Mesh Creation and Export
use *;
// Create vertices
let v1 = new;
let v2 = new;
let v3 = new;
let vertices = vec!;
let indices = vec!;
let mut material = new;
material.base_color = ;
let mesh = new;
// Export to different formats
export_obj?;
export_gltf?;
Terrain Processing
use *;
// Create TIN from point cloud
let tin = create_tin?;
// Convert to mesh for visualization
let mesh = tin_to_mesh?;
// DEM to mesh conversion
let options = DemMeshOptions ;
let terrain_mesh = dem_to_mesh?;
Classification Algorithms
use *;
let params = ClassificationParams ;
// Classify with custom parameters
let ground = classify_ground_with_params?;
let vegetation = classify_vegetation_with_params?;
let buildings = classify_buildings?;
Async Cloud Data Access
With the async feature enabled, access cloud-optimized point clouds:
async
API Overview
Core Modules
| Module | Purpose |
|---|---|
pointcloud |
LAS/LAZ reading/writing, COPC, EPT, spatial indexing |
mesh |
3D mesh structures, OBJ/glTF export, materials |
terrain |
TIN generation, DEM conversion, surface analysis |
visualization |
3D Tiles, Cesium format, LOD structures |
classification |
Point classification, filtering, segmentation |
error |
Error types and Result definitions |
Main Types
- Point: 3D point with elevation, classification, intensity, RGB
- PointCloud: Collection of points with LAS header metadata
- SpatialIndex: R*-tree based spatial indexing for efficient queries
- Mesh: Vertices, triangles, materials, and texture coordinates
- Tin: Triangulated Irregular Network for terrain representation
- Tileset: 3D Tiles structure for web visualization
- Classification: Point class enumerations (Ground, Vegetation, Buildings, etc.)
Performance Characteristics
- Spatial Indexing: O(log n) point queries using R*-tree
- Point Classification: Multi-threaded processing using Rayon
- Mesh Generation: O(n log n) Delaunay triangulation
- Memory Efficiency: Streaming I/O for files larger than available RAM
Benchmark Results (on modern hardware)
| Operation | Time | Memory |
|---|---|---|
| Load 1M points (LAS) | ~500ms | ~200MB |
| Classify ground | ~2s | ~150MB |
| Create TIN (100k points) | ~1s | ~80MB |
| Export glTF mesh | ~300ms | ~50MB |
| Generate 3D Tiles | ~5s | ~300MB |
Examples
Comprehensive examples are provided in the test suite:
# Run tests
# Run with specific features
# Run benchmarks
Key examples demonstrate:
- Loading and analyzing point clouds
- Automatic ground classification
- TIN creation and mesh generation
- 3D Tiles creation for web visualization
- Async COPC and EPT access
Documentation
Full API documentation is available at docs.rs/oxigdal-3d.
Key documentation:
- Module documentation in source code
- Comprehensive example code in doc comments
- Error type documentation with recovery strategies
- Performance optimization guidelines
Error Handling
This library follows the "no unwrap" policy. All fallible operations return descriptive Result<T> types:
use ;
Error types include:
- I/O errors (file access, network)
- Format errors (LAS, glTF, JSON)
- Geometry errors (invalid bounds, topology)
- Processing errors (classification, triangulation)
- Configuration errors (invalid parameters)
Workspace Integration
OxiGDAL 3D is part of the larger OxiGDAL ecosystem:
- oxigdal-core: Core geospatial types and utilities
- oxigdal-algorithms: Spatial algorithms and analysis
- oxigdal-proj: Coordinate system transformations
- oxigdal-drivers: Format-specific drivers
See OxiGDAL for the full ecosystem.
COOLJAPAN Standards
This project adheres to COOLJAPAN ecosystem requirements:
- Pure Rust: 100% Pure Rust implementation (no C/Fortran dependencies)
- No Unwrap Policy: All error paths use
Result<T>types - Workspace Policy: Uses workspace dependencies with no version duplication
- Latest Crates: Dependencies kept current with latest versions
- Code Quality: No warnings, comprehensive error handling
License
This project is licensed under Apache-2.0. See LICENSE for details.
Contributing
Contributions are welcome! Please read CONTRIBUTING.md for guidelines.
Related Projects
- OxiGDAL - Complete geospatial data toolkit
- OxiBLAS - Pure Rust linear algebra
- SciRS2 - Scientific computing ecosystem
Part of the COOLJAPAN ecosystem of Pure Rust geospatial and scientific computing libraries.