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
ElementIRasterBandIndexint
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
AppendBand(IRasterBand)
Appends a RasterBand to the band collection.
virtual void AppendBand(IRasterBand Element)
Parameters
ElementIRasterBand
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
BandsIRasterBandCollection
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
srcIClone
AttributeTable
The raster value attribute table.
virtual ITable AttributeTable { get; set; }
Returns
BandByName[string]
A RasterBand given its name.
virtual IRasterBand BandByName[string Name] { get; }
Parameters
Namestring
Returns
BandIndex[string]
The index of a RasterBand given its name.
virtual int BandIndex[string Name] { get; }
Parameters
Namestring
Returns
Bands
All the bands in the collection as an interface to the RasterBands enumerator object.
virtual IEnumRasterBand Bands { get; }
Returns
CanEdit()
Checks if this Raster can be edited.
virtual bool CanEdit()
Returns
CanSaveAs(string)
Checks if it's can be saved as a new persistent Dataset of a given format.
virtual bool CanSaveAs(string Format)
Parameters
Formatstring
Returns
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
Colormap
The colormap.
virtual IRasterColormap Colormap { get; set; }
Returns
Count
The number of bands in the collection.
virtual int Count { get; }
Returns
CreateCursor()
Allocates a Raster Cursor for fast raster scanning.
virtual IRasterCursor CreateCursor()
Returns
CreateCursorEx(IPnt)
Creates a cursor with a given pixel block size or native block size.
virtual IRasterCursor CreateCursorEx(IPnt pBlockSize)
Parameters
pBlockSizeIPnt
Returns
CreatePixelBlock()
Create a compatible pixel block.
virtual IPixelBlock CreatePixelBlock()
Returns
CreatePixelBlock(IPnt)
Allocates a PixelBlock of requested size.
virtual IPixelBlock CreatePixelBlock(IPnt Size)
Parameters
SizeIPnt
Returns
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
DefaultPixelHeight
The default pixel size in Y.
virtual double DefaultPixelHeight { get; }
Returns
DefaultPixelWidth
The default pixel size in X.
virtual double DefaultPixelWidth { get; }
Returns
DefaultSpatialReference
The default spatial reference.
virtual ISpatialReference DefaultSpatialReference { get; }
Returns
DefaultUnionExtent
The default union extent.
virtual IEnvelope DefaultUnionExtent { get; }
Returns
Erase(IPnt, IPixelBlock)
Erases a PixelBlock starting at a given Top-Left corner.
virtual void Erase(IPnt pTlc, IPixelBlock pPixelBlock)
Parameters
pTlcIPntpPixelBlockIPixelBlock
Extent
The extent of the Raster.
virtual IEnvelope Extent { get; set; }
Returns
Flush()
Flushes buffered data.
virtual void Flush()
GeoTransformations
The set of geographic transformations to be applied.
virtual IGeoTransformationOperationSet GeoTransformations { get; set; }
Returns
GeodataXform
The geodata transform.
virtual IGeodataXform GeodataXform { get; set; }
Returns
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
Returns
Height
Height in pixels.
virtual int Height { get; set; }
Returns
IGeoDataset_Extent
The extent of the GeoDataset.
virtual IEnvelope IGeoDataset_Extent { get; }
Returns
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.

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.

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.

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
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
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
Formatstring
Returns
ISaveAs2_SaveAs(string, IWorkspace, string)
virtual IDataset ISaveAs2_SaveAs(string Name, IWorkspace Workspace, string Format)
Parameters
NamestringWorkspaceIWorkspaceFormatstring
Returns
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
NamestringWorkspaceIWorkspaceFormatstring
Returns
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
riidGuid
IsEqual(IClone)
Indicates if the receiver and other have the same properties.
virtual bool IsEqual(IClone other)
Parameters
otherIClone
Returns
IsIdentical(IClone)
Indicates if the receiver and other are the same object.
virtual bool IsIdentical(IClone other)
Parameters
otherIClone
Returns
IsInteger
Indicates if the data is integer.
virtual bool IsInteger { get; }
Returns
Item(int)
Returns a RasterBand given its index.
virtual IRasterBand Item(int BandIndex)
Parameters
BandIndexint
Returns
MakePermanent()
Makes a temporary raster a permanent raster dataset.
virtual void MakePermanent()
MapModel
Map to raster transformation information.
virtual IRasterMapModel MapModel { get; set; }
Returns
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
MeanCellSize()
Returns the approximate cell size of the raster.
virtual IPnt MeanCellSize()
Returns
NoDataValue
Data value used to indicate invalid or excluded data.
virtual object NoDataValue { get; set; }
Returns
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
PixelHeight
The pixel height in ground resolution.
virtual double PixelHeight { get; set; }
Returns
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
PixelType
Data type of the pixels.
virtual rstPixelType PixelType { get; set; }
Returns
PixelWidth
The pixel width in ground resolution.
virtual double PixelWidth { get; set; }
Returns
RasterDataset
The parent raster dataset.
virtual IRasterDataset RasterDataset { get; }
Returns
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
RasterXformer
The raster transformer.
virtual IRasterXformer RasterXformer { get; }
Returns
Read(IPnt, IPixelBlock)
Read a block of pixels starting from the top left corner.
virtual void Read(IPnt tlc, IPixelBlock block)
Parameters
tlcIPntblockIPixelBlock
ReadBlock(int, int, int, IPixelBlock)
Reads a raw pixel block.
virtual void ReadBlock(int tx, int ty, int Level, IPixelBlock pPixelBlock)
Parameters
txinttyintLevelintpPixelBlockIPixelBlock
Refresh()
Refreshes the associated RasterDataset.
virtual void Refresh()
Remove(int)
Removes an element from the collection.
virtual void Remove(int Index)
Parameters
Indexint
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
ResamplingHint
The raster resampling hint.
virtual esriRasterResamplingHint ResamplingHint { get; set; }
Returns
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_namestringworkspIWorkspaceFormatstring
Returns
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
NamestringWorkspaceIWorkspaceFormatstringStorageDefIRasterStorageDef
Returns
SpatialReference
SpatialReference of the Raster.
virtual ISpatialReference SpatialReference { get; set; }
Returns
ToMapX(int)
Maps a pixel column to the x coordinate in map space.
virtual double ToMapX(int iColumn)
Parameters
iColumnint
Returns
ToMapY(int)
Maps a pixel row to the y coordinate in map space.
virtual double ToMapY(int iRow)
Parameters
iRowint
Returns
ToPixelColumn(double)
Maps a x coordinate in map space to the pixel column.
virtual int ToPixelColumn(double x)
Parameters
xdouble
Returns
ToPixelRow(double)
Maps a y coordinate in map space to the pixel row.
virtual int ToPixelRow(double y)
Parameters
ydouble
Returns
Width
Width in pixels.
virtual int Width { get; set; }
Returns
Write(IPnt, IPixelBlock)
Writes a PixelBlock starting at a given Top-Left corner.
virtual void Write(IPnt pTlc, IPixelBlock pPixelBlock)
Parameters
pTlcIPntpPixelBlockIPixelBlock
WriteBlock(int, int, int, IPixelBlock)
Writes a raw pixel block.
virtual void WriteBlock(int tx, int ty, int Level, IPixelBlock pPixelBlock)
Parameters
txinttyintLevelintpPixelBlockIPixelBlock