A hillshade renderer uses a grayscale representation of a 3D surface to help visualize the raster data in a RasterLayer. More...
Header: | #include <HillshadeRenderer.h> |
Since: | Esri::ArcGISRuntime 100.0 |
Inherits: | Esri::ArcGISRuntime::RasterRenderer |
Inherited By: |
Public Functions
HillshadeRenderer(double altitude, double azimuth, double zFactor, QObject *parent = nullptr) | |
HillshadeRenderer(double altitude, double azimuth, double zFactor, Esri::ArcGISRuntime::SlopeType slopeType, double pixelSizeFactor, double pixelSizePower, int outputBitDepth, QObject *parent = nullptr) | |
virtual | ~HillshadeRenderer() override |
double | altitude() const |
double | azimuth() const |
int | outputBitDepth() const |
double | pixelSizeFactor() const |
double | pixelSizePower() const |
Esri::ArcGISRuntime::SlopeType | slopeType() const |
double | zFactor() const |
Detailed Description
A hillshade (also known as shaded relief) is a grayscale representation of a 3D surface, with the sun's relative position taken into account for shading the image. The altitude and azimuth properties specify the light's position.
// Apply the hillshade renderer to the raster layer constexpr double altitude = 45.0; constexpr double azimuth = 315.0; constexpr double zFactor = 0.000016; constexpr SlopeType slopeType = SlopeType::None; constexpr double pixelSizeFactor = 1.0; constexpr double pixelSizePower = 1.0; constexpr int outputBitDepth = 8; HillshadeRenderer* hillshadeRenderer = new HillshadeRenderer(altitude, azimuth, zFactor, slopeType, pixelSizeFactor, pixelSizePower, outputBitDepth, this); m_rasterLayer->setRenderer(hillshadeRenderer);
Relevant samples:
- Hillshade renderer: Apply a hillshade renderer to a raster.
Member Function Documentation
HillshadeRenderer::HillshadeRenderer (double altitude, double azimuth, double zFactor , QObject *parent = nullptr)
Constructor that takes the following parameters:
- altitude - The light's angle of elevation above the horizon.
- azimuth - The light's relative angle along the horizon measured clockwise, where 0 is north.
- zFactor - The z-factor used to convert z unit to x,y units.
- parent - The optional parent.
HillshadeRenderer::HillshadeRenderer (double altitude, double azimuth, double zFactor , Esri::ArcGISRuntime::SlopeType slopeType , double pixelSizeFactor , double pixelSizePower , int outputBitDepth , QObject *parent = nullptr)
Constructor that takes the following parameters:
- altitude - The light's angle of elevation above the horizon.
- azimuth - The light's relative angle along the horizon measured clockwise, where 0 is north.
- zFactor - The z-factor used to convert z unit to x,y units.
- slopeType - The SlopeType.
- pixelSizeFactor - The pixel size factor to account altitude changes as the viewer zooms.
- pixelSizePower - The pixel size power to account altitude changes as the viewer zooms.
- outputBitDepth - The output bit depth.
- parent - The optional parent.
[override virtual]
HillshadeRenderer::~HillshadeRenderer ()
Destructor.
double HillshadeRenderer::altitude() const
Returns the sun's angle of elevation above the horizon and ranges from 0 to 90 degrees.
A value of 0 degrees indicates that the sun is on the horizon, that is, on the same horizontal plane as the frame of reference. A value of 90 degrees indicates that the sun is directly overhead. Together the altitude and azimuth indicate the sun's relative position.
The default value is 45 degrees.
double HillshadeRenderer::azimuth() const
Returns the sun's relative position along the horizon (in degrees).
This position is indicated by the angle of the sun measured clockwise from due north. An azimuth of 0 degrees indicates north, east is 90 degrees, south is 180 degrees, and west is 270 degrees.
The default is 315 degrees.
int HillshadeRenderer::outputBitDepth () const
Returns the bit depth (pixel depth) of a raster cell.
Determines the range of values that a particular raster can store, which is based on the formula 2n (where n is the bit depth). For example, an 8-bit raster can have 256 unique values that range from 0 to 255.
The default bit depth is 8.
double HillshadeRenderer::pixelSizeFactor () const
Returns the pixel size factor.
Pixel size factor and pixel size power allow nonlinear adjustments to be made to elevation scaling. This is typically recommended when working with world-wide datasets projected using World Mercator. These values adjust the zFactor as follows:
Adjusted ZFactor = (ZFactor) + (PixelSize)^PixelSizePower * (PixelSizeFactor)
The default value is 1.
double HillshadeRenderer::pixelSizePower () const
Returns the pixel size power.
Pixel size factor and pixel size power allow nonlinear adjustments to be made to elevation scaling. This is typically recommended when working with world-wide datasets projected using World Mercator. These values adjust the zFactor as follows:
Adjusted ZFactor = (ZFactor) + (PixelSize)^PixelSizePower * (PixelSizeFactor)
The default value is 1.
Esri::ArcGISRuntime::SlopeType HillshadeRenderer::slopeType () const
Returns the manner in which inclination of the slope is calculated.
The default is SlopeType::None
.
double HillshadeRenderer::zFactor () const
Returns a scaling factor.
This is used to convert the elevation values for two purposes:
- To convert the elevation units (such as meters or feet) to the horizontal coordinate units (x,y) of the dataset, which may be feet, meters, or degrees.
- To add vertical exaggeration for visual effect.
If the x,y units and z units are in the same units of measure the z-factor is 1, unless a vertical exaggeration needs to be applied. If the x,y units and z units are in different units of measure the z-factor must be set to the appropriate factor, or the results will be incorrect. For example, if your z units are feet and your x,y units are meters, you would use a z-factor of 0.3048 to convert your z units from feet to meters (1 foot = 0.3048 meter).
The default value is 1.