本文整理匯總了Python中arcpy.FeatureClassToFeatureClass_conversion方法的典型用法代碼示例。如果您正苦於以下問題:Python arcpy.FeatureClassToFeatureClass_conversion方法的具體用法?Python arcpy.FeatureClassToFeatureClass_conversion怎麽用?Python arcpy.FeatureClassToFeatureClass_conversion使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類arcpy
的用法示例。
在下文中一共展示了arcpy.FeatureClassToFeatureClass_conversion方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: testmeta
# 需要導入模塊: import arcpy [as 別名]
# 或者: from arcpy import FeatureClassToFeatureClass_conversion [as 別名]
def testmeta(self):
fcws = 'c:\\temp'
tempshp = arcpy.CreateScratchName('tmp.dbf', workspace=fcws).replace('.dbf', '.shp')
fcnm = os.path.basename(tempshp)
# testing entries
ttl,pps,abt = "Bar","example", "Column Spam means eggs"
fc = arcpy.FeatureClassToFeatureClass_conversion(
self.t_fc,
fcws,
fcnm
).getOutput(0)
ap.meta(fc, 'OVERWRITE', title=ttl)
editted = ap.meta(fc, 'append', purpose=pps, abstract=abt)
editted = ap.meta(fc, 'overwrite', title=ttl, purpose=pps, abstract=abt)
retrieved = ap.meta(fc)
ap.dlt(fc)
self.assertEqual(set(editted.values()), set(retrieved.values()))
## def testmsg(self):
## pass
示例2: exportPath
# 需要導入模塊: import arcpy [as 別名]
# 或者: from arcpy import FeatureClassToFeatureClass_conversion [as 別名]
def exportPath(opt, trackname):
"""
This exports the list of segments into a shapefile, a subset of the loaded segment file, including all attributes
"""
start_time = time.time()
opt=getUniqueList(opt)
qr = '"OBJECTID" IN ' +str(tuple(opt))
outname = (os.path.splitext(os.path.basename(trackname))[0][:9])+'_pth'
arcpy.SelectLayerByAttribute_management('segments_lyr',"NEW_SELECTION", qr)
try:
if arcpy.Exists(outname):
arcpy.Delete_management(outname)
arcpy.FeatureClassToFeatureClass_conversion('segments_lyr', arcpy.env.workspace, outname)
print("--- export: %s seconds ---" % (time.time() - start_time))
except Exception:
e = sys.exc_info()[1]
print(e.args[0])
# If using this code within a script tool, AddError can be used to return messages
# back to a script tool. If not, AddError will have no effect.
arcpy.AddError(e.args[0])
arcpy.AddError(arcpy.env.workspace)
arcpy.AddError(outname)
#raise arcpy.ExecuteError
except arcpy.ExecuteError:
arcpy.AddError(arcpy.GetMessages(2))
# Return any other type of error
except:
# By default any other errors will be caught here
#
e = sys.exc_info()[1]
print(e.args[0])
arcpy.AddError(e.args[0])
arcpy.AddError(arcpy.env.workspace)
arcpy.AddError(outname)