Expand description
Raster warp — reproject a raster from one CRS to another using
geonative-proj for the coordinate transform plus a resampling kernel
for the pixel interpolation.
§How it works
For each output pixel:
- Compute its world coords in the target CRS via the target tile’s
GeoTransform - Reproject those world coords to the source CRS using the
Transformer - Project source-CRS world coords back to source pixel coords using
the source tile’s
GeoTransform - Sample the source band at those (fractional) pixel coords using the chosen kernel
§Memory model
v0.1 takes a single source RasterTile and produces a single output
RasterTile. For large inputs the caller should:
- Read source tiles via
RasterLayer::read_tile(cheap with mmap) - Warp each tile individually
- Write to output via the
geonative-geotiffwriter
For tile-server hot paths (per HTTP request), the future
warp_tile_window function reads only the source pixels needed for one
output tile — that’s a v0.2 add when streaming warp is needed.
Structs§
Functions§
- compute_
target_ grid - Compute the world-space bounds in the target CRS that contain the
reprojected
sourceextent. Useful for deciding the size of the outputRasterTilewhen the caller wants “warp everything into target CRS at a reasonable resolution.” - warp_
tile - Reproject
source(with its own CRS + geo-transform) onto the target(crs, geo_transform, width, height). Returns a newRasterTilewith the same band descriptors assourcebut in the target CRS.