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.h File Reference

Pure-logic sampler that turns a user-traced polyline over a DEM raster into a longitudinal cross-section: cumulative chainage + ground elevation at evenly-spaced samples along the path. More...

#include "plot/profilesection.h"
#include <QPointF>
#include <QString>
#include <QVector>
Include dependency graph for rasterprofilesampler.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  RasterProfileSampler
 

Functions

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.
 

Detailed Description

Pure-logic sampler that turns a user-traced polyline over a DEM raster into a longitudinal cross-section: cumulative chainage + ground elevation at evenly-spaced samples along the path.

Author
Caleb Buahin caleb.nosp@m..bua.nosp@m.hin@g.nosp@m.mail.nosp@m..com
Date
2026
License\n GPL-3.0-or-later

The raster peer of MeshProfileSampler — same walk-the-polyline, emit-a-sample-every-step shape, same ProfileSection::Section output, so the traced DEM profile renders in the same MeshProfilePlotWidget. Differences from the mesh path:

  • Ground comes from mesh::DTMSampler (bilinear) rather than GISRasterLayer::valueAt (nearest-neighbour), so the profile follows the DEM smoothly instead of stair-stepping across pixels.
  • Coordinates are transformed. The traced polyline is in SCENE coords (sx = canvasX, sy = -canvasY); DTMSampler wants the RASTER's native CRS. GISRasterLayer::valueAt silently assumes the two are the same (see its implementation note), which is only true for an unwarped raster — this sampler does the canvas → raster transform explicitly.
  • There is no water: depthNow / maxDepth stay 0, hasResults is false, and crossings is empty, so the chart draws ground + soil only.