SWMMVis  6.0.0-alpha.4
Qt6/C++ GIS-based graphical user interface for the SWMMVis engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
RasterProfileSampler Namespace Reference

Functions

ProfileSection::Section buildRasterProfile (const QString &rasterPath, int band, const SpatialReferenceSystem *canvasSRS, const QVector< QPointF > &scenePolyline, double vertFactor=1.0, double stepHint=0.0)
 Resample scenePolyline at fixed arc length and sample the DEM at each point.
 

Function Documentation

◆ buildRasterProfile()

ProfileSection::Section RasterProfileSampler::buildRasterProfile ( const QString &  rasterPath,
int  band,
const SpatialReferenceSystem canvasSRS,
const QVector< QPointF > &  scenePolyline,
double  vertFactor = 1.0,
double  stepHint = 0.0 
)

Resample scenePolyline at fixed arc length and sample the DEM at each point.

Parameters
rasterPathGDAL-readable path of the DEM (GISRasterLayer::filePath()).
band1-based band index (GISRasterLayer::renderBand()).
canvasSRSCRS the traced polyline is expressed in. May be null — then no reprojection is attempted (polyline is assumed to already be in the raster's CRS).
scenePolylineTraced vertices in scene coords (sx = canvasX, sy = -canvasY) — the convention MapToolMeshProfile emits.
vertFactorMultiplier turning raw DEM Z into model vertical units (TerrainToolbar::verticalToModelFactor()). Ground is reported as rawZ * vertFactor so the profile lines up with node inverts / rims.
stepHintOptional fixed arc-length step (scene units). When ≤ 0 the step is half a DEM pixel, projected into scene units.
Returns
A ground-only section. Empty when the raster can't be opened or the polyline has < 2 vertices. Samples outside the DEM keep ground = NaN, which the chart renders as a gap.
Here is the call graph for this function: