Represents a layer based on raster data stored in a georeferenced image file or geodatabase.

Namespace:  ESRI.ArcGISExplorer.Mapping

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public sealed class RasterLayer : Layer
Visual Basic (Declaration)
Public NotInheritable Class RasterLayer _
	Inherits Layer

Remarks

The layer classes are a subset of MapItems that reference geographic data. A RasterLayer enables raster data to be added to the map and displayed by the ArcGIS Explorer application.

Raster data can be stored in a georeferenced image file or geodatabase. When a connected RasterLayer is added to the map, the related data is draped over the basemap and any existing layers or, if applicable, used as a terrain elevation source in 3D. The layer must be in a connected state before data can be displayed. There are two ways to connect a layer to data:

1. Instantiate a RasterLayer and connect explicitly.

  • Create a new RasterLayer, populate the DataSourceProperties property and call RasterLayer.Connect()
  • A constructor is also provided to allow you to specify the data source properties when you instantiate a layer. If the properties specified are incorrect the raster layer will remain disconnected but no exception will be thrown; use the ConnectionStatus property to diagnose why a layer could not be connected.
  • In the context of RasterLayer, the DataSourceProperties class encapsulates connection information for three types of data source: raster file, file geodatabase raster and ArcSDE geodatabase raster. There are three parameterized constructors that enable you to instantiate a DataSourceProperties object for each type of data source: a geo-referenced raster file requires only a path to the file, a file geodatabase requires a path to the geodatabase and the raster name, and an ArcSDE geodatabase requires an ArcSDEConnectionProperties and a raster name.

2. Instantiate and connect with a single method call.

  • Use the static methods prefixed with "Open" to both instantiate a RasterLayer and connect to its underlying data source with a single method call.
  • There are four static methods that are named according to the type of data source you are referencing: OpenArcSDERaster, OpenFileGeodatabaseRaster, OpenFromRaster, OpenRasterFile.
  • The parameters for each method indicate the connection information required when connecting to the type of data source, for example the OpenArcSDERaster method requires connection properties for an ArcSDE geodatabase and a raster name.
  • If successful the Open methods return a connected RasterLayer object. In contrast to the Connect method, an exception will be thrown if the connection parameters specified are incorrect. Therefore it is a good idea to wrap a call to the Open method with a try... catch block if you are unsure of the data source to which you are connecting.
  • The connection information you specify will be stored in the RasterLayer.DataSourceProperties property; the DataSourceProperties class encapsulates connection information for the data source types: raster file, file geodatabase raster and ArcSDE geodatabase raster.

If a RasterLayer is added to the map in an unconnected state, no data will be displayed. The layer will still appear in the ArcGIS Explorer contents window with an exclamation mark to indicate the layer is not connected.

Once connected, you can access data dependent properties such as the geographical extent of the layer. It is also possible to retrieve the underlying data for the RasterLayer using the Raster property.

Inheritance Hierarchy

System..::.Object

  ESRI.ArcGISExplorer.Mapping..::.MapItem

    ESRI.ArcGISExplorer.Mapping..::.Layer

      ESRI.ArcGISExplorer.Mapping..::.RasterLayer

See Also