环境 vs2010+c#+Arcgis10
代码如下:
IRasterLayer ras = new RasterLayerClass();
Geoprocessor gp = new Geoprocessor();
gp.OverwriteOutput = true;
MakeNetCDFRasterLayer make1 = new MakeNetCDFRasterLayer();
make1.in_netCDF_file = "C:\\Wave.nc";
make1.out_raster_layer ="ras";
make1.x_dimension = "nodes";
make1.y_dimension = "time";
make1.variable = "Dir";
make1.value_selection_method = "BY_VALUE";
// make1.dimension_values = "time"; gp.Execute(make1, null);
调试报错:
未处理 System.Runtime.InteropServices.COMException
Message=对 COM 组件的调用返回了错误 HRESULT E_FAIL。
Source=ESRI.ArcGIS.Geoprocessing
ErrorCode=-2147467259
StackTrace:
在 ESRI.ArcGIS.Geoprocessing.GeoProcessorClass.Execute(String Name, IVariantArray ipValues, ITrackCancel pTrackCancel)
在 ESRI.ArcGIS.Geoprocessor.Geoprocessor.ExecuteInner(IGPProcess process, ITrackCancel trackCancel, IGeoProcessor igp, IVariantArray iva)
在 ESRI.ArcGIS.Geoprocessor.Geoprocessor.Execute(IGPProcess process, ITrackCancel trackCancel)
在 DesktopWindowsApplication1.Form1.图层属性ToolStripMenuItem_Click(Object sender, EventArgs e) 位置 D:\VS_Workspace\DesktopWindowsApplication1\DesktopWindowsApplication1\Form1.cs:行号 78
在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
在 System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.ToolStrip.WndProc(Message& m)
在 System.Windows.Forms.MenuStrip.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.Run(Form mainForm)
在 DesktopWindowsApplication1.Program.Main() 位置 D:\VS_Workspace\DesktopWindowsApplication1\DesktopWindowsApplication1\Program.cs:行号 18
在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException: 试过网上找的方法:
1. 在控制面板--->管理工具--->服务 中,开启Distributed Transaction Coordinator 服务。 2. 打开控制面板--->管理工具--->组件服务--->选择计算机--->我的电脑--->右击属性--->选择MSDTC--->选择安全配置 勾选事务管理器通信中的允许出站、允许入站和不要求进行验证。重启后依然无效,求救各位大神!!!
代码如下:
IRasterLayer ras = new RasterLayerClass();
Geoprocessor gp = new Geoprocessor();
gp.OverwriteOutput = true;
MakeNetCDFRasterLayer make1 = new MakeNetCDFRasterLayer();
make1.in_netCDF_file = "C:\\Wave.nc";
make1.out_raster_layer ="ras";
make1.x_dimension = "nodes";
make1.y_dimension = "time";
make1.variable = "Dir";
make1.value_selection_method = "BY_VALUE";
// make1.dimension_values = "time"; gp.Execute(make1, null);
调试报错:
未处理 System.Runtime.InteropServices.COMException
Message=对 COM 组件的调用返回了错误 HRESULT E_FAIL。
Source=ESRI.ArcGIS.Geoprocessing
ErrorCode=-2147467259
StackTrace:
在 ESRI.ArcGIS.Geoprocessing.GeoProcessorClass.Execute(String Name, IVariantArray ipValues, ITrackCancel pTrackCancel)
在 ESRI.ArcGIS.Geoprocessor.Geoprocessor.ExecuteInner(IGPProcess process, ITrackCancel trackCancel, IGeoProcessor igp, IVariantArray iva)
在 ESRI.ArcGIS.Geoprocessor.Geoprocessor.Execute(IGPProcess process, ITrackCancel trackCancel)
在 DesktopWindowsApplication1.Form1.图层属性ToolStripMenuItem_Click(Object sender, EventArgs e) 位置 D:\VS_Workspace\DesktopWindowsApplication1\DesktopWindowsApplication1\Form1.cs:行号 78
在 System.Windows.Forms.ToolStripItem.RaiseEvent(Object key, EventArgs e)
在 System.Windows.Forms.ToolStripMenuItem.OnClick(EventArgs e)
在 System.Windows.Forms.ToolStripItem.HandleClick(EventArgs e)
在 System.Windows.Forms.ToolStripItem.HandleMouseUp(MouseEventArgs e)
在 System.Windows.Forms.ToolStripItem.FireEventInteractive(EventArgs e, ToolStripItemEventType met)
在 System.Windows.Forms.ToolStripItem.FireEvent(EventArgs e, ToolStripItemEventType met)
在 System.Windows.Forms.ToolStrip.OnMouseUp(MouseEventArgs mea)
在 System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
在 System.Windows.Forms.Control.WndProc(Message& m)
在 System.Windows.Forms.ScrollableControl.WndProc(Message& m)
在 System.Windows.Forms.ToolStrip.WndProc(Message& m)
在 System.Windows.Forms.MenuStrip.WndProc(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
在 System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
在 System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
在 System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
在 System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
在 System.Windows.Forms.Application.Run(Form mainForm)
在 DesktopWindowsApplication1.Program.Main() 位置 D:\VS_Workspace\DesktopWindowsApplication1\DesktopWindowsApplication1\Program.cs:行号 18
在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
在 System.Threading.ThreadHelper.ThreadStart()
InnerException: 试过网上找的方法:
1. 在控制面板--->管理工具--->服务 中,开启Distributed Transaction Coordinator 服务。 2. 打开控制面板--->管理工具--->组件服务--->选择计算机--->我的电脑--->右击属性--->选择MSDTC--->选择安全配置 勾选事务管理器通信中的允许出站、允许入站和不要求进行验证。重启后依然无效,求救各位大神!!!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货