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


Python SSUtilities.sqlChunkStrings方法代码示例

本文整理汇总了Python中SSUtilities.sqlChunkStrings方法的典型用法代码示例。如果您正苦于以下问题:Python SSUtilities.sqlChunkStrings方法的具体用法?Python SSUtilities.sqlChunkStrings怎么用?Python SSUtilities.sqlChunkStrings使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SSUtilities的用法示例。


在下文中一共展示了SSUtilities.sqlChunkStrings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: network2SWM

# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import sqlChunkStrings [as 别名]

#.........这里部分代码省略.........
    #### Add Destinations ####
    ARCPY.SetProgressor("default", ARCPY.GetIDMessage(84133)) 
    masterToken = "Name " + masterField + " #;"
    masterToken += masterField + " " + masterField + " #"
    NET.AddLocations(ODCostMatrix, naClassNames["Destinations"], inputFC, masterToken,
                     searchTolerance, exclude_restricted_elements = "EXCLUDE")

    #### Initialize Spatial Weights Matrix File ####
    hierarchyBool = hierarchy == 'USE_HIERARCHY'
    addConcept = WU.wTypeDispatch[fixed].split("_")[0]
    forceFixed = (fixed == True)
    swmWriter = WU.SWMWriter(swmFile, masterField, netSpatName, 
                             numObs, rowStandard,
                             inputFC = inputFC, wType = 10,
                             inputNet = inputNetwork, 
                             impedanceField = impedance,
                             barrierFC = inputBarrier,
                             uturnPolicy = uturnPolicy,
                             restrictions = restrictions,
                             useHierarchy = hierarchyBool,
                             searchTolerance = searchTolerance,
                             addConcept = addConcept,
                             exponent = exponent,
                             forceFixed = forceFixed)

    #### Create FieldList for Subset Searching ####
    totalImpedance = "Total_" + impedance
    fieldList = ";".join( ["NAME", totalImpedance] )

    #### Get Chunks if Necessary ####
    numOrigins = int(10000000. / numObs)
    allMaster.sort()
    chunkedIDs = UTILS.chunk(allMaster, numOrigins)
    sqlStrings = UTILS.sqlChunkStrings(inputFC, masterField, chunkedIDs)
    numChunks = len(sqlStrings)

    #### Create Field Map for Origins ####
    masterToken = "Name " + masterField + " #"
    orgFieldMap = [masterToken, 'CurbApproach CurbApproach 0', 
                    'SourceID SourceID #', 'SourceOID SourceOID #',
                    'PosAlong PosAlong #', 'SideOfEdge SideOfEdge #']   
    orgFieldMap = ";".join(orgFieldMap)

    #### Keep Track of Features That Snap to Network ####
    snappedFeatures = set([])

    for chunkNum in xrange(numChunks):
        progMsg = ARCPY.GetIDMessage(84145).format(chunkNum + 1, numChunks)
        ARCPY.SetProgressor("default", progMsg)
        
        #### Make Origins from Chunk of Destinations ####
        sqlValue = sqlStrings[chunkNum]
        DM.MakeFeatureLayer(destinationLayer, destFCLayer, sqlValue)
        NET.AddLocations(ODCostMatrix, naClassNames["Origins"], destFCLayer, orgFieldMap,
                         "#", "#", "#", "#", "CLEAR")

        #### Solve OD Matrix and Select Data ####
        NET.Solve(ODCostMatrix, "SKIP")

        #### Count the Number of NonZero Spatial Linkages #### 
        numLinks = UTILS.getCount(lines)

        #### Create Search Cursor for OD Line Info ####
        rows = ARCPY.SearchCursor(lines, "", None, fieldList)
        row = rows.next()
开发者ID:rvinc66,项目名称:ArcGISRuntimeBook,代码行数:69,代码来源:Network2SWM.py


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