OxiGDAL Mobile SDK
Mobile FFI bindings for OxiGDAL - bringing Pure Rust geospatial capabilities to iOS and Android.
Overview
OxiGDAL Mobile provides C-compatible FFI bindings that enable OxiGDAL to be used from native iOS (Swift/Objective-C) and Android (Kotlin/Java) applications. This allows mobile developers to leverage OxiGDAL's powerful geospatial capabilities with:
- Zero-copy operations for maximum performance
- Offline-first COG (Cloud Optimized GeoTIFF) support
- Pure Rust implementation - no C/C++ dependencies
- Memory efficient design for mobile devices
- Battery conscious algorithms
- Platform-native APIs (Swift for iOS, Kotlin for Android)
Features
- ✅ Raster dataset reading (GeoTIFF, COG, PNG, JPEG)
- ✅ Vector dataset reading (GeoJSON, Shapefile, GeoPackage)
- ✅ Map tile generation (XYZ scheme)
- ✅ Image enhancement (brightness, contrast, saturation, gamma)
- ✅ Coordinate transformations
- ✅ Spatial filtering
- ✅ Statistics computation
- ✅ iOS UIImage integration
- ✅ Android Bitmap integration
- ✅ Memory-safe FFI layer
- ✅ Comprehensive error handling
Architecture
┌─────────────────────────────────────────┐
│ Mobile Applications │
│ ┌──────────────┐ ┌──────────────┐ │
│ │ Swift (iOS) │ │Kotlin(Android)│ │
│ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────┘
│ │
▼ ▼
┌─────────────────────────────────────────┐
│ Language Bindings │
│ ┌──────────────┐ ┌──────────────┐ │
│ │OxiGDAL.swift │ │ OxiGDAL.kt │ │
│ └──────────────┘ └──────────────┘ │
└─────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ C FFI Layer (Rust) │
│ ┌───────────────────────────────────┐ │
│ │ • Error handling │ │
│ │ • Type conversions │ │
│ │ • Memory management │ │
│ │ • Platform-specific utilities │ │
│ └───────────────────────────────────┘ │
└─────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────┐
│ OxiGDAL Core │
│ (Pure Rust) │
└─────────────────────────────────────────┘
Platform Support
iOS
- Minimum: iOS 13.0+
- Architectures: arm64 (device), x86_64 (simulator)
- Integration: Swift Package Manager, CocoaPods
- Language: Swift 5.9+
Android
- Minimum: Android 7.0 (API 24)+
- Architectures: arm64-v8a, armeabi-v7a, x86_64
- Integration: Gradle, AAR library
- Language: Kotlin 1.9+
Quick Start
iOS (Swift)
import OxiGDAL
// Initialize
OxiGDAL.initialize()
// Open dataset
let dataset = try OxiGDAL.open("map.tif")
// Read as UIImage
let image = try dataset.toImage()
imageView.image = image
// Clean up
dataset.close()
Android (Kotlin)
import com.cooljapan.oxigdal.OxiGDAL
// Initialize
OxiGDAL.initialize()
// Open dataset
val dataset = OxiGDAL.open("map.tif")
// Read as Bitmap
val bitmap = dataset.toBitmap()
imageView.setImageBitmap(bitmap)
// Clean up
dataset.close()
Installation
See platform-specific guides:
Building
Prerequisites
- Rust 1.85+
- For iOS: Xcode 15.0+
- For Android: Android NDK 26+
iOS Targets
# Add targets
# Build
Android Targets
# Add targets
# Build
API Overview
Core Types
OxiGdalDataset- Opaque handle to a datasetOxiGdalBand- Opaque handle to a raster bandOxiGdalLayer- Opaque handle to a vector layerOxiGdalFeature- Opaque handle to a featureOxiGdalBuffer- Image buffer with pixel dataOxiGdalMetadata- Dataset metadata (size, bands, CRS, etc.)
Error Handling
All FFI functions return OxiGdalErrorCode:
typedef enum OxiGdalErrorCode;
Detailed error messages are available via oxigdal_get_last_error().
Memory Management
- Handles: Created by
*_open/*_create, freed by*_close/*_free - Strings: Returned strings must be freed with
oxigdal_string_free() - Buffers: Caller-allocated, OxiGDAL writes to them
- Opaque Types: Never dereference on FFI side
Thread Safety
- Error messages are thread-local
- Handles can be used from different threads (with external synchronization)
- No global mutable state
Features
std(default) - Standard library supportios- iOS-specific bindings and utilitiesandroid- Android JNI bindings and utilitiesoffline- Offline COG reading supportfilters- Image enhancement filterstiles- Map tile generation
Examples
Reading a Region
// C API
OxiGdalDataset* dataset;
;
OxiGdalBuffer* buffer = ;
;
// Use buffer...
;
;
Map Tiles
OxiGdalTileCoord coord = ;
OxiGdalTile* tile;
;
Metadata
OxiGdalMetadata metadata;
;
;
;
;
Testing
# Run tests
# Run iOS tests
# Run Android tests
Performance
The mobile SDK is optimized for:
- Low memory footprint - Streaming operations, no large allocations
- Battery efficiency - Minimal CPU usage, efficient algorithms
- Fast startup - Lazy initialization, minimal setup
- Offline performance - Local file operations, no network required
Limitations
- Maximum dataset size depends on available device memory
- Some operations may be slower on older devices
- Full GDAL feature parity not yet achieved (in progress)
Roadmap
- Additional format support (HDF5, NetCDF, Zarr)
- Write support for datasets
- Advanced filtering operations
- 3D terrain support
- Real-time GPS integration
- Background tile generation
- Incremental loading
- Streaming from cloud storage
Contributing
Contributions are welcome! Please see CONTRIBUTING.md.
License
Licensed under Apache License 2.0. See LICENSE for details.
Authors
Copyright (c) 2026 COOLJAPAN OU (Team Kitasan)
Related Projects
- OxiGDAL Core - Core Rust library
- OxiGDAL WASM - WebAssembly bindings
- OxiGDAL Python - Python bindings
- OxiBLAS - Pure Rust BLAS
- NumRS2 - NumPy for Rust
Support
- Documentation: https://docs.rs/oxigdal-mobile
- Issues: https://github.com/cool-japan/oxigdal/issues
- Discussions: https://github.com/cool-japan/oxigdal/discussions