ArcObjects Library Reference (SpatialAnalyst)  

IConditionalOp.Con Method

Performs a conditional if/else evaluation.

[Visual Basic .NET]
Public Function Con ( _
    ByVal conditionalRaster As IGeoDataset, _
    ByVal trueRaster As IGeoDataset, _
    [ByRef falseRaster As Object] _
) As IGeoDataset
[C#]
public IGeoDataset Con (
    IGeoDataset conditionalRaster,
    IGeoDataset trueRaster,
    ref object falseRaster
);
[C#]

Optional Values

falseRaster   To indicate that this parameter is undefined, first define a variable object Missing = Type.Missing; then pass this in as ref Missing.
[C++]
HRESULT Con(
  IGeoDataset* conditionalRaster,
  IGeoDataset* trueRaster,
  VARIANT* falseRaster,
  IGeoDataset** Con
);
[C++]

Parameters

conditionalRaster [in]

  conditionalRaster is a parameter of type IGeoDataset

trueRaster [in]

  trueRaster is a parameter of type IGeoDataset

falseRaster [optional]   falseRaster is a parameter of type VARIANT

  To indicate this parameter is undefined pass a reference to a VARIANT with type VT_ERROR and scode value of DISP_E_PARAMNOTFOUND.

Con [out, retval]

  Con is a parameter of type IGeoDataset

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server. Requires Spatial Analyst Extension.

Remarks

conditionalRaster an input Raster, RasterDataset, RasterBand, or RasterDescriptor. The values should be comprised of “1”’s and “0”’s with a “1” representing True condition and a “0” a False condition
trueRaster the value that will be used as the output value if the conditionalRaster is True
[falseRaster] the value that will be used as the output value if the conditionalRaster is False. If no falseRaster is specified, all False values (“0”’s) in the conditionalRaster will be assigned NoData

 

See Also

IConditionalOp Interface

.NET Snippets

Create ConditionalOp Con Raster |