ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

LandXML To TIN

Available with 3D Analyst license.

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

This tool imports one or more triangulated irregular network (TIN) surfaces from a LandXML file to output Esri TINs.

Usage

  • When the LandXML file is selected, the TINs to Import parameter is populated with all the TIN surfaces found in the LandXML file. A constrained Delaunay TIN from the LandXML file is created as a constrained Delaunay TIN.

  • When scripting, the names inside the tinnames parameter can be specified in short form (only number or only name) for convenience. Instead of "1. Site0445; 2. <unnamed>; 3. <unnamed>; 4. Site_09" , you can specify "1;2;3;4" or "Site0445; Site_09;2;3". The <unnamed> keyword cannot be used by itself because the TIN must be uniquely identified.

Syntax

arcpy.ddd.LandXMLToTin(in_landxml_path, out_tin_folder, tin_basename, {tinnames})
ParameterExplanationData Type
in_landxml_path

The input LandXML file.

File
out_tin_folder

The folder that the output TINs will be created in.

Folder
tin_basename

The basename of the resulting TIN. When several TINs will be exported from the LandXML file, the basename is used to define a unique name for each output TIN. If <basename> already exists, the tool will not write anything. If <basename> does not exist but <basename>2 exists, the tool will create <basename> and <basename>2_1, instead of <basename>2.

String
tinnames
[name,...]
(Optional)

The one or more LandXML TIN surfaces that will be exported to an Esri TIN. Each LandXML TIN can be specified by its name or its index position in the LandXML file, where the number 1 represents the first TIN, 2 identifies the second, and so on.

String

Derived Output

NameExplanationData Type
derived_tin_folder

The folder containing the output TINs.

Folder

Code sample

LandXMLToTin example 1 (Python window)

The following sample demonstrates the use of this tool in the Python window.

import arcpy
from arcpy import env

arcpy.CheckOutExtension("3D")
env.workspace = "C:/data"
arcpy.LandXMLToTin_3d("surfaces.xml", "TINs", "_", "1;2")
LandXMLToTin example 2 (stand-alone script)

The following sample demonstrates the use of this tool in a stand-alone Python script.

'''****************************************************************************
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)

Environments

  • Scratch Workspace
  • Current Workspace
  • Version

Licensing information

  • Basic: Requires 3D Analyst
  • Standard: Requires 3D Analyst
  • Advanced: Requires 3D Analyst

Related topics

  • An overview of the Conversion toolset
  • Fundamentals of geoprocessing with the ArcGIS 3D Analyst extension
  • Surface formats

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal