首页 > 数据库技术 > 详细

arcgis python 判断是数据库或是文件夹

时间:2019-05-26 22:45:13      阅读:260      评论:0      收藏:0      [点我收藏+]

import arcpy

# Create a Describe object
#
desc = arcpy.Describe("C:/Data/chesapeake.gdb")

# Print some Describe Object properties
#
if hasattr(desc, "name"):
    print "Name:        " + desc.name
if hasattr(desc, "dataType"):
    print "DataType:    " + desc.dataType 
 #DataType == "Folder" DataType == "Workspace"
#.DataType == "FeatureDataset"
if hasattr(desc, "catalogPath"):
    print "CatalogPath: " + desc.catalogPath

# Examine children and print their name and dataType
#
print "Children:"
for child in desc.children:
    print "\t%s = %s" % (child.name, child.dataType)

  

arcgis python 判断是数据库或是文件夹

原文:https://www.cnblogs.com/gisoracle/p/10927953.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!