# 需要导入模块: 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....
'''#检查mxd文件是否存在print"Checking mxd file path..."ifos.path.exists(mxd_file_path) ==False:print"mxd file is not exist!"return# 打开mxd文档try:print"Opening mxd file..."mxd = arcpy.mapping.MapDocument(mxd_file_path)exceptException, e:print"open mxd error: ", ereturn# 获取默认的数...
Source File: spatial.py From ArcREST with Apache License 2.0 6 votes def create_feature_class(out_path, out_name, geom_type, wkid, fields, objectIdField): """ creates a feature class in a given gdb or folder """ if arcpyFound == False: raise Exception("ArcPy is required to use ...
if file.endswith(".shp"): print(file) if contains_point(file): inputs_file_poi.append(shpdir + "/" +file) # 循环加入所有shape文件 if not contains_point(file): inputs_file_line.append(shpdir + "/" +file) # 循环加入所有shape文件 print(inputs_file_poi) print(inputs_file_line) ...
"""try:importarcpy.saassa# check out licensearcpy.CheckOutExtension('Spatial') fl_rast = sa.Float(arcpy.Raster(raster) / float(10**int(decimals)))try: fl_rast.save(out_raster)except:# having random issues with Esri GRID format, change to tiff# if grid file is createdifnotarcpy.Exist...
(outFeatureClass) if os.path.exists(env + "lines.shp"): arcpy.Delete_management("lines.shp") if os.path.exists(env + "info"): arcpy.Delete_management("info") # if os.path.exists(env + "point.shp"): # arcpy.Delete_management("point.shp") if os.path.exists(env + "table.dbf"...
Please email kristen@kgs.ku.edu this error message: " + str(E)) if Exists(Locator): userMessage("Geocoding addresses...") #geocode table address if Exists(output): Delete_management(output) i = 0 #set up geocoding gc_fieldMap = "Street LABEL VISIBLE NONE;City MUNI VISIBLE NONE;State ...
result_gdb = os.path.join(out_path, gdb_name1)ifnotarcpy.Exists(result_gdb): arcpy.AddMessage(" 新建 "+ result_gdb +" ...") arcpy.CreateFileGDB_management(out_path, gdb_name1)else: arcpy.AddWarning(result_gdb +" 已存在!") ...
ArcPy中的函数主要包括了:描述数据的函数(Describe)、判断数据是否存在的函数(Exists)、数据迭代相关的函数(如:ListFields)、外部输入参数相关的函数(如GetParameterAsText)、许可检查相关的函数(如CheckExtension)、环境设置相关的函数(如GetSystemEnvironment)、消息错误处理相关的函数(如GetMessage) ...
importarcpy# printsTrueprintarcpy.Exists("c:/data/Portland.gdb/streets") # printsNAD_1983_StatePlane_Oregon_North_FIPS_3601_Feetsr =arcpy.Describe("c:/data/Portland.gdb/streets").spatialReference print sr.name # printsAvailableprintarcpy.CheckExtension("spatial")arcpy.CheckOutExtension("spatial")...