vibespatial-raster¶
vibespatial-raster
GPU-first raster processing. Custom NVRTC kernels and CCCL primitives for algebra, zonal stats, labeling, rasterize, and polygonize — all with zero-copy GPU residency.
GPU Algebra
Element-wise add, subtract, multiply, divide, apply, where, classify. CuPy-backed with automatic nodata propagation.
Focal Ops
Convolution, Gaussian filter, slope, aspect. Custom NVRTC shared-memory stencil kernels with tiled execution.
Zonal Statistics
Per-zone count, sum, mean, min, max, std, median via CCCL segmented reduce. Radix-sorted zone dispatch.
Connected Components
Union-find CCL via NVRTC kernels. 4 or 8 connectivity, iterative merge+jump convergence, sieve filtering.
GPU-Native IO
nvImageCodec decodes GeoTIFF and JPEG2000 directly to GPU memory. Zero host-device copies. Rasterio fallback.
Polygonize
Marching-squares NVRTC kernels classify cells and emit directed edges. Ring chaining produces GeoDataFrame output.
Quick Example¶
from vibespatial.raster import read_raster, zonal_stats, raster_slope
raster = read_raster("elevation.tif")
slope = raster_slope(raster)
stats = zonal_stats(zones, slope, ["mean", "max", "std"])