+ Reply to Thread
Results 1 to 2 of 2

Thread: Trouble with Hillshading

  1. #1
    Robert Blomquist
    Join Date
    Jan 2011
    Answers Provided


    Exclamation Trouble with Hillshading

    I am doing a project using the real elevation and azumith of the sun. Many of the elevations are negative, this seems to be a problem with hillshade. Is there a way to convert negative values to positive?

    I got my data from the NOAA solar position calculator at:http://www.srrb.noaa.gov/highlights/sunrise/azel.html .

  2. #2
    William Huber

    Join Date
    Apr 2010
    Answers Provided


    Default Re: Trouble with Hillshading

    Unfortunately there's not, Robert, because a negative elevation means the sun is below the horizon and a positive one means it's above: those are different positions.

    There may be a workaround: tilt the DEM! (After all, this is what is really happening, isn't it: the earth it tilting relative to the sun; the sun is not moving through the sky...) Because DEMs assume all heights are perfectly vertical, this is an approximation, but it could be effective provided you don't have to tilt more than a few degrees.

    Here's one way to do it. Let the sun's bearing be 'a' degrees east of north (e.g., the sun at the southwest will have a bearing around 225 degrees). Let the desired amount of tlt be t degrees. Find the coordinates of a point near the middle of the DEM; you don't have to be precise. Let these coordinates be (x,y). With a calculator or the equivalent, compute the three numbers
    T = tan(t)
    S = sin(a)
    C = cos(a)
    (to seven significant figures) and then compute
    b = x*S + y*C.
    The tilted DEM is obtained by adding the grid
    T * ( S * $$XMap + C * $$YMap - b )
    from the DEM. (The expression in parentheses computes the distance from a line passing through your point of origin. The line runs perpendicular to the sun's bearing.)

    Using the tilted DEM, compute the hillshade, but in so doing, increase the sun's elevation by t degrees. This effectively tilts the sun along with the DEM.

    For example, let the sun's elevation be -1 degree and its bearing be 225 degrees east of north. Suppose you choose (1000, -500) as the center of the DEM and you decide to tilt it by t = 3 degrees. Then
    T = tan(3 degrees) = 0.05240778
    S = sin(225 degrees) = -0.7071068
    C = cos(225 degrees) = -0.7071068
    b = -0.7071068 * 1000 + (-0.7071068 * (-500)) = -353.5534.
    Using the raster calculator (let's hope you have a version of Spatial Analyst preceding 10.0, for otherwise you will have to work much harder to carry this out), compute
    tilt = 0.05240778 * ( (-0.7071068) * $$XMap + (-0.7071068) * $$YMap - (-353.5534) )
    Finally, compute the hillshade of [DEM] + [tilt] for a bearing of 225 degrees and azimuth of -1 + 3 = 2 degrees.
    Last edited by whuber; 02-07-2011 at 05:43 AM.
    --Bill Huber
    Quantitative Decisions
    For more help, visit the worldwide community at http://gis.stackexchange.com

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts