python 獲得一個數據的坐標系


# ---------------------------------------------------------------------------
# 1.py  閆磊編寫
# Created on: 2011-05-06 16:56:36.00000
#   (generated by ArcGIS/ModelBuilder)
# Description: 
# ---------------------------------------------------------------------------

import arcpy

featureClass = arcpy.GetParameterAsText(0) #"F:\閆磊\data\Chinadata\shp\主要公路.shp"
desc = arcpy.Describe(featureClass)

# Print selected feature class properties
# 
print "shapeType", desc.shapeType
print "hasSpatialIndex", desc.hasSpatialIndex
print "extent XMin", desc.extent.XMin
print "extent YMax", desc.extent.YMax
print "the first field's name", desc.fields[0].name
print "the first field's type", desc.fields[0].type
print "坐標", desc.spatialReference


# Obtain the spatial reference object and return it to the tool.
SR = desc.spatialReference
arcpy.SetParameter(1, SR)
arcpy.AddMessage(" spatialReference " + str(SR))

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM