This function computes the hillshade from a raster surface and returns an array of hillshades.
Syntax
float8[] ST_Hillshade(raster rast, integer pyramid_level, integer band, Box extent, BoxType type, float8 zfactor, float8 azimuth, float8 altitude);
Parameters
Parameter | Description |
---|---|
rast | The raster object. |
pyramid_level | The pyramid level. |
band | The sequence number of the band. |
extent | The area to be analyzed, in the format of '((minX,minY),(maxX,maxY))' .
|
type | The coordinate type of the area to be analyzed. Valid values:
|
zfactor | The conversion factor that adjusts the units of measure for the vertical (or elevation) units when they are different from the horizontal coordinate (x,y) units of the input surface. Default value: 1. |
azimuth | The azimuth angle of the sun, measured clockwise from the north. Unit: degrees. Valid values: 0 to 360. Default value: 315 (northwest). |
altitude | The altitude angle of the sun above the horizon. Unit: degrees. Valid values: 0 to 90. A value of 90 indicates that the sun is directly overhead. |
Description
The hillshade function obtains the hypothetical illumination of a surface by determining the illumination value for each cell in a raster object. It does this by setting a position for a hypothetical light source and calculating the illumination value of each cell in relation to neighboring cells. This function can greatly enhance the visualization of a surface for analysis or graphical display, especially when transparency is used.
By default, shadow and light are shades of gray associated with integers from 0 to 255, which indicate from black to white.
Examples
select st_hillshade(rast, 0, 0, '(0,0), (5,5)', 'Raster', 4, 180, 80) from t_surface where id=1;
st_hillshade
------------------------------------------------------------------------------------------------------------------------
{241.058488938393,213.471315764272,248.503699937536,219.598763873892,186.13564444109,240.161828059936,230.539211856565.
.,181.175441801687,200.382310292847,219.449103772262,254.328476494409,254.486010192554,216.118274956217,165.59445864749.
.,156.73816546518,215.145437887027,241.33319958436,247.721999074798,213.697052503065,162.469277526395,107.176240164182,.
.160.555287495495,251.337972845835,254.741770272405,193.116915680406,148.402860944697,101.093528491212,133.798418058854.
.,254.285971266744,253.163140286752,158.495693029955,109.654658826363,95.2639231161562,131.371235276504,252.85982399282.
.2,254.364747782334}
(1 row)