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


Python SSUtilities.createCutoffsStep方法代码示例

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


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

示例1: initialize

# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import createCutoffsStep [as 别名]
    def initialize(self):
        """Populates the instance of the Spatial Statistics Data
        Object (SSDataObject) and resolves a default distance threshold
        if none given.
        """

        #### Shorthand Attributes ####
        ssdo = self.ssdo
        varName = self.varName
        self.master2Order = ssdo.master2Order
        masterField = ssdo.masterField
        concept = self.concept

        #### Populate SSDO with Data ####
        field = ssdo.fields[varName]
        self.y = field.returnDouble()
        self.numObs = ssdo.numObs
        gaExtent = UTILS.get92Extent(ssdo.extent)

        #### Set Envelope or Slice ####
        if ssdo.useChordal:
            softMaxExtent = ssdo.sliceInfo.maxExtent
            hardMaxExtent = ARC._ss.get_max_gcs_distance(ssdo.spatialRef)
            maxExtent = min(softMaxExtent, hardMaxExtent)
        else:
            env = UTILS.Envelope(ssdo.extent)
            maxExtent = env.maxExtent

        #### Set Maximum Distance Allowed ####
        extentBool = (self.begDist != None) or (self.dIncrement != None) or ssdo.useChordal
        if extentBool:
            #### If User Provides Either Input, Set to 75% Max Extent ####
            self.maxDistance = maxExtent * 0.75
            self.allDefaults = False
        else:
            #### Set to Diameter of Standard Distance ####
            self.maxDistance = UTILS.standardDistanceCutoff(ssdo.xyCoords)
            self.allDefaults = True

        minimumRadius = (maxExtent * .001)

        #### Determine Starting Distance ####
        if self.begDist != None and self.begDist > self.maxDistance:
            ARCPY.AddIDMessage("WARNING", 929)
            self.begDist = None
        self.calculatedBegDist = self.begDist == None
        self.calculatedIncDist = self.dIncrement == None

        if self.calculatedBegDist or self.calculatedIncDist:
            outlierInfo = UTILS.LocationInfo(ssdo,
                                concept = self.concept,
                                stdDeviations = self.stdDeviations,
                                includeCoincident = self.includeCoincident,
                                silentThreshold = True)
            threshold = outlierInfo.threshold
            avgDist = outlierInfo.avgDist

            if self.begDist == None:
                self.begDist = threshold
            if self.dIncrement == None:
                self.dIncrement = avgDist

        #### Negative Values Not Valid ####
        if self.begDist < 0:
            ARCPY.AddIDMessage("ERROR", 933)
            raise SystemExit()

        #### Beginning Distance is too Small ####
        if self.begDist < minimumRadius:
            ARCPY.AddIDMessage("ERROR", 897, self.begDist)
            raise SystemExit()

        #### Determine All Distance Cutoffs ####
        cutoffs = UTILS.createCutoffsStep(self.begDist, self.dIncrement,
                                          self.nIncrements)

        #### Check Cutoff Values ###
        countMaxSet = (cutoffs > self.maxDistance).sum()
        if countMaxSet:
            #### Throw Warning if ANY Distances Larger than Max Extent ####
            if (not self.calculatedBegDist) and (not self.calculatedIncDist):
                ARCPY.AddIDMessage("WARNING", 1285, countMaxSet, self.nIncrements)

            cutoffs = UTILS.createCutoffsMaxDist(self.begDist, self.maxDistance,
                                                 self.nIncrements)
            self.dIncrement = cutoffs[1] - cutoffs[0]

        #### Print Threshold Distance ####
        stepMax = cutoffs[-1]
        thresholdStr = ssdo.distanceInfo.printDistance(self.begDist)
        threshBool = self.calculatedBegDist
        if threshBool and not self.silent:
            ARCPY.AddIDMessage("WARNING", 853, thresholdStr)

        if self.begDist > (maxExtent * 0.51) \
                    and not self.calculatedBegDist:
            ARCPY.AddIDMessage("WARNING", 934)
        elif stepMax > maxExtent \
                    and not self.calculatedIncDist:
            ARCPY.AddIDMessage("WARNING", 935)
#.........这里部分代码省略.........
开发者ID:rvinc66,项目名称:ArcGISRuntimeBook,代码行数:103,代码来源:MoransI_Increment.py


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