ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS for Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

LandXML 转 TIN

需要 3D Analyst 许可。

  • 描述
  • 使用
  • 语法
  • 代码示例
  • 环境
  • 许可信息

描述

此工具将一个或多个不规则三角网 (TIN) 表面从 LandXML 文件导入到输出 Esri TIN。

使用

  • 选中输入 LandXML 文件时,“要导入的 TIN”参数将填入 LandXML 文件中的所有 TIN 表面。LandXML 文件中的约束型 Delaunay TIN 将创建为约束型 Delaunay TIN。

  • 编写脚本时,为方便使用,将采用简短形式(仅编号或仅名称)来指定 tinnames 参数内部的名称。不使用 "1. Site0445; 2. <unnamed>; 3. <unnamed>; 4. Site_09",您可指定 "1;2;3;4" 或 "Site0445; Site_09;2;3"。<unnamed> 关键字无法供其自身使用,因为 TIN 必须进行唯一标识。

语法

LandXMLToTin(in_landxml_path, out_tin_folder, tin_basename, {tinnames})
参数说明数据类型
in_landxml_path

输入 LandXML 文件。

File
out_tin_folder

将要在其中创建输出 TIN 的文件夹。

Folder
tin_basename

生成的 TIN 的 basename。要从 LandXML 文件中导出多个 TIN 时,basename 用于为各个输出 TIN 定义唯一名称。如果已存在 <basename>,该工具将不会写入任何内容。如果 <basename> 不存在,但 <basename>2 存在,则工具将创建 <basename> 和 <basename>2_1,而不会创建 <basename>2。

String
tinnames
[name,...]
(可选)

一个或多个 LandXML TIN 表面将导出至一个 Esri TIN 中。可以按照名称或其在 LandXML 文件中的索引位置来指定各个 LandXML TIN,其中数字 1 表示第一个 TIN,2 表示第二个,以此类推。

String

派生输出

名称说明数据类型
derived_tin_folder

包含输出 TIN 的文件夹。

文件夹

代码示例

LandXMLToTin 示例 1(Python 窗口)

下面的示例演示了如何在 Python 窗口中使用此工具。

import arcpy
from arcpy import env

arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.LandXMLToTin_3d("surfaces.xml", "TINs", "_", "1;2")
LandXMLToTin 示例 2(独立脚本)

下面的示例演示了如何在独立 Python 脚本中使用此工具。

'''****************************************************************************
Name: LandXMLToTin Example
Description: This script demonstrates how to use the 
             ListFiles method to collect all LandXML (*.xml) files in a 
             workspace as input for the Import3DFiles tool.
****************************************************************************'''
# Import system modules
import arcpy
from arcpy import env
import exceptions, sys, traceback

try:
    # Obtain a license for the ArcGIS 3D Analyst extension
    arcpy.CheckOutExtension("3D")
    # Set environment settings
    env.workspace = "C:/data"
    # Use ListFiles method to grab all xml files (assumedly LandXML files)
    landList = arcpy.ListFiles("*.xml")
    if landList:
        for landFile in landList:
            # Set Local Variables
            outputFolder = "TINs" # The folder that the TINs will be created in
            outputBase = "Madagascar_" # Base name will be applied to all output TINs
            grab = "1" # TIN selection can be chosen by enumerated values (e.g. 1;2)
            # Execute Import3DFiles
            arcpy.LandXMLToTin_3d(landFile, outputFolder, outputBase, grab)
            print "Completed creating TIN(s) from {0}.".format(landFile)
    else:
        "There are no xml files in {0}.".format(env.workspace)

except arcpy.ExecuteError:
    print arcpy.GetMessages()
except:
    # Get the traceback object
    tb = sys.exc_info()[2]
    tbinfo = traceback.format_tb(tb)[0]
    # Concatenate error information into message string
    pymsg = 'PYTHON ERRORS:\nTraceback info:\n{0}\nError Info:\n{1}'\
          .format(tbinfo, str(sys.exc_info()[1]))
    msgs = 'ArcPy ERRORS:\n {0}\n'.format(arcpy.GetMessages(2))
    # Return python error messages for script tool or Python Window
    arcpy.AddError(pymsg)
    arcpy.AddError(msgs)

环境

  • 临时工作空间
  • 当前工作空间
  • Version

许可信息

  • Basic: 需要 3D Analyst
  • Standard: 需要 3D Analyst
  • Advanced: 需要 3D Analyst

相关主题

  • 转换工具集概述
  • 有关使用 ArcGIS 3D Analyst 扩展模块进行地理处理的基础知识
  • 表面格式

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS 平台

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2019 Esri. | 隐私政策 | 法律声明