working with DEM, if its a TIN I want to convert it to DEM using Tin to Raster. Problem occures before I get to that part. When finding out what whether inserted DEM is a Raster or a TIN using code below I the decribe function doesn´t work as it should.
desc=a.da.Describe(r'%s' %sys.argv[2])
if desc.datasetType=='TIN':
When sys.argv[2] is a valid raster I get error code below:
Traceback (most recent call last):
File "D:\VS\4_semestr\pgis\finale\spadovani_toku3_kradijan_seider.py", line 56, in <module>
if desc.datasetType=='TIN':
AttributeError: 'dict' object has no attribute 'datasetType'
Need a way to check the datasetType, using ArcGIS Pro 2.9 with Python 3.7.11
Solved! Go to Solution.
You are mixing up old style arcpy.Describe with arcpy.da.Describe
arcpy.da.Describe returns a dictionary, use desc["datasetType"] instead.
desc=a.da.Describe("{}".format(sys.argv[2]))
assuming 'a' is arcpy
You are mixing up old style arcpy.Describe with arcpy.da.Describe
arcpy.da.Describe returns a dictionary, use desc["datasetType"] instead.