Expand description
Node.js bindings for OxiGDAL
This crate provides comprehensive Node.js bindings for the OxiGDAL ecosystem, enabling pure Rust geospatial processing from JavaScript/TypeScript with zero-copy Buffer integration and full async/await support.
§Features
- Raster I/O: Read and write GeoTIFF, COG, and other raster formats
- Vector I/O: GeoJSON support with full geometry operations
- Algorithms: Resampling, terrain analysis, calculator, statistics
- Async/Await: Promise-based async operations for I/O and processing
- Buffer Integration: Zero-copy data transfer with Node.js Buffers
- TypeScript: Comprehensive TypeScript definitions included
§Example Usage
const oxigdal = require('@oxigdal/node');
// Open a raster file
const dataset = oxigdal.openRaster('input.tif');
console.log(`Size: ${dataset.width}x${dataset.height}`);
// Read a band
const band = dataset.readBand(0);
const stats = band.statistics();
console.log(`Mean: ${stats.mean}, StdDev: ${stats.stddev}`);
// Compute hillshade
const hillshade = oxigdal.hillshade(band, 315, 45, 1.0);
// Save result
const output = oxigdal.createRaster(dataset.width, dataset.height, 1, 'uint8');
output.writeBand(0, hillshade);
output.save('hillshade.tif');§Async Example
const oxigdal = require('@oxigdal/node');
async function processRaster() {
const dataset = await oxigdal.openRasterAsync('input.tif');
const band = dataset.readBand(0);
const slope = await oxigdal.slopeAsync(band, 1.0, false);
const output = oxigdal.createRaster(dataset.width, dataset.height, 1, 'float32');
output.writeBand(0, slope);
await oxigdal.saveRasterAsync(output, 'slope.tif');
}
processRaster().catch(console.error);Structs§
- Data
Types - Data type constants
- Module
Info - Module information
- Resampling
Methods - Resampling method constants
Functions§
- get_
data_ types - Returns available data types
- get_
info - Returns module information
- get_
resampling_ methods - Returns available resampling methods
- name
- Returns the OxiGDAL name
- version
- Returns the version of OxiGDAL