0

I'm trying to create a TIN from contour data. My program will actually create an empty TIN, but it will still give me an error. Below is my code:

import arcpy
arcpy.env.workspace = r"C:\Users\Aliza\Desktop\GIS Programming Fundamentals\Final_Project\Contours"
arcpy.CheckOutExtension("3D")
out_tin = "SampleTinssas"
height_field = "Elevation"
in_features = r"C:\Users\Aliza\Desktop\GIS Programming Fundamentals\Final_Project\Contours\Site_37_Contours.shp"
sr = arcpy.Describe(in_features).spatialReference
arcpy.CreateTin_3d(out_tin, sr, "Site_37_Contours.shp", "DELAUNAY")

arcpy.CheckInExtension("3D")

I know that the in_features portion of the tool is supposed to be in the form of a value table, but I have no clue how to format that. I know that my height needs to be included, but again, I have no idea where to start with that.

Below is my error message:

"C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\python.exe" 
C:/Users/Aliza/PycharmProjects/finaltest.py
Traceback (most recent call last):
 File "C:/Users/Aliza/PycharmProjects/finaltest.py", line 8, in <module>
    arcpy.CreateTin_3d(out_tin, sr, "Site_37_Contours.shp", "DELAUNAY")
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\ddd.py", line 
 2922, in CreateTin
    raise e
  File "C:\Program Files\ArcGIS\Pro\Resources\ArcPy\arcpy\ddd.py", line 
2919, in CreateTin
    retval = 
convertArcObjectToPythonObject(gp.CreateTin_3d(*gp_fixargs((out_tin, 
spatial_reference, in_features, constrained_delaunay), True)))
  File "C:\Program 
Files\ArcGIS\Pro\Resources\ArcPy\arcpy\geoprocessing\_base.py", line 506, in 
<lambda>
   return lambda *args: val(*gp_fixargs(args, True))
arcgisscripting.ExecuteError: ERROR 999999: Error executing function.
Failed to execute (CreateTin).

Process finished with exit code 1

3
  • I'm adding a tag for ArcGIS Pro because your error message indicates you are using that rather than ArcGIS Desktop 10.x.
    – PolyGeo
    Commented Nov 18, 2017 at 2:05
  • 2
    The name of your TIN appears too long, it should be less than 13 characters but is precisely 13 characters... the real problem is that you have a space in your path which is a definite no-no for coverage data (coverage, TIN or GRID). Try making a folder c:\Try_this, make that your workspace and I'm fairly sure you'll find it works. Commented Nov 18, 2017 at 4:47
  • Cross-posted at stackoverflow.com/q/47276370/820534
    – PolyGeo
    Commented Nov 19, 2017 at 21:23

1 Answer 1

1

There may be one or more of several things astray.

@MichaelStimson's comment is definitely worth considering:

The name of your TIN appears too long, it should be less than 13 characters but is precisely 13 characters... the real problem is that you have a space in your path which is a definite no-no for coverage data (coverage, TIN or GRID). Try making a folder c:\Try_this, make that your workspace and I'm fairly sure you'll find it works.

However, since you "know that the in_features portion of the tool is supposed to be in the form of a value table, but [you] have no clue how to format that", I think that you should first try running the tool from its tool dialog once, so that you can use the Geoprocessing | Results window to Copy As Python Snippet to get its correct syntax to paste into your script.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.