rvburton

AttributeError: DescribeData: Method spatialReference does not exist

Discussion created by rvburton Champion on Feb 20, 2016
Latest reply on Feb 20, 2016 by rvburton

I was experimenting with the following code provided on the Prj File properties documentation page using Desktop 10.3.1 and received an attribute error message.  With version 10.2 the code ran without error.

 

import arcpy
# Create a Describe Object from a prj file.
#
desc = arcpy.Describe("C:\data\mexico.prj")
# Print some properties of the SpatialReference class object.
#
SR = desc.spatialReference
print "Name:            " + SR.name
print "Type:            " + SR.type
print "isHighPrecision: " + str(SR.isHighPrecision)
print "scaleFactor:     " + str(SR.scaleFactor)

 

It appears that with version 10.3, you should reference the shape file (shp) and not the projection (prj) file for Describe to work properly.

Outcomes