Raster Layer - Create Hillshade

Developer
Feb 12, 2011 at 4:16 PM

I have a raster layer (DEM) in the map and I want to set the hillshade through code. The following code doesn't work (no hillshade effect is created). The map units and elevation units are meters. Anything I'm missing in my code?

            IMapRasterLayer[] layers = map1.GetRasterLayers();
            if (layers.Length == 0)
            {
                MessageBox.Show("Please add a raster layer.");
                return;
            }
            IMapRasterLayer layer = layers[0];
            layer.ElevationFactor = 1;
            layer.Symbolizer.CreateHillShade();


Thanks for any help,

Jiri

Developer
Feb 19, 2011 at 3:44 PM

Sample code for creating raster hillshade can be found in: Tutorial 3

(Raster data operations in DotSpatial)