AnsweredAssumed Answered

How to use Raster Calculator In VB .net Arcobject??

Question asked by rjsgnl29 on Sep 22, 2014
Latest reply on Sep 24, 2014 by rjsgnl29

Hello..

 

I want to use raster calculator in ArcObject.

 

This is my code..

 

    Dim expression As String = "'" & bef_tif(0).FullName & "' + '" & aft_tif(0).FullName & "'"
        Dim outputpath As String = Application.StartupPath & "\ChangeDetection\abc"

        Dim geoprocessor As GeoProcessor = New GeoProcessor()
        Dim ToolRasterCalc As SpatialAnalystTools.RasterCalculator = New SpatialAnalystTools.RasterCalculator(expression, outputpath)
        geoprocessor.OverwriteOutput = True
        geoprocessor.AddOutputsToMap = True

        Dim pParamarray As IVariantArray = New VarArrayClass()
        pParamarray.Add(expression)
        pParamarray.Add(outputpath)
        Dim result As IGeoProcessorResult = geoprocessor.Execute("raster_calculator", pParamarray, Nothing)

 

Error messege is HRESULT E_FAIL, Error code is -2147467259..

 

Plz help me ....

Outcomes