Select to view content in your preferred language

Bug with TIN properties (arcpy) ?

576
2
07-26-2013 04:29 AM
BenjaminKulling
Deactivated User
Hello everyone,

I'm stuck with an annoying error, when I try to make use of TIN properties in the Python window in ArcCatalog, I have the following message:

AttributeError: DescribeData spatialReference method does not exist


(The original output is in french, the actual english version may differ)

Here is the very simple code I use:

import arcpy
from arcpy import env
env.workspace = "C:/temp/"
tin = "C:/temp/test"
SR = arcpy.Describe(tin).spatialReference


Does anyone see an obvious mistake here? I'm VERY new to python scripting in ArcGIS 🙂

In ArcGIS 10.1 Help (http://resources.arcgis.com/en/help/main/10.1/index.html#//018v0000000r000000) there is the following statement :

The Describe function returns the following properties for TINs. Dataset Properties are also supported.
A TIN returns a dataType of "Tin".


I'm running ArcGIS Desktop Basic 10.1 (SP1) on Windows 7 Pro 64-bit ; and I've manually added C:\Python27\ArcGIS10.1 in PATH.

Best regards
Tags (2)
0 Kudos
2 Replies
RhettZufelt
MVP Notable Contributor
No mistake, you are correct.  there is a bug in the describe function (on version 10.0, 10.1 and 10.2)  Hopefully they will address it.

Here is the tech support info if it helps:

[#NIM088547  Using the describe properties to pull the spatial reference on a TIN fails with AttributeError: DescribeData: Method SpatialReference does not exist.]

I added this incident to the list of affected users. In the bug report, I also added the properties extent, MExtent, and ZExtent to the list of unsupported dataset properties for TINs.

For a work-around, this is cumbersome, but you could create a new shapefile or feature class, setting the spatial reference to that of the TIN, then query the spatial reference properties of the new shapefile. For instance:

relPath = os.path.dirname (sys.argv[0]) # script path tin = os.path.join (relPath, "lido_TIN") arcpy.CreateFeatureclass_management (relPath, "abc.shp", "POINT", spatial_reference = tin) shp = os.path.join (relPath, "abc.shp") desc = arcpy.Describe (shp) arcpy.AddMessage ("spatialReference: " + str (desc.spatialReference.name)) arcpy.Delete_management (shp)


R_
0 Kudos
BenjaminKulling
Deactivated User
Thank you so much for your answer ! I searched for hours...
0 Kudos