Select to view content in your preferred language

TopoToRaster Tool Execute problem in ArcGIS

1903
0
02-03-2016 08:43 PM
MonirRahman
Deactivated User

I am trying to execute TopoToRaster tool (ArcToolbox>3D Aanalyst Tool>Raster Interpolation>Topo To Raster) in arcGis 10.0 with .NET.

TopoToRaster Class Members

But get exceptions. My code is here :

private ESRI.ArcGIS.Analyst3DTools.TopoToRaster InitTool(out object beginningEnvironmentValue)
  
{
  _gp
= new Geoprocessor { OverwriteOutput = true, AddOutputsToMap = false };

  beginningEnvironmentValue
= _gp.GetEnvironmentValue("workspace");

  _gp
.SetEnvironmentValue("workspace", _workspace.PathName);
  _gp
.SetEnvironmentValue("scratchWorkspace", _workspace.PathName);

  var topoToRaster
= new ESRI.ArcGIS.Analyst3DTools.TopoToRaster
  
{
  in_topo_features
= _inputFeature,//new InputFeatureTopoToRaster() { FeatureLayer = _inputFeature.ToString(), Field = "HGL", Type = "CONTOUR" },
  out_surface_raster
= _outputRaster
  
};
  
return topoToRaster;
  
}

private readonly object _inputFeature;
  private readonly string _outputRaster
;

public class InputFeatureTopoToRaster
{
  public string
FeatureLayer { get; set; }
  public string
Field { get; set; }
  public string
Type { get; set; }
}

_inputFeature: is the input feature class path.

what is the problem of my input?? I have also tried with class of InputFeature

thanks..

Tags (2)
0 Kudos
0 Replies