fmeobjects.FMERasterTools.hillshade
- FMERasterTools.hillshade(azimuth, altitude, raster, parms)
Generates a shaded relief effect, useful for visualizing terrain.
Each selected input band will be converted to a GRAY8 band with hillshade values between 0 and 255. Additionally, if <interpolate nodata> is disabled or if the band has a nodata value, an additional ALPHA8 band will be generated, with a value of 0 where the input was nodata and a value of 255 where the input was data.
- Parameters:
azimuth (float) – Angle of the light source, expressed in positive degrees from 0 to 360, measured clockwise from north. The value 315 is typically used to generate shaded maps.
altitude (float) – Altitude angle of the light source above the horizon, expressed in positive degrees, with 0 degrees at the horizon and 90 degrees directly overhead.
raster (FMERaster) – Raster object to apply shading effect to.
parms (dict[str, str]) – (Optional) Name-value pair representing additional parameters.
Possible parms are :
kFME_Hillshade_interpolateNodata
Yes or No (Default is No)
Whether to calculate values at raster edges and near nodata values. When this is set to No, there will be a one pixel border around the edge of the raster set to the nodata value (i.e. the alpha band value will be set to 0). Additionally, when any pixel in the 3x3 window used to calculate the hillshade value is equal to nodata, the output pixel will also be set to nodata. When this is set to Yes, values around the edge and near nodata values will be estimated by interpolating missing values.
(Default) Use Horn’s method for slope/aspect calculation. Better suited to rougher terrain.
Use Zevenbergen & Thorne’s method for slope/aspect calculation. Better suited to smooth terrain.
- Return type:
- Returns:
The raster after applying the shading effect.
- Raises:
FMEException – An exception is raised if an error occurred.