Raster Operations¶
SudaPy wraps rasterio to provide high-level raster processing. Supported input formats: GeoTIFF (.tif, .tiff), ERDAS Imagine (.img), and VRT (.vrt).
Clip by vector¶
Clip a raster using vector geometries as a mask.
The clip vector is automatically reprojected to match the raster CRS if needed.
Reproject¶
Reproject a raster to a new coordinate reference system.
Resample¶
Change raster resolution by a scale factor.
Available resampling methods:
| Method | Description |
|---|---|
nearest |
Nearest neighbor (fast, good for categorical data) |
bilinear |
Bilinear interpolation (good default for continuous data) |
cubic |
Cubic convolution (smooth, best for visual quality) |
Mosaic¶
Merge multiple raster tiles from a directory into a single raster.
All .tif, .tiff, .img, and .vrt files in the directory are included.
Hillshade¶
Generate a hillshade visualization from a Digital Elevation Model (DEM).
Parameters:
| Parameter | Default | Description |
|---|---|---|
azimuth |
315.0 | Sun direction in degrees (315 = northwest) |
altitude |
45.0 | Sun angle above horizon in degrees |
Slope¶
Calculate slope in degrees from a DEM.
The output raster contains slope values in degrees (0 = flat, 90 = vertical).
Terrain analysis workflow¶
A common DEM analysis workflow:
# 1. Clip DEM to study area
sudapy raster clip --in srtm_36n.tif --clip study_area.gpkg --out dem.tif
# 2. Reproject to UTM for accurate measurements
sudapy raster reproject --in dem.tif --out dem_utm.tif --to 32636
# 3. Generate terrain products
sudapy raster hillshade --in dem_utm.tif --out hillshade.tif
sudapy raster slope --in dem_utm.tif --out slope.tif