Class RasterClass

Namespace
ESRI.ArcGIS.DatasourcesRaster
Assembly
ESRI.Server.DatasourcesRaster.dll
[ClassInterface(ClassInterfaceType.None)]
[Guid("C0A039BA-5329-11D2-AAAD-00C04FA375FB")]
public class RasterClass : Raster, IRaster, IRaster2, IRasterEdit, IRasterProps, IGeoDataset, IRasterBandCollection, IRasterDefaultProps, IRasterAnalysisProps, ISupportErrorInfo, ISaveAs2, ISaveAs, IClone, IPixelOperation, IRawBlocks, IRasterResamplingControl
Inheritance
RasterClass
Implements
Inherited Members

Constructors

RasterClass()

public RasterClass()

Explicit Interface Implementations

Add(IRasterBand, int)

Adds a RasterBand to the band collection.

virtual void Add(IRasterBand Element, int Index)

Parameters

Element IRasterBand
Index int

Remarks

This method is only applicable to work with a Raster, not with a RasterDataset.

AnalysisExtent

The analysis extent of the raster.

virtual IEnvelope AnalysisExtent { get; set; }

Returns

IEnvelope

AppendBand(IRasterBand)

Appends a RasterBand to the band collection.

virtual void AppendBand(IRasterBand Element)

Parameters

Element IRasterBand

Remarks

This method is only applicable to work with a Raster, not with a RasterDataset.

AppendBands(IRasterBandCollection)

Appends a collection of RasterBands to the band collection.

virtual void AppendBands(IRasterBandCollection Bands)

Parameters

Bands IRasterBandCollection

Remarks

This method is only applicable to work with a Raster, not with a RasterDataset.

Assign(IClone)

Assigns the properties of src to the receiver.

virtual void Assign(IClone src)

Parameters

src IClone

AttributeTable

The raster value attribute table.

virtual ITable AttributeTable { get; set; }

Returns

ITable

BandByName[string]

A RasterBand given its name.

virtual IRasterBand BandByName[string Name] { get; }

Parameters

Name string

Returns

IRasterBand

BandIndex[string]

The index of a RasterBand given its name.

virtual int BandIndex[string Name] { get; }

Parameters

Name string

Returns

int

Bands

All the bands in the collection as an interface to the RasterBands enumerator object.

virtual IEnumRasterBand Bands { get; }

Returns

IEnumRasterBand

CanEdit()

Checks if this Raster can be edited.

virtual bool CanEdit()

Returns

bool

CanSaveAs(string)

Checks if it's can be saved as a new persistent Dataset of a given format.

virtual bool CanSaveAs(string Format)

Parameters

Format string

Returns

bool

Clear()

Removes all the elements in the collection.

virtual void Clear()

Remarks

This method is only applicable to work with a Raster, not with a RasterDataset.

Clone()

Clones the receiver and assigns the result to *clone.

virtual IClone Clone()

Returns

IClone

Colormap

The colormap.

virtual IRasterColormap Colormap { get; set; }

Returns

IRasterColormap

Count

The number of bands in the collection.

virtual int Count { get; }

Returns

int

CreateCursor()

Allocates a Raster Cursor for fast raster scanning.

virtual IRasterCursor CreateCursor()

Returns

IRasterCursor

CreateCursorEx(IPnt)

Creates a cursor with a given pixel block size or native block size.

virtual IRasterCursor CreateCursorEx(IPnt pBlockSize)

Parameters

pBlockSize IPnt

Returns

IRasterCursor

CreatePixelBlock()

Create a compatible pixel block.

virtual IPixelBlock CreatePixelBlock()

Returns

IPixelBlock

CreatePixelBlock(IPnt)

Allocates a PixelBlock of requested size.

virtual IPixelBlock CreatePixelBlock(IPnt Size)

Parameters

Size IPnt

Returns

IPixelBlock

Remarks

CreatePixelBlock method only initializes the properties of a pixel block, such as dimension, pixel type etc. Read method of this interface should be used to read pixels into the pixel block.

DefaultIntersectExtent

The default intersect extent.

virtual IEnvelope DefaultIntersectExtent { get; }

Returns

IEnvelope

DefaultPixelHeight

The default pixel size in Y.

virtual double DefaultPixelHeight { get; }

Returns

double

DefaultPixelWidth

The default pixel size in X.

virtual double DefaultPixelWidth { get; }

Returns

double

DefaultSpatialReference

The default spatial reference.

virtual ISpatialReference DefaultSpatialReference { get; }

Returns

ISpatialReference

DefaultUnionExtent

The default union extent.

virtual IEnvelope DefaultUnionExtent { get; }

Returns

IEnvelope

Erase(IPnt, IPixelBlock)

Erases a PixelBlock starting at a given Top-Left corner.

virtual void Erase(IPnt pTlc, IPixelBlock pPixelBlock)

Parameters

pTlc IPnt
pPixelBlock IPixelBlock

Extent

The extent of the Raster.

virtual IEnvelope Extent { get; set; }

Returns

IEnvelope

Flush()

Flushes buffered data.

virtual void Flush()

GeoTransformations

The set of geographic transformations to be applied.

virtual IGeoTransformationOperationSet GeoTransformations { get; set; }

Returns

IGeoTransformationOperationSet

GeodataXform

The geodata transform.

virtual IGeodataXform GeodataXform { get; set; }

Returns

IGeodataXform

Remarks

After you set a GeodataXform on a Raster and perform SaveAs, you must also set the extent, width and height of the raster in the space after the transformation.

GetPixelValue(int, int, int)

Gets the pixel value for a given band at a given column and row.

virtual object GetPixelValue(int iBand, int iColumn, int iRow)

Parameters

iBand int
iColumn int
iRow int

Returns

object

Height

Height in pixels.

virtual int Height { get; set; }

Returns

int

IGeoDataset_Extent

The extent of the GeoDataset.

virtual IEnvelope IGeoDataset_Extent { get; }

Returns

IEnvelope

Remarks

The IGeoDataset::Extent property returns an envelope representing the maximum extent of data which has been stored in the dataset.

Consider the following scenario. A new feature class has features added to it. The IGeoDataset::Extent is then requested and an envelope is returned. The extents of the envelope returned are represented by the red box in the image below.

The red box represents the IGeoDataset extent

If a portion of the features were then deleted and the extent is again requested an envelope with the exact same extents as during the first request would be returned (see image below). This is because the deletion of features does not shrink the extent. However all additions of features outside the red box would increase the envelope returned to encompass the newly added features.

The red box represents the IGeoDataset extent after some of the features have been deleted

If you would like to update the IGeoDataset::Extent property to reflect the current features in your dataset please see IFeatureClassManage::UpdateExtent (also see IFeatureClassLoad). In the image below the extent has been updated and a new envelope is being returned.

The red box represents the IGeoDataset extent after it has been updated

ESRI's GroupLayer implements this property differently from most other layer coclasses. When you instantiate a new GroupLayer, this property will return a valid envelope with zero height and width. With most other newly instantiated layers (for example FeatureLayer, RasterLayer, TinLayer), this property initally returns Nothing.

 

IGeoDataset_SpatialReference

The spatial reference of the GeoDataset.

virtual ISpatialReference IGeoDataset_SpatialReference { get; }

Returns

ISpatialReference

Remarks

This property is read only. For layers, when the first layer is added to ArcMap, its spatial reference is read by this property, and the map is set to this spatial reference.

Instances of the esriCarto.GroupLayer class will return null for this property, as a group layer can contain multiple datasets with different spatial references.

Modifications to a spatial reference returned by this property will not be persisted. To modify the spatial reference of a dataset, the IGeoDatasetSchemaEdit and IGeoDatasetSchemaEdit2 interfaces should be used.

IRasterAnalysisProps_RasterDataset

The RasterDataset, if there is one.

virtual IRasterDataset IRasterAnalysisProps_RasterDataset { get; }

Returns

IRasterDataset

Remarks

<P>The <STRONG>RasterDataset</STRONG> object represents a dataset on disk or in a database. It is composed of one or more persistent raster bands. The dataset provides access only to operations that apply to the entire dataset, with the <STRONG>RasterBand</STRONG> providing access to operations that occur on individual bands.</P> <P>The RasterDataset object performs basic dataset management functions, such as copy, rename, and delete. It can also instantiat RasterBand and <STRONG>Raster</STRONG> objects representing other aspects of the data. It can be used to examine dataset properties including different format, extent, spatial reference, and number of bands.</P> <P>The spatial reference of the raster raster dataset can be changed through interface <STRONG>IGeoDatasetSchemaEdit</STRONG>, but it does not project the dataset, only changes the coordinate system associated with the dataset.<BR>The pyramid of the raster dataset can be built or rebuilt to improve display performance for large raster datasets.</P>

ISaveAs2_CanSaveAs(string)

virtual bool ISaveAs2_CanSaveAs(string Format)

Parameters

Format string

Returns

bool

ISaveAs2_SaveAs(string, IWorkspace, string)

virtual IDataset ISaveAs2_SaveAs(string Name, IWorkspace Workspace, string Format)

Parameters

Name string
Workspace IWorkspace
Format string

Returns

IDataset

ISaveAs_SaveAs(string, IWorkspace, string)

Creates a new persistent Dataset of a given format.

virtual IDataset ISaveAs_SaveAs(string Name, IWorkspace Workspace, string Format)

Parameters

Name string
Workspace IWorkspace
Format string

Returns

IDataset

Remarks

The format strings used for the supported formats are below, and they are case sensitive:

Format Name String Used
Imagine "IMAGINE Image"
TIFF "TIFF"
GRID "GRID"
JPEG "JPG"
JP2000 "JP2"
BMP "BMP"
PNG "PNG"
GIF "GIF"
PCI Raster "PIX"
X11 Pixmap "XPM"
PCRaster "MAP"
Memory Raster "MEM"
HDF4 "HDF4"
BIL "BIL"
BIP "BIP"
BSQ "BSQ"
Idrisi Raster Format "RST"
ENVI Raster Format "ENVI"
Geodatabase Raster "GDB"
 

 

 

Note, SaveAs will return a RasterDataset, to prevent from ISaveAs holding the output, .NET ReleaseCOMObject needs to be called to release the referene to the output raster dataset:

    System.Runtime.InteropServices.Marshal.ReleaseComObject(outRasterDS);

 

InterfaceSupportsErrorInfo(ref Guid)

virtual void InterfaceSupportsErrorInfo(ref Guid riid)

Parameters

riid Guid

IsEqual(IClone)

Indicates if the receiver and other have the same properties.

virtual bool IsEqual(IClone other)

Parameters

other IClone

Returns

bool

IsIdentical(IClone)

Indicates if the receiver and other are the same object.

virtual bool IsIdentical(IClone other)

Parameters

other IClone

Returns

bool

IsInteger

Indicates if the data is integer.

virtual bool IsInteger { get; }

Returns

bool

Item(int)

Returns a RasterBand given its index.

virtual IRasterBand Item(int BandIndex)

Parameters

BandIndex int

Returns

IRasterBand

MakePermanent()

Makes a temporary raster a permanent raster dataset.

virtual void MakePermanent()

MapModel

Map to raster transformation information.

virtual IRasterMapModel MapModel { get; set; }

Returns

IRasterMapModel

MapToPixel(double, double, out int, out int)

Converts a location (x, y) in map space into pixel space.

virtual void MapToPixel(double x, double y, out int pColumn, out int pRow)

Parameters

x double
y double
pColumn int
pRow int

MeanCellSize()

Returns the approximate cell size of the raster.

virtual IPnt MeanCellSize()

Returns

IPnt

NoDataValue

Data value used to indicate invalid or excluded data.

virtual object NoDataValue { get; set; }

Returns

object

Remarks

Specifying a single NoData value for a multiband raster, the NoData value will apply to each raster band in the raster. To set different NoData value for each band, pass an array, each element in the array sets the NoData value for the corresponding band, to this property.

PixelFilter

The pixel filter for filtering pixel values.

virtual IPixelFilter PixelFilter { get; set; }

Returns

IPixelFilter

PixelHeight

The pixel height in ground resolution.

virtual double PixelHeight { get; set; }

Returns

double

PixelToMap(int, int, out double, out double)

Converts a location (column, row) in pixel space into map space.

virtual void PixelToMap(int iColumn, int iRow, out double pX, out double pY)

Parameters

iColumn int
iRow int
pX double
pY double

PixelType

Data type of the pixels.

virtual rstPixelType PixelType { get; set; }

Returns

rstPixelType

PixelWidth

The pixel width in ground resolution.

virtual double PixelWidth { get; set; }

Returns

double

RasterDataset

The parent raster dataset.

virtual IRasterDataset RasterDataset { get; }

Returns

IRasterDataset

Remarks

<P>The <STRONG>RasterDataset</STRONG> object represents a dataset on disk or in a database. It is composed of one or more persistent raster bands. The dataset provides access only to operations that apply to the entire dataset, with the <STRONG>RasterBand</STRONG> providing access to operations that occur on individual bands.</P> <P>The RasterDataset object performs basic dataset management functions, such as copy, rename, and delete. It can also instantiat RasterBand and <STRONG>Raster</STRONG> objects representing other aspects of the data. It can be used to examine dataset properties including different format, extent, spatial reference, and number of bands.</P> <P>The spatial reference of the raster raster dataset can be changed through interface <STRONG>IGeoDatasetSchemaEdit</STRONG>, but it does not project the dataset, only changes the coordinate system associated with the dataset.<BR>The pyramid of the raster dataset can be built or rebuilt to improve display performance for large raster datasets.</P>

RasterInfo

The raster information.

virtual IRasterInfo RasterInfo { get; }

Returns

IRasterInfo

RasterXformer

The raster transformer.

virtual IRasterXformer RasterXformer { get; }

Returns

IRasterXformer

Read(IPnt, IPixelBlock)

Read a block of pixels starting from the top left corner.

virtual void Read(IPnt tlc, IPixelBlock block)

Parameters

tlc IPnt
block IPixelBlock

ReadBlock(int, int, int, IPixelBlock)

Reads a raw pixel block.

virtual void ReadBlock(int tx, int ty, int Level, IPixelBlock pPixelBlock)

Parameters

tx int
ty int
Level int
pPixelBlock IPixelBlock

Refresh()

Refreshes the associated RasterDataset.

virtual void Refresh()

Remove(int)

Removes an element from the collection.

virtual void Remove(int Index)

Parameters

Index int

Remarks

This method is only applicable to work with a Raster, not with a RasterDataset.

ResampleMethod

Interpolation method used when reading pixels.

virtual rstResamplingTypes ResampleMethod { get; set; }

Returns

rstResamplingTypes

ResamplingHint

The raster resampling hint.

virtual esriRasterResamplingHint ResamplingHint { get; set; }

Returns

esriRasterResamplingHint

ResetToDefault()

Resets the raster to default state

virtual void ResetToDefault()

SaveAs(string, IWorkspace, string)

Creates a new persistent RasterDataset with the bands in the collection.

virtual IDataset SaveAs(string new_name, IWorkspace worksp, string Format)

Parameters

new_name string
worksp IWorkspace
Format string

Returns

IDataset

Remarks

The SaveAs method can create a raster dataset in Imagine, TIFF, GRID, JPEG2000, JPEG, BMP, GIF, PNG, PCI Raster, USGS ASCII DEM, X11 Pixmap, Memory Raster and geodatabase raster.

The format strings used for the supported formats are below, and they are case sensitive:

Format Name String Used
Imagine "IMAGINE Image"
TIFF "TIFF"
GRID "GRID"
JPEG "JPG"
JP2000 "JP2"
BMP "BMP"
PNG "PNG"
GIF "GIF"
PCI Raster "PIX"
X11 Pixmap "XPM"
PCRaster "MAP"
Memory Raster "MEM"
HDF4 "HDF4"
BIL "BIL"
BIP "BIP"
BSQ "BSQ"
Idrisi Raster Format "RST"
ENVI Raster Format "ENVI"
Geodatabase Raster "GDB"
 

The format string "TIFF" creates a TIFF file with ".tif" extension. ArcGIS also supports TIFF format with ".tiff" and ".tff" extensions. A format string "TIF" creates a  TIFF file with ".tiff" extention and a format string "TFF" creates a TIFF file with ".tff" extension.

 

 

Note, SaveAs will return a RasterDataset, to prevent from SaveAs holding the output, .NET ReleaseCOMObject needs to be called to release the referene to the output raster dataset:

    System.Runtime.InteropServices.Marshal.ReleaseComObject(outRasterDS);

SaveAsRasterDataset(string, IWorkspace, string, IRasterStorageDef)

Creates a new persistent Raster Dataset of a given format and specified storage definition.

virtual IRasterDataset SaveAsRasterDataset(string Name, IWorkspace Workspace, string Format, IRasterStorageDef StorageDef)

Parameters

Name string
Workspace IWorkspace
Format string
StorageDef IRasterStorageDef

Returns

IRasterDataset

SpatialReference

SpatialReference of the Raster.

virtual ISpatialReference SpatialReference { get; set; }

Returns

ISpatialReference

ToMapX(int)

Maps a pixel column to the x coordinate in map space.

virtual double ToMapX(int iColumn)

Parameters

iColumn int

Returns

double

ToMapY(int)

Maps a pixel row to the y coordinate in map space.

virtual double ToMapY(int iRow)

Parameters

iRow int

Returns

double

ToPixelColumn(double)

Maps a x coordinate in map space to the pixel column.

virtual int ToPixelColumn(double x)

Parameters

x double

Returns

int

ToPixelRow(double)

Maps a y coordinate in map space to the pixel row.

virtual int ToPixelRow(double y)

Parameters

y double

Returns

int

Width

Width in pixels.

virtual int Width { get; set; }

Returns

int

Write(IPnt, IPixelBlock)

Writes a PixelBlock starting at a given Top-Left corner.

virtual void Write(IPnt pTlc, IPixelBlock pPixelBlock)

Parameters

pTlc IPnt
pPixelBlock IPixelBlock

WriteBlock(int, int, int, IPixelBlock)

Writes a raw pixel block.

virtual void WriteBlock(int tx, int ty, int Level, IPixelBlock pPixelBlock)

Parameters

tx int
ty int
Level int
pPixelBlock IPixelBlock