当前位置: 首页>>代码示例>>Python>>正文


Python arcpy.FeatureClassToFeatureClass_conversion方法代码示例

本文整理汇总了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 
开发者ID:NERC-CEH,项目名称:arcapi,代码行数:24,代码来源:arcapi_test.py

示例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) 
开发者ID:simonscheider,项目名称:mapmatching,代码行数:38,代码来源:mapmatcher.py


注:本文中的arcpy.FeatureClassToFeatureClass_conversion方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。