Skip to main content

Crate geonative_image

Crate geonative_image 

Source
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

§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.cog

Then 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 single RasterTile via the RasterLayer trait.
error
Per-crate error type. Wraps the underlying decoder errors plus the sidecar / format failure modes.
worldfile
World file (.jgw / .pgw / .tfw / .wld) parser.

Constants§

VERSION