Expand description
§geonative-image
Pure-Rust reader for raster images with world-file sidecars — JPG and
PNG with .jgw / .pgw / .wld next to them.
§What v0.1 covers
- JPEG decode via
jpeg-decoder(L8 grayscale + RGB24) - PNG decode via
png(8-bit Grayscale / Grayscale+Alpha / RGB / RGBA) - World files (
.jgw/.pgw/.tfw/.wld) — 6-line ASCII parsed into ageonative_core::raster::GeoTransform - Caller-supplied CRS — world files don’t carry CRS, so the caller
passes one via
ImageRaster::open_with_crs(or acceptsgeonative_core::Crs::Unknownvia the basicImageRaster::open) - Implements
geonative_core::raster::RasterLayer— interchangeable withgeonative-geotiff::GeoTiffingeonative-convert’sRasterSourcedispatch
§Memory note
These formats don’t tile internally — open decodes the whole image
into memory. For large inputs (multi-GB satellite imagery), the
recommended workflow is to convert to COG once:
geonative convert big.jpg big.cogThen serve from the COG via geonative-geotiff’s mmap-backed reader —
that path is Pi-friendly regardless of source size.
§Usage
use geonative_core::Crs;
use geonative_core::raster::RasterLayer;
use geonative_image::ImageRaster;
// upload.png is sitting next to upload.pgw on disk
let img = ImageRaster::open_with_crs("upload.png", Crs::Epsg(4326))?;
let p = img.profile();
println!("{}×{} px, {} bands", p.width, p.height, p.bands.len());
let tile = img.read_tile(0, 0, 0)?;Re-exports§
pub use dataset::ImageKind;pub use dataset::ImageRaster;pub use error::ImageError;pub use error::Result;
Modules§
- dataset
ImageRaster— the public reader. Decodes a JPG or PNG, parses the adjacent world file, exposes the whole image as a singleRasterTilevia theRasterLayertrait.- error
- Per-crate error type. Wraps the underlying decoder errors plus the sidecar / format failure modes.
- worldfile
- World file (.jgw / .pgw / .tfw / .wld) parser.