# 需要导入模块: import arcpy [as 别名]# 或者: from arcpy importExists[as 别名]def_CheckCreateGDBProcess(self):try:# If user param is to overwrite GDB, then delete it firstifself.overWrite.upper() =="YES":ifarcpy.Exists(self.end_db)==True: arcpy.Delete_management(self.end_db) self....
# Set the current workspacearcpy.env.workspace =r"E:\map"# Check for existence of data before deletingifarcpy.Exists("roadbuffer"): arcpy.Delete_management("roadbuffer") 显式指定文件夹中的所有要素文件 env.workspace ="F:/map"fcs = arcpy.ListFeatureClasses("*","polygon")#寻找所有面矢量文件...
env.workspace = self._tempWorkspace#fc = arcpy.ListFeatureClasses(self._layers)# for fcs in self._layer:fcs = self._layerifarcpy.Exists(fcs):withopen(self._CSVLocation,'wb')asoutFile:print"%s create"% self._CSVLocation linewriter = csv.writer(outFile, delimiter =',') fcdescribe = arc...
Exists("c:/data/Portland.gdb/streets") # prints NAD_1983_StatePlane_Oregon_North_FIPS_3601_Feet sr = arcpy.Describe("c:/data/Portland.gdb/streets").spatialReference print sr.name # prints Available print arcpy.CheckExtension("spatial") arcpy.CheckOutExtension("spatial") 了解有关在 Python ...
arcpy.CreateFeatureclass_management(env.scratchGDB, os.path.basename(nasisProjectFC), "POLYGON", "", "DISABLED", "DISABLED", outputCS) arcpy.AddField_management(nasisProjectFC,"mukey", "TEXT", "", "", "30") # for outputShp if not arcpy.Exists(nasisProjectFC): AddMsgAndPrint("\t...
Exists("c:/data/Portland.gdb/streets") # prints NAD_1983_StatePlane_Oregon_North_FIPS_3601_Feet sr = arcpy.Describe("c:/data/Portland.gdb/streets").spatialReference print sr.name # prints Available print arcpy.CheckExtension("spatial") arcpy.CheckOutExtension("spatial") Python での関数の...
ArcPy中的函数主要包括了:描述数据的函数(Describe)、判断数据是否存在的函数(Exists)、数据迭代相关的函数(如:ListFields)、外部输入参数相关的函数(如GetParameterAsText)、许可检查相关的函数(如CheckExtension)、环境设置相关的函数(如GetSystemEnvironment)、消息错误处理相关的函数(如GetMessage) ...
arcpy.AddMessage(u"out_mdb"+out_mdb)ifnotarcpy.Exists(out_mdb):#可以文件夹ifgdbbool=="MDB": arcpy.CreatePersonalGDB_management(os.path.dirname(out_mdb),os.path.basename(out_mdb))elifgdbbool=="GDB": arcpy.CreateFileGDB_management(os.path.dirname(out_mdb),os.path.basename(out_mdb))else...
ArcPy中的函数主要包括了:描述数据的函数(Describe)、判断数据是否存在的函数(Exists)、数据迭代相关的函数(如:ListFields)、外部输入参数相关的函数(如GetParameterAsText)、许可检查相关的函数(如CheckExtension)、环境设置相关的函数(如GetSystemEnvironment)、消息错误处理相关的函数(如GetMessage) ...
arcpy.FeatureClassToFeatureClass_conversion("c:/data/Portland.gdb/streets","Database Connections/MySDE.sde/PortlandDataset","streets") Learn more about using tools in Python Getting results from a tool When a geoprocessing tool is executed, the results of the tool are returned in aResultobject....