oxigdal_core/lib.rs
1//! `OxiGDAL` Core - Pure Rust Geospatial Abstractions
2//!
3//! This crate provides the core types and traits for the `OxiGDAL` ecosystem,
4//! a pure Rust reimplementation of GDAL for cloud-native geospatial computing.
5//!
6//! # Features
7//!
8//! - `std` (default) - Enable standard library support
9//! - `alloc` - Enable allocation support without full std
10//! - `arrow` - Enable Apache Arrow integration for zero-copy buffers
11//! - `async` - Enable async I/O traits
12//!
13//! # Core Types
14//!
15//! - [`BoundingBox`] - 2D spatial extent
16//! - [`GeoTransform`] - Affine transformation for georeferencing
17//! - [`RasterDataType`] - Pixel data types
18//! - [`buffer::RasterBuffer`] - Typed raster data buffer
19//!
20//! # Example
21//!
22//! ```
23//! use oxigdal_core::types::{BoundingBox, GeoTransform, RasterDataType};
24//! use oxigdal_core::buffer::RasterBuffer;
25//! use oxigdal_core::error::Result;
26//!
27//! # fn main() -> Result<()> {
28//! // Create a bounding box
29//! let bbox = BoundingBox::new(-180.0, -90.0, 180.0, 90.0)?;
30//!
31//! // Create a geotransform for a 1-degree resolution grid
32//! let gt = GeoTransform::from_bounds(&bbox, 360, 180)?;
33//!
34//! // Create a raster buffer
35//! let buffer = RasterBuffer::zeros(360, 180, RasterDataType::Float32);
36//! # Ok(())
37//! # }
38//! ```
39
40#![cfg_attr(not(feature = "std"), no_std)]
41#![warn(missing_docs)]
42#![warn(clippy::all)]
43// Pedantic disabled to reduce noise - default clippy::all is sufficient
44// #![warn(clippy::pedantic)]
45#![deny(clippy::unwrap_used)]
46#![allow(clippy::module_name_repetitions)]
47
48#[cfg(feature = "alloc")]
49extern crate alloc;
50
51#[cfg(feature = "std")]
52extern crate std;
53
54pub mod buffer;
55pub mod error;
56pub mod io;
57pub mod memory;
58pub mod simd_buffer;
59pub mod types;
60pub mod vector;
61
62// Tutorial documentation
63pub mod tutorials;
64
65// Re-export commonly used items
66pub use error::{OxiGdalError, Result};
67pub use types::{BoundingBox, GeoTransform, RasterDataType, RasterMetadata};
68
69/// Crate version
70pub const VERSION: &str = env!("CARGO_PKG_VERSION");
71
72/// Crate name
73pub const NAME: &str = env!("CARGO_PKG_NAME");
74
75#[cfg(test)]
76mod tests {
77 use super::*;
78
79 #[test]
80 fn test_version() {
81 assert!(!VERSION.is_empty());
82 assert_eq!(NAME, "oxigdal-core");
83 }
84}