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
GISRasterLayer Class Reference

A map layer backed by a GDAL raster dataset. More...

#include <gisrasterlayer.h>

Inheritance diagram for GISRasterLayer:
Collaboration diagram for GISRasterLayer:

Classes

struct  OpenResult
 

Signals

void filePathChanged (const QString &path)
 
void renderBandChanged (int band)
 
void noDataValueChanged (double value)
 
void rasterRendererChanged ()
 Emitted when setRasterRenderer() swaps the renderer pointer or notifyRasterRendererEdited() reports an in-place edit.
 
void openFinished (bool ok)
 Emitted on the GUI thread when openAsync() completes.
 
void overviewBuildStarted (const QString &name)
 A background overview (.ovr pyramid) build has started for this raster. name is the display file name.
 
void overviewBuildFinished (bool ok)
 The background overview build finished (ok ⇒ pyramids ready and the render will pick them up on the next repaint).
 
- Signals inherited from OpenSWMMVisLayer
void nameChanged (const QString &newName)
 
void layerTypeChanged (OpenSWMMVisLayerType newType)
 
void visibilityChanged (bool visible)
 
void opacityChanged (double opacity)
 
void srsChanged (SpatialReferenceSystem *newSRS)
 
void extentChanged (const MapExtent &newExtent)
 
void childrenChanged ()
 
void repaintRequested ()
 
void temporalSpecChanged (const OpenSWMM::Render::TemporalSpec &spec)
 
void maskSpecChanged (const OpenSWMM::Render::MaskSpec &spec)
 
void auxStorageSpecChanged (const OpenSWMM::Render::AuxiliaryStorageSpec &spec)
 
void joinsChanged (const QVector< OpenSWMM::Render::JoinSpec > &joins)
 
void diagramSpecChanged (const OpenSWMM::Render::DiagramSpec &spec)
 
void labelConfigChanged ()
 

Public Member Functions

 GISRasterLayer (const QString &filePath, OpenSWMMVisWorkspace *parent=nullptr)
 
 ~GISRasterLayer () override
 
void openAsync (const QString &filePath)
 Asynchronously open filePath. GDALOpenEx + metadata read + ComputeStatistics run on a worker thread; the layer is populated on the GUI thread and openFinished(bool) fires on completion (ok==false ⇒ open failed). Construct the layer with an empty path first, then call this; the synchronous openDataset path (used by tests / project restore) is unchanged.
 
QString filePath () const
 
int bandCount () const
 
int renderBand () const
 
double noDataValue () const
 
QString detectVerticalUnit () const
 Heuristically detects the vertical unit of the raster's elevation values from the embedded CRS metadata.
 
void setRenderBand (int band)
 Sets the 1-based band index to render on the single-band colour path. Re-reads that band's NoData value and, when the live renderer is a GraduatedRasterRenderer, re-seeds its data range and classification from the band's statistics / sample.
 
bool hasNoDataValue () const
 Returns true when the dataset has a known no-data value.
 
QString sourceDescription () const override
 Human-readable source of this layer: a file path, a service URL, or a description for in-memory / derived layers.
 
QVector< QPair< QString, QString > > extendedMetadata () const override
 Ordered key→value pairs of TYPE-SPECIFIC metadata, rendered by the Metadata tab below the common block the dialog builds itself.
 
QPair< double, doublebandRange (int band) const
 Approximate (min, max) of band from GDAL statistics (PAM-cached when available). (NaN, NaN) when unavailable.
 
QVector< doublesampleValues (int band, int maxSamples=200000) const
 Decimated, overview-aware value sample of band — at most maxSamples finite, non-NoData values on a regular grid over the whole raster. Feeds Quantile / Jenks / StdDev classification and unique-value discovery.
 
QList< int > uniqueValues (int band, int cap=256) const
 Distinct integer values observed in sampleValues(band), ascending, truncated to cap entries. Decimated — rare classes may be missed.
 
bool hasColorTable () const
 True when band 1 carries a GDAL colour table (paletted raster).
 
QList< OpenSWMM::Render::PalettedRasterRenderer::ClasscolorTableClasses () const
 Band 1's GDAL colour table as paletted classes (value, label = value, RGBA). Tables larger than 32 entries are filtered to the values actually observed in the band sample so unused palette slots do not flood the legend.
 
bool isByteRaster () const
 True when band 1 is 8-bit (GDT_Byte) — the only type the RGB composite path renders without saturating.
 
std::vector< std::unique_ptr< openswmmvis::ui::ILayerStyleSubject > > styleSubjects () override
 
OpenSWMM::Render::IRasterRendererrasterRenderer () const
 The IRasterRenderer that will drive this layer's warp pass.
 
void setRasterRenderer (std::unique_ptr< OpenSWMM::Render::IRasterRenderer > r)
 Replaces the current raster renderer.
 
void notifyRasterRendererEdited ()
 Call after mutating the live renderer in place (through its own setters) so cached tiles are dropped, rasterRendererChanged() fires and a repaint is requested — the same consequences as setRasterRenderer().
 
double valueAt (double mapX, double mapY, const SpatialReferenceSystem *canvasSRS, int band=1, bool *ok=nullptr) const
 Returns the pixel value at the given geographic coordinate.
 
bool isRasterLayer () const override
 Returns true for layers that render into a raster buffer (WMS, WMTS, GISRaster) rather than populating QGraphicsItems.
 
void setIsBasemap (bool on)
 Marks this raster as a basemap (added via Add Basemap ▸ Local File). Also retags the layer type to SWMMImageryLayer so it lands in the Basemaps layer-tree category.
 
bool isBasemapLayer () const override
 Returns true for world-spanning basemap layers (XYZ tile providers, WMS/WMTS services covering the whole world) that should NOT be included when computing the data-driven full extent.
 
void fetchCache (const MapExtent &extent, const QSize &viewportSize, const SpatialReferenceSystem *srs) override
 Triggers any asynchronous (or synchronous) tile/data fetch needed to populate this layer's internal cache for the given view state.
 
void render (QPainter *painter, const MapExtent &extent, const QSize &imageSize, const SpatialReferenceSystem *srs) override
 Renders this layer's content directly into painter.
 
void populateScene (QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override
 Creates / updates QGraphicsItems representing this layer in the scene.
 
void depopulateScene (QGraphicsScene *scene) override
 Removes all QGraphicsItems belonging to this layer from the scene.
 
void refreshScene (QGraphicsScene *scene, const MapExtent &canvasExtent, const SpatialReferenceSystem *canvasSRS) override
 Smart scene refresh — updates existing items instead of destroying and recreating.
 
void onCanvasCRSChanged (const SpatialReferenceSystem *newCanvasSRS) override
 Called when the user changes the canvas CRS so layers can pre-compute any CRS-dependent transform caches.
 
bool hillshadeEnabled () const
 
void setHillshadeEnabled (bool on)
 
double hillshadeAzimuthDeg () const
 
double hillshadeAltitudeDeg () const
 
double hillshadeZFactor () const
 
double hillshadeStrength () const
 
void setHillshadeParams (double azimuthDeg, double altitudeDeg, double zFactor, double strength)
 
- Public Member Functions inherited from TilePyramidLayer
 TilePyramidLayer (OpenSWMMVisWorkspace *parent=nullptr)
 
 ~TilePyramidLayer () override
 
- Public Member Functions inherited from OpenSWMMVisLayer
 OpenSWMMVisLayer (OpenSWMMVisWorkspace *parent)
 
 OpenSWMMVisLayer (const QString &name="Unlabeled Layer", OpenSWMMVisWorkspace *parent=nullptr)
 
virtual ~OpenSWMMVisLayer ()
 
QString layerId () const
 Returns the layer's immutable unique identifier (UUID).
 
QString name () const
 Returns the user-visible name of this layer.
 
void setName (const QString &name)
 Sets the user-visible name.
 
OpenSWMMVisLayerType layerType () const
 Returns the layer type discriminator.
 
bool isVisible () const
 Returns true when this layer should be drawn.
 
void setVisible (bool visible)
 Shows or hides this layer.
 
double opacity () const
 Returns the layer opacity in the range [0.0, 1.0]. 0.0 = fully transparent; 1.0 = fully opaque.
 
void setOpacity (double opacity)
 Sets the layer opacity. Values are clamped to [0.0, 1.0].
 
SpatialReferenceSystemsrs () const
 Returns the spatial reference system for this layer, or nullptr if the layer has no known CRS.
 
void setSRS (SpatialReferenceSystem *srs, bool ownsSRS=false)
 Sets (or replaces) the CRS for this layer.
 
QString crsDescription () const
 Returns a human-readable summary of this layer's CRS for display in the Properties window.
 
MapExtent extent () const
 Returns the layer extent in the layer's own CRS.
 
void setExtent (const MapExtent &extent)
 Sets the layer spatial extent (in the layer's CRS).
 
void setViewportSize (int w, int h)
 Called by MapCanvas before refreshScene so layers can request the correct pixel dimensions for tile/image requests.
 
int viewportWidth () const
 
int viewportHeight () const
 
QVector< OpenSWMMVisLayer * > children () const
 Returns the ordered list of child layers.
 
double layerZValue () const
 Returns the z-value base assigned to this layer by the canvas. Items within the layer should use z-values relative to this.
 
void setLayerZValue (double z)
 Called by the canvas to set this layer's z-value band.
 
virtual OpenSWMM::Render::IFeatureRendererrenderer () const
 
virtual void setRenderer (std::unique_ptr< OpenSWMM::Render::IFeatureRenderer >)
 
virtual OpenSWMM::Render::RuleListruleList ()
 
virtual const OpenSWMM::Render::RuleListruleList () const
 
const OpenSWMM::Render::TemporalSpectemporalSpec () const
 
void setTemporalSpec (const OpenSWMM::Render::TemporalSpec &spec)
 
const OpenSWMM::Render::LabelConfiglabelConfig () const
 
virtual void setLabelConfig (const OpenSWMM::Render::LabelConfig &cfg)
 
const OpenSWMM::Render::MaskSpecmaskSpec () const
 
void setMaskSpec (const OpenSWMM::Render::MaskSpec &spec)
 
const OpenSWMM::Render::AuxiliaryStorageSpecauxStorageSpec () const
 
void setAuxStorageSpec (const OpenSWMM::Render::AuxiliaryStorageSpec &spec)
 
const QVector< OpenSWMM::Render::JoinSpec > & joins () const
 
void setJoins (const QVector< OpenSWMM::Render::JoinSpec > &joins)
 
const OpenSWMM::Render::DiagramSpecdiagramSpec () const
 
void setDiagramSpec (const OpenSWMM::Render::DiagramSpec &spec)
 
OpenSWMMVisWorkspaceworkspace () const
 
void setBasicAuth (const QString &username, const QString &password)
 Sets HTTP Basic authentication for all subsequent network requests.
 
void setHttpHeaders (const BasemapHttpHeaders &headers)
 Sets arbitrary extra HTTP headers applied to every request.
 
BasemapHttpHeaders httpHeaders () const
 

Properties

QString filePath
 
int bandCount
 
int renderBand
 
double noDataValue
 
- Properties inherited from OpenSWMMVisLayer
QString Name
 
bool Visible
 
double Opacity
 
QString LayerId
 
OpenSWMMVisLayerType LayerType
 
QVector< OpenSWMMVisLayer * > Children
 
QString CRS
 

Additional Inherited Members

- Public Types inherited from OpenSWMMVisLayer
enum  OpenSWMMVisLayerType {
  SWMMDefaultLayer = 0 ,
  SWMMModelLayer = 1 ,
  SWMMResultsLayer = 2 ,
  SWMMGISLayer = 3 ,
  SWMMVectorLayer = 4 ,
  SWMMRasterLayer = 5 ,
  SWMMImageryLayer = 6 ,
  SWMMTabularDataLayer = 7 ,
  SWMMTabularyTimeSeriesLayer = 8 ,
  SWMMSubProjectLayer = 9 ,
  SWMMWMSLayer = 10 ,
  SWMMWMTSLayer = 11 ,
  SWMM2DMeshLayer = 12 ,
  SWMM2DResultsLayer = 13 ,
  SWMMAnnotationLayer = 14 ,
  SWMMFeatureLayer = 15
}
 Discriminator for the concrete layer class. More...
 
- Protected Member Functions inherited from TilePyramidLayer
void cacheTile (const QString &key, const QImage &img, const MapExtent &extent, int level)
 Insert a produced tile (no-op for null images). extent is the tile's geographic extent in the subclass's tile CRS; level is the subclass's pyramid-level tag (metadata only — the fallback search is extent-based).
 
bool isTileCached (const QString &key) const
 True when key holds a non-null cached tile. Does not promote the entry in the LRU.
 
QImage cachedTileImage (const QString &key) const
 The cached image for key, or a null QImage.
 
void clearTiles ()
 Drop every cached tile (style / CRS / source change).
 
void setTileCacheCapacity (int maxTiles)
 
int tileCacheCapacity () const
 
bool resolveTileForDraw (const QString &key, const MapExtent &tileExtent, double maxSpanRatio, TileDraw &out) const
 Resolve the image + source sub-rect that should paint the tile key with geographic extent tileExtent.
 
- Protected Member Functions inherited from OpenSWMMVisLayer
bool addChild (OpenSWMMVisLayer *child)
 
bool removeChild (OpenSWMMVisLayer *child)
 
void setLayerType (OpenSWMMVisLayerType type)
 
- Protected Attributes inherited from OpenSWMMVisLayer
QByteArray m_authHeader
 "Basic <base64>" or empty
 
BasemapHttpHeaders m_httpHeaders
 arbitrary headers (incl. "referer")
 

Detailed Description

A map layer backed by a GDAL raster dataset.

Reads any GDAL-supported raster format (GeoTIFF, NetCDF, HDF5 …), warps the requested tile into the canvas CRS using GDALWarp, renders the result with a configurable colour ramp, and caches the warped tile until the extent or CRS changes.

Colouring is delegated to the layer's IRasterRenderer (see rasterRenderer()): a GraduatedRasterRenderer (continuous stretch or classified ramp over one band), a PalettedRasterRenderer (categorical values, incl. an embedded GDAL colour table) or a MultiBandColorRenderer (RGB(A) composite of three / four Byte bands).

Constructor & Destructor Documentation

◆ GISRasterLayer()

GISRasterLayer::GISRasterLayer ( const QString &  filePath,
OpenSWMMVisWorkspace parent = nullptr 
)
explicit
Here is the call graph for this function:

◆ ~GISRasterLayer()

GISRasterLayer::~GISRasterLayer ( )
override

Member Function Documentation

◆ bandCount()

int GISRasterLayer::bandCount ( ) const

◆ bandRange()

QPair< double, double > GISRasterLayer::bandRange ( int  band) const

Approximate (min, max) of band from GDAL statistics (PAM-cached when available). (NaN, NaN) when unavailable.

Here is the caller graph for this function:

◆ colorTableClasses()

QList< PalettedRasterRenderer::Class > GISRasterLayer::colorTableClasses ( ) const

Band 1's GDAL colour table as paletted classes (value, label = value, RGBA). Tables larger than 32 entries are filtered to the values actually observed in the band sample so unused palette slots do not flood the legend.

Here is the call graph for this function:

◆ depopulateScene()

void GISRasterLayer::depopulateScene ( QGraphicsScene *  scene)
overridevirtual

Removes all QGraphicsItems belonging to this layer from the scene.

Reimplemented from OpenSWMMVisLayer.

◆ detectVerticalUnit()

QString GISRasterLayer::detectVerticalUnit ( ) const

Heuristically detects the vertical unit of the raster's elevation values from the embedded CRS metadata.

Returns
"m" for metre-based or geographic CRS (most global DEMs), "ft" for US-customary projected CRS (state plane feet, etc.). Returns "m" when no CRS metadata is present.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ extendedMetadata()

QVector< QPair< QString, QString > > GISRasterLayer::extendedMetadata ( ) const
overridevirtual

Ordered key→value pairs of TYPE-SPECIFIC metadata, rendered by the Metadata tab below the common block the dialog builds itself.

Default empty. Subclasses add only what is unique to them (e.g. a mesh: vertices / cells / edges / elevation range). QVector<QPair> preserves insertion order without a new type.

Reimplemented from OpenSWMMVisLayer.

Here is the call graph for this function:

◆ fetchCache()

void GISRasterLayer::fetchCache ( const MapExtent extent,
const QSize &  viewportSize,
const SpatialReferenceSystem srs 
)
overridevirtual

Triggers any asynchronous (or synchronous) tile/data fetch needed to populate this layer's internal cache for the given view state.

Called by MapCanvas::refreshLayerItems() for every visible raster layer BEFORE the MapRenderJob is started. This decouples tile-requesting (potentially async HTTP) from tile-drawing (synchronous, in the background render thread).

  • WMSLayer: issues a GetMap HTTP request if the cached tile is stale, then returns immediately. When the reply arrives the layer emits repaintRequested() to trigger another render pass.
  • WMTSLayer: fires fetchTileIfNeeded() for every tile that covers the current viewport; already-cached tiles are skipped.
  • GISRasterLayer: runs GDALWarp synchronously (fast for local files) if the cache is stale.

The default implementation is a no-op.

Parameters
extentVisible geographic extent in canvas-CRS coordinates.
viewportSizePixel dimensions of the viewport.
srsCanvas CRS.

Reimplemented from OpenSWMMVisLayer.

Here is the call graph for this function:

◆ filePath()

QString GISRasterLayer::filePath ( ) const

◆ filePathChanged

void GISRasterLayer::filePathChanged ( const QString &  path)
signal

◆ hasColorTable()

bool GISRasterLayer::hasColorTable ( ) const

True when band 1 carries a GDAL colour table (paletted raster).

◆ hasNoDataValue()

bool GISRasterLayer::hasNoDataValue ( ) const

Returns true when the dataset has a known no-data value.

Here is the caller graph for this function:

◆ hillshadeAltitudeDeg()

double GISRasterLayer::hillshadeAltitudeDeg ( ) const
inline
Here is the caller graph for this function:

◆ hillshadeAzimuthDeg()

double GISRasterLayer::hillshadeAzimuthDeg ( ) const
inline
Here is the caller graph for this function:

◆ hillshadeEnabled()

bool GISRasterLayer::hillshadeEnabled ( ) const
inline
Here is the caller graph for this function:

◆ hillshadeStrength()

double GISRasterLayer::hillshadeStrength ( ) const
inline
Here is the caller graph for this function:

◆ hillshadeZFactor()

double GISRasterLayer::hillshadeZFactor ( ) const
inline
Here is the caller graph for this function:

◆ isBasemapLayer()

bool GISRasterLayer::isBasemapLayer ( ) const
inlineoverridevirtual

Returns true for world-spanning basemap layers (XYZ tile providers, WMS/WMTS services covering the whole world) that should NOT be included when computing the data-driven full extent.

MapCanvas::fullExtent() uses this to skip basemap layers so that "Zoom to Full Extent" zooms to the project's data (SWMM network, DTM, bounded WMS coverage) rather than the whole globe. Layers with a specific, bounded geographic footprint (GISRasterLayer, local WMS/WMTS with EX_GeographicBoundingBox) return false so they participate in the extent union.

Reimplemented from OpenSWMMVisLayer.

◆ isByteRaster()

bool GISRasterLayer::isByteRaster ( ) const

True when band 1 is 8-bit (GDT_Byte) — the only type the RGB composite path renders without saturating.

◆ isRasterLayer()

bool GISRasterLayer::isRasterLayer ( ) const
inlineoverridevirtual

Returns true for layers that render into a raster buffer (WMS, WMTS, GISRaster) rather than populating QGraphicsItems.

The MapCanvas uses this to decide whether a layer participates in the background render job or in the QGraphicsScene overlay.

Reimplemented from OpenSWMMVisLayer.

◆ noDataValue()

double GISRasterLayer::noDataValue ( ) const

◆ noDataValueChanged

void GISRasterLayer::noDataValueChanged ( double  value)
signal
Here is the caller graph for this function:

◆ notifyRasterRendererEdited()

void GISRasterLayer::notifyRasterRendererEdited ( )

Call after mutating the live renderer in place (through its own setters) so cached tiles are dropped, rasterRendererChanged() fires and a repaint is requested — the same consequences as setRasterRenderer().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ onCanvasCRSChanged()

void GISRasterLayer::onCanvasCRSChanged ( const SpatialReferenceSystem newCanvasSRS)
overridevirtual

Called when the user changes the canvas CRS so layers can pre-compute any CRS-dependent transform caches.

Parameters
newCanvasSRSThe new canvas CRS.

Reimplemented from OpenSWMMVisLayer.

◆ openAsync()

void GISRasterLayer::openAsync ( const QString &  filePath)

Asynchronously open filePath. GDALOpenEx + metadata read + ComputeStatistics run on a worker thread; the layer is populated on the GUI thread and openFinished(bool) fires on completion (ok==false ⇒ open failed). Construct the layer with an empty path first, then call this; the synchronous openDataset path (used by tests / project restore) is unchanged.

◆ openFinished

void GISRasterLayer::openFinished ( bool  ok)
signal

Emitted on the GUI thread when openAsync() completes.

◆ overviewBuildFinished

void GISRasterLayer::overviewBuildFinished ( bool  ok)
signal

The background overview build finished (ok ⇒ pyramids ready and the render will pick them up on the next repaint).

◆ overviewBuildStarted

void GISRasterLayer::overviewBuildStarted ( const QString &  name)
signal

A background overview (.ovr pyramid) build has started for this raster. name is the display file name.

◆ populateScene()

void GISRasterLayer::populateScene ( QGraphicsScene *  scene,
const MapExtent canvasExtent,
const SpatialReferenceSystem canvasSRS 
)
overridevirtual

Creates / updates QGraphicsItems representing this layer in the scene.

Derived classes override this to add their items to the scene. Items should be created in scene coordinates (= map CRS coordinates) after reprojecting from the layer's native CRS.

Called by the MapCanvas when:

  • The layer is first added.
  • The canvas CRS changes (after onCanvasCRSChanged).
  • The layer data changes (model loaded, tile fetched, etc.).
Parameters
sceneThe shared OpenSWMMVisScene to add items to.
canvasExtentVisible extent in canvas-CRS coordinates.
canvasSRSThe CRS currently used by the MapCanvas.

Implements OpenSWMMVisLayer.

Here is the call graph for this function:

◆ rasterRenderer()

OpenSWMM::Render::IRasterRenderer * GISRasterLayer::rasterRenderer ( ) const

The IRasterRenderer that will drive this layer's warp pass.

Constructed eagerly as a default GraduatedRasterRenderer so callers never have to null-check. Owned by the layer; do not delete.

Here is the caller graph for this function:

◆ rasterRendererChanged

void GISRasterLayer::rasterRendererChanged ( )
signal

Emitted when setRasterRenderer() swaps the renderer pointer or notifyRasterRendererEdited() reports an in-place edit.

Here is the caller graph for this function:

◆ refreshScene()

void GISRasterLayer::refreshScene ( QGraphicsScene *  scene,
const MapExtent canvasExtent,
const SpatialReferenceSystem canvasSRS 
)
overridevirtual

Smart scene refresh — updates existing items instead of destroying and recreating.

Override in subclasses to provide efficient incremental updates. The default implementation calls depopulateScene() then populateScene(), which is backward-compatible but causes flicker for raster/tile layers.

Raster/WMS layers should override to keep persistent scene items and update them in-place. Vector layers should override to skip rebuilding when only the view extent has changed (items are already in scene coords).

Reimplemented from OpenSWMMVisLayer.

Here is the caller graph for this function:

◆ render()

void GISRasterLayer::render ( QPainter *  painter,
const MapExtent extent,
const QSize &  imageSize,
const SpatialReferenceSystem srs 
)
overridevirtual

Renders this layer's content directly into painter.

Called by the background MapRenderJob for raster layers. The painter is backed by a QImage of imageSize pixels spanning the geographic area described by extent in CRS srs. Pixel (0,0) maps to (extent.xMin, extent.yMax).

The default implementation is a no-op. Raster layer subclasses (WMS, WMTS, GISRaster) override this to paint their cached tile/image data without touching QGraphicsScene.

Parameters
painterTarget painter (backed by viewport-sized QImage).
extentVisible geographic extent in canvas-CRS coordinates.
imageSizePixel dimensions of the target image.
srsCanvas CRS.

Reimplemented from OpenSWMMVisLayer.

Here is the call graph for this function:

◆ renderBand()

int GISRasterLayer::renderBand ( ) const

◆ renderBandChanged

void GISRasterLayer::renderBandChanged ( int  band)
signal
Here is the caller graph for this function:

◆ sampleValues()

QVector< double > GISRasterLayer::sampleValues ( int  band,
int  maxSamples = 200000 
) const

Decimated, overview-aware value sample of band — at most maxSamples finite, non-NoData values on a regular grid over the whole raster. Feeds Quantile / Jenks / StdDev classification and unique-value discovery.

Here is the caller graph for this function:

◆ setHillshadeEnabled()

void GISRasterLayer::setHillshadeEnabled ( bool  on)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setHillshadeParams()

void GISRasterLayer::setHillshadeParams ( double  azimuthDeg,
double  altitudeDeg,
double  zFactor,
double  strength 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ setIsBasemap()

void GISRasterLayer::setIsBasemap ( bool  on)

Marks this raster as a basemap (added via Add Basemap ▸ Local File). Also retags the layer type to SWMMImageryLayer so it lands in the Basemaps layer-tree category.

Here is the call graph for this function:

◆ setRasterRenderer()

void GISRasterLayer::setRasterRenderer ( std::unique_ptr< OpenSWMM::Render::IRasterRenderer r)

Replaces the current raster renderer.

The layer takes ownership. Null pointers are silently rejected (the method no-ops) so rasterRenderer() never returns null. Emits rasterRendererChanged() when the pointer actually changes.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setRenderBand()

void GISRasterLayer::setRenderBand ( int  band)

Sets the 1-based band index to render on the single-band colour path. Re-reads that band's NoData value and, when the live renderer is a GraduatedRasterRenderer, re-seeds its data range and classification from the band's statistics / sample.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ sourceDescription()

QString GISRasterLayer::sourceDescription ( ) const
overridevirtual

Human-readable source of this layer: a file path, a service URL, or a description for in-memory / derived layers.

Default empty — the dialog shows "(none)". Concrete layers override to return their real origin (e.g. modelFilePath(), resultsFilePath(), serviceUrl(), or "(generated mesh)").

Reimplemented from OpenSWMMVisLayer.

◆ styleSubjects()

std::vector< std::unique_ptr< openswmmvis::ui::ILayerStyleSubject > > GISRasterLayer::styleSubjects ( )
overridevirtual

Slice U-7 — surface this raster's Q_PROPERTYs as the single styleable subject for the unified LayerStyleDialog.

Reimplemented from OpenSWMMVisLayer.

◆ uniqueValues()

QList< int > GISRasterLayer::uniqueValues ( int  band,
int  cap = 256 
) const

Distinct integer values observed in sampleValues(band), ascending, truncated to cap entries. Decimated — rare classes may be missed.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ valueAt()

double GISRasterLayer::valueAt ( double  mapX,
double  mapY,
const SpatialReferenceSystem canvasSRS,
int  band = 1,
bool *  ok = nullptr 
) const

Returns the pixel value at the given geographic coordinate.

Parameters
mapXX in canvas CRS.
mapYY in canvas CRS.
canvasSRSCanvas CRS.
band1-based band index.
okSet to true if a valid value was found.
Here is the call graph for this function:
Here is the caller graph for this function:

Property Documentation

◆ bandCount

int GISRasterLayer::bandCount
read

◆ filePath

QString GISRasterLayer::filePath
read

◆ noDataValue

double GISRasterLayer::noDataValue
read

◆ renderBand

int GISRasterLayer::renderBand
readwrite

The documentation for this class was generated from the following files: