This project is read-only.

Raster Layer - Create Hillshade

Feb 12, 2011 at 5: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.");
            IMapRasterLayer layer = layers[0];
            layer.ElevationFactor = 1;

Thanks for any help,


Feb 19, 2011 at 4:44 PM

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

(Raster data operations in DotSpatial)