import arcpy # Get the feature class to describe # featureClass = arcpy.GetParameterAsText(0) desc = arcpy.Describe(featureClass) # Print some SpatialReference object properties SR = desc.spatialReference print SR.name # shows results in commandline of IDLE print SR.exportToString() # Show results in geoprocessing tool dialog arcpy.AddMessage(SR.name) arcpy.AddMessage(SR.exportToString())
******************************************************************************************* NAME: DescribeProjection Source Name: DescribeProjection.py Version: ArcGIS 10.0 Author: Ashley Mott Usage: DescribeProjection <input_data>, <input_coordinate_system> Required Arguments: A set of input feature classes or feature layers Description: Returns the coordinate system and/or projection of a dataset. Date Created: 02/22/2011 ********************************************************************************************** """ import arcpy # Get the feature class to describe # featureClass = arcpy.GetParameterAsText(0) desc = arcpy.Describe(featureClass) # Create a Describe Object from the prj file. # #desc = arcpy.Describe(prjFile) # does nothing # Print some SpatialReference object properties SR = desc.SpatialReference #case sensitive print "SR: ", str(SR) #haven't checked the rest print "Name: " + SR.name print "Type: " + SR.type print "FalseOriginAndUnits: " + desc.falseOriginAndUnits
Membros conectados podem postar, seguir atualizações e mais. Novo aqui? Registre uma conta gratuita.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.