fc = arcpy.env.workspace = "D:/全國/roadss.shp" desc = arcpy.Describe(fc) print desc.dataType #dataType確定數(shù)據(jù)類型,,要素(shpfile||coverage)&柵格 print desc.path #文件路徑獲取 print desc.baseName #不帶后綴的名字獲取 print desc.name #帶后綴的名字獲取 print desc.catalogpath #輸出為"desc.path + desc.name" 以上是數(shù)據(jù)的描述 列出數(shù)據(jù) env.workspace = "D:/全國" #設置好工作空間,,這個將列出全國文件夾下的矢量數(shù)據(jù),并且以列表保存 fclist = arcpy.ListFeatureClasses("設置可以進行模糊或者精確查找","矢量數(shù)據(jù)類型") fclist = arcpy.ListFeatureClasses("r*","point") #可以查找以r開頭的shp文件 fclist = arcpy.ListRasters("","tif") #同上 for field in fieldlist: print field.name #圖層字段名字,,
|
|
來自: renew3lddfd2k5 > 《Python》