如何以编程方式访问 ArcGIS 3D Analyst 工具栏的“3D 要素”命令?
我需要获取 ArcGIS 接受的“.shp”格式的 2D 形状文件,并添加栅格 DEM 提供的 3D 信息。我正在寻找如何使用 ArcObjects API 执行此操作。我想用 C# 来实现,但任何 .NET 语言的示例都会受到欢迎。我唯一能找到的是如何在 ArcGIS 桌面应用程序之一中手动执行此操作的描述。喜欢这篇有用的 HowTo 文章,或者本教程第 22 页上有精彩的全彩插图。这很棒,但我需要在自动化操作链中使用此功能。我不想中间有手动步骤。
I need to take a 2D shape file in the ".shp" format that ArcGIS accepts, and add 3D information supplied by a raster DEM. I'm looking for how to do this with the ArcObjects API. I'd like to do it in C#, but examples in any .NET language would be welcome. The only thing I've been able to find are descriptions of how to do this manually in one of the ArcGIS desktop apps. Like this helpful HowTo article, or the wonderful full color illustrations on page 22 of this tutorial. That's great and all, but I need to use this feature in the middle of an automated chain of operations. I don't want to have a manual step in the middle.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好的。我想通了。我正在记下我在这里所做的概述,以防其他人遇到同样的问题。
关键方法是ISurface.InterpolateShape。它将复制现有的 2D IGeometry 并从表面(栅格或 TIN)向其添加 3D 信息。我将 此示例 VB6 代码从 VB6 翻译为 C# ,并将其修改为对输入形状中每个复制的 IGeometry 调用 InterpolateShape FeatureClass,然后将其插入到输出要素类中。
我不会在这里发布任何代码,因为我用公司的钱开发了它,但这应该足以快速地弄清楚它。希望这能帮助其他陷入困境的开发人员更快地解决问题。
OK. I figured it out. I'm jotting down an outline of what I did here in case anyone else runs into the same problem.
The key method is ISurface.InterpolateShape. It will copy an existing 2D IGeometry and add 3D information to it from a surface (raster or TIN). I translated this example VB6 code from VB6 to C#, and modified it to call InterpolateShape for each copied IGeometry in the input shape FeatureClass before inserting it into the output FeatureClass.
I won't post any of the code here because I developed it on my company's dime, but this should be enough to figure it out reasonably quickly. Hopefully this will help some other struggling developer get through the problem more quickly.