AttributeError: DescribeData spatialReference method does not exist
import arcpy from arcpy import env env.workspace = "C:/temp/" tin = "C:/temp/test" SR = arcpy.Describe(tin).spatialReference
The Describe function returns the following properties for TINs. Dataset Properties are also supported.A TIN returns a dataType of "Tin".
[#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)
Přihlášení členové mohou přispívat, sledovat aktualizace a další. Jste tu noví? Zaregistrujte si bezplatný účet.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.