This document is archived and information here might be outdated.  Recommended version.


Displaying raster data (ArcObjects .NET 10.4 SDK)

Displaying raster data


Summary
This topic describes the layers and raster renderers that are used to display various raster data types.

About displaying raster data

ArcGIS manages various raster data in three data types: raster datasets, mosaic datasets, and raster catalogs. Raster layers, mosaic layers, raster catalog layers, and the raster renderer objects are used to display these data types.
A RasterLayer class has a reference to the raster dataset and a renderer instruct on how to display the pixels in the raster datasets. ArcGIS supports many type of raster renderers, including the following:
  • RasterStretchColorampRenderer—Displays one raster band or a single band raster dataset by stretching the pixels to a display device (for example, 0–255) using various stretching methods and a gradual color ramp.
  • RasterRGBRenderer—Displays multiple band raster datasets. It renderers any three specified bands as red, green, and blue (RGB).
  • RasterUniqueValueRenderer—Used for an integer type of single band raster dataset. It displays each value using a defined color.
  • RasterClassifyColorRampRenderer—Used for single band raster datasets. It classifies the pixel values into classes and displays each class with a predefined color.
  • RasterColormapRenderer—Specifically for a raster dataset that has a colormap defined in the dataset.
  • RasterDiscreteColorRenderer—Displays each pixel value using a random color. This renderer does not need to know how many unique values are in the raster dataset because it uses random colors. It is much faster to display a large raster dataset with a look similar to a raster unique value renderer. This renderer does not have a legend.
When a RasterLayer is created from a raster dataset, a default renderer is created and associated with this layer. If the renderer does not meet your criteria, create a custom renderer and assign it to the layer. The default renderer behavior is defined in the RasterRendererMakerDefault class, which can be customized. 
A MosaicLayer is used to display mosaic datasets. A mosaic layer has a reference to a mosaic dataset and a raster renderer, either an RGB for multiple bands or a stretch renderer for a single band.
A GdbRasterCatalog layer is used to display a raster catalog. A raster catalog layer has a reference to a raster catalog and a list of available raster renderers. The RasterCatalogPickerDefault object selects the renderers from the list based on a set of default rules (similar to the default raster renderer rules) to display the rasters in the raster catalog. You can customize the RasterCatalogRenderPickerDefault as well.
For more information on how to customize default renderer behavior, see Creating custom default raster renderers.






To use the code in this topic, reference the following assemblies in your Visual Studio project. In the code files, you will need using (C#) or Imports (VB .NET) directives for the corresponding namespaces (given in parenthesis below if different from the assembly name):
Development licensing Deployment licensing
ArcGIS for Desktop Basic ArcGIS for Desktop Basic
ArcGIS for Desktop Standard ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced ArcGIS for Desktop Advanced
Engine Developer Kit Engine