Here is a pretty pic of the raster I am using - with no effects applied - just the color ramp and historgram adjusted to show out all the relief - all be it in a very 2D way!

I have a raster layer that I want to display with hillshade as a default. I can do this in code and in effect it is the same as selecting the Hillshade option in ArcMap (see below):

When you do this however - it looks rubbish:

Especially if you zoom into the raster you see all kinds of gridded articfacts - which does not look nice at all!

However if I create a proper Hillshade layer using the raster with Spatial Analyst and overlay it with transparancy of 85% it looks pretty good and very different!:

My question is in two parts really:

1) How can I acheive this effect in ArcMap and override the default functionality of the Hillshade option (I supsect this is impossible, or is it some setting I have missed out that is caused the raster to be displayed poorly). If it is possible to override or select the correct settings - is it possible to do in ArcObjects.

2) If option 1 is not possible, can I create my effect with creating a Hillshade layer (without using Spatial Analyst) and effectively fuse it to the orginal raster - i.e. I don't want people to see two layers in the table of contents in ArcMap. I just want one layer but with a default hillshade rendering of my choosing/configuration. I need to do this programmatically too i.e ArcObjects.

UPDATE 13 Jan 2012

OK - so thanks to everybody on here with their thoughts, some nice suggestions too and things I never knew existed.
One thing I did learn is that you must have your DEM in the correct Spatial Reference and measurement units or the resulting hillshade looks too black and over exaggereated - check out this video to find out more - its a very good explanation.

So I think I now know what I need to do in regards to producing some high quality hillshading, but I think it's going to take some low level tweaking ArcObjects code. I am thinking I need to come up with my own graphics rendering and plug this into ArcMap (I have a dll that renders bitmaps of grids in a cool way). I think a good place to show this would be to override the Draw() event on something like the IRasterRenderer, and insert my own image rendering. Of course it might get a bit complicated with reprojections etc. Hmmmmm.

Has anyone done any kind of this low level graphics rendering in ArcMap - if so can you offer any guidance or things I should be aware of?

I've never done this, but I feel you can use IRasterRenderer to customize how to render a specific raster. If you have the two datasets (hill + regular) you can use a IRasterCursor to blend and draw each pixel together.
–
GeorgeJan 6 '12 at 12:18

For what it's worth, I just tried the same thing yesterday in ArcMap and it look terrible too.
–
Chad CooperJan 6 '12 at 13:36

@George, I think a RasterCursor changes the CELL value - whereas I think I want to change the colour value - i.e. effectively changing its colour intensity based on a hillshade value - do you know how to changes specifc RGB values pixel by pixel?
–
VidarJan 6 '12 at 14:09

1

It looks like the "hillshading effect" is computed by first rounding the elevation values, which effectively turns your DEM into a lot of tiny abrupt terraces. If this is correct, it's unlikely you will find a solution: submit a bug report. You can work around the two-layer problem by grouping the grid and the hillshade layer. BTW, I believe this option is new in version 10; it would help to update the tags by indicating what version of ArcMap you're using.
–
whuber♦Jan 6 '12 at 14:42

5 Answers
5

You can somewhat improve the display by changing the resampling method used from the default Nearest Neighbor to Bilinear Interpolation. Layer Properties -> Display Tab -> Resample during display using: Bilinear Interpolation.

This effect works best with DEM and the default black and white color ramp.

You will get a much better result and a lot more control over the display when using 2 raster as you have already done. Make sure you also use the Bilinear Interpolation resampling method during display.

You are right in what you say - this does indeed get rid of the gridding artifacts - but the hillshading still looks awful. In a way, I guess the artifacts were a kind of secondary problem - as it is the hillshading that I really want to nail. But thanks for the effort in your answer!
–
VidarJan 6 '12 at 14:33

Arcmap's on the fly hillshade, the method described, is quick and dirty and was never meant to replace the hillshade result from Spatial Analyst and/or 3D Analyst. Although the same term is used to describe both they are not the same at all.

To create a true hillshade without Spatial Analyst you might try GDAL's gdaldem:

gdaldem hillshade dem.tif shade.tif

The TileMill Terrain Data Tutorial has a nice overview of how to use gdaldem to build a composite hillshade with hypsometric tinting.

If the utility is not direct enough for your application the C++ source code for gdaldem is here.

Good stuff! Especially like the idea of combining the results and of using the Hillshade as well as the slope. Never thought of combining those together. Will have to give it a try.
–
JakubJan 13 '12 at 16:13

gdaldem is definitly the way to go for some GIS opertations over ArcGIS. Hillshading, I have learned, is definitly one of such operations.
–
GIStackJan 13 '12 at 18:05

1

@jakub, if you like the idea of hillshade combined with slope and hypsometry, have a look at Tom Patterson's work on Cross-blended hypsometric tints and Producing Natural-Color Maps with Satellite Land Cover Data. The techniques discussed are aimed at overcoming the limitation with standard hypsometric tinting of the often inappropriate association of low-elevation-rich-greens with vegetation and high-elev-brown/red with deserts or barren lands. Well worth reading and studying.
–
matt wilkieJan 15 '12 at 5:30

If you are looking for a good looking hillshade that takes some time to create, but is great for larger projects where it will get a lot of exposure, you might try the Swiss Hillshade Method - it requires 3 layers, but you can then export them to one georeferenced tiff to save space and for portability. This method DOES require Spatial Analyst, I believe, so it is not a direct answer to OP's question, but may be useful to others looking at hillshade methods in ArcGIS. The method works in other GIS systems too, but the linked toolbox is for ArcGIS.

Edit 11/2014: Esri recently released a new tool for creating Hillshades. It look really slick and should fuse with the Asker's workflows. They introduce it here and you can download the code and installation instructions here

I've used this a few times recently. Very nice. Added to my go-to bag of tricks. Thanks for sharing.
–
KstoneyFeb 29 '12 at 12:09

No problem - I'm glad you found it useful. It definitely makes a nicer hillshade, and I like that I can keep my layers around and just change the coloration on the dem to emphasize everything a little differently
–
nicksanMar 6 '12 at 21:48

When you say in item #2 "can I create my effect with creating a Hillshade layer (without using Spatial Analyst)", do you mean alternate applications for creating a hillshade?

If you want to use an application outside of Spatial Analyst, I just recently learned about (but never have used) the "SEXTANTE for ArcGIS extension" (free), which allows users to consume SEXTANTE tools in ArcMap. If you watch this video clip, you can see that they demonstrate ways to create a hillshade.

I have always been instructed to increase the z exageration when doing hillshade.
I just tried 100 on mine and it seems a bit extreme.
Also changing the stretch type makes a big difference in the look of hillshade.
Since you are talking about how it looks you might also look at this help item.
esir help
Which says that hillshading iis applied at the display pixel resolution.
And to change the illumination angleEsri help
Also changing the direction and contrast