如何以编程方式访问 ArcGIS 3D Analyst 工具栏的“3D 要素”命令?

发布于 2024-08-16 01:18:35 字数 472 浏览 3 评论 0原文

我需要获取 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

春夜浅 2024-08-23 01:18:35

好的。我想通了。我正在记下我在这里所做的概述,以防其他人遇到同样的问题。

关键方法是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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文