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


Python SSUtilities.getBaseFolder方法代码示例

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


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

示例1: reportHTML

# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import getBaseFolder [as 别名]
    def reportHTML(self, htmlFile = None):
        """Generates a graphical html report for Moran's I."""

        #### Shorthand Attributes ####
        zi = self.zi

        #### Progress and Create HTML File Name ####
        writeMSG = ARCPY.GetIDMessage(84228)
        ARCPY.SetProgressor("default", writeMSG)
        ARCPY.AddMessage(writeMSG)
        if not htmlFile:
            prefix = ARCPY.GetIDMessage(84227)
            outputDir = UTILS.returnScratchWorkSpace()
            baseDir = UTILS.getBaseFolder(outputDir)
            htmlFile = UTILS.returnScratchName(prefix, fileType = "TEXT", 
                                           scratchWS = baseDir,
                                           extension = "html")

        #### Obtain Correct Images ####
        imageDir = UTILS.getImageDir()
        clustStr = ARCPY.GetIDMessage(84243)
        dispStr = ARCPY.GetIDMessage(84244)
        if zi <= -2.58:
            imageFile = OS.path.join(imageDir, "dispersedValues01.png")
            info = ("1%", dispStr)
            imageBox = OS.path.join(imageDir, "dispersedBox01.png")
        elif (-2.58 < zi <= -1.96):
            imageFile = OS.path.join(imageDir, "dispersedValues05.png")
            info = ("5%", dispStr)
            imageBox = OS.path.join(imageDir, "dispersedBox05.png")
        elif (-1.96 < zi <= -1.65):
            imageFile = OS.path.join(imageDir, "dispersedValues10.png")
            info = ("10%", dispStr)
            imageBox = OS.path.join(imageDir, "dispersedBox10.png")
        elif (-1.65 < zi < 1.65):
            imageFile = OS.path.join(imageDir, "randomValues.png")
            imageBox = OS.path.join(imageDir, "randomBox.png")
        elif (1.65 <= zi < 1.96):
            imageFile = OS.path.join(imageDir, "clusteredValues10.png")
            info = ("10%", clustStr)
            imageBox = OS.path.join(imageDir, "clusteredBox10.png")
        elif (1.96 <= zi < 2.58):
            imageFile = OS.path.join(imageDir, "clusteredValues05.png")
            info = ("5%", clustStr)
            imageBox = OS.path.join(imageDir, "clusteredBox05.png")
        else:
            imageFile = OS.path.join(imageDir, "clusteredValues01.png")
            info = ("1%", clustStr)
            imageBox = OS.path.join(imageDir, "clusteredBox01.png")

        #### Footnote ####
        footStart = ARCPY.GetIDMessage(84230).format(zi)
        if abs(zi) >= 1.65:
            footEnd = ARCPY.GetIDMessage(84231)
            footEnd = footEnd.format(*info)
            footerText = footStart + footEnd 
        else:
            footEnd = ARCPY.GetIDMessage(84232)
            footerText = footStart + footEnd

        #### Root Element ####
        title = ARCPY.GetIDMessage(84229)
        reportElement, reportTree = REPORT.xmlReport(title = title)

        #### Begin Graphic SubElement ####
        graphicElement = REPORT.xmlGraphic(reportElement, imageFile, 
                                           footerText = footerText)

        #### Floating Table ####
        rowVals = [ [ARCPY.GetIDMessage(84148), self.giString, ""],
                    [ARCPY.GetIDMessage(84151), self.ziString, imageBox],
                    [ARCPY.GetIDMessage(84152), self.pvString, ""] ]

        fTable = REPORT.xmlTable(graphicElement, rowVals, 
                                 tType = "ssFloat")

        #### Moran Table ####
        rowVals = [ [ARCPY.GetIDMessage(84148), self.giString],
                    [ARCPY.GetIDMessage(84149), self.eiString],
                    [ARCPY.GetIDMessage(84150), self.viString],
                    [ARCPY.GetIDMessage(84151), self.ziString],
                    [ARCPY.GetIDMessage(84152), self.pvString] ]

        mTable = REPORT.xmlTable(reportElement, rowVals,
                                 title = ARCPY.GetIDMessage(84160))

        #### Dataset Table ####
        rowVals = [ [UTILS.addColon(ARCPY.GetIDMessage(84233)), 
                     self.ssdo.inputFC],
                    [UTILS.addColon(ARCPY.GetIDMessage(84016)), 
                     self.varName],
                    [UTILS.addColon(ARCPY.GetIDMessage(84234)), 
                     WU.wTypeDispatch[self.wType]],
                    [UTILS.addColon(ARCPY.GetIDMessage(84235)),
                     self.concept],
                    [UTILS.addColon(ARCPY.GetIDMessage(84236)), 
                     str(self.rowStandard)],
                    [UTILS.addColon(ARCPY.GetIDMessage(84237)), 
                     self.thresholdStr],
                    [UTILS.addColon(ARCPY.GetIDMessage(84238)), 
#.........这里部分代码省略.........
开发者ID:rvinc66,项目名称:ArcGISRuntimeBook,代码行数:103,代码来源:MoransI.py

示例2: reportHTML

# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import getBaseFolder [as 别名]
    def reportHTML(self, htmlFile = None):
        """Generates a graphical html report for Nearest Neighbor Stat."""

        #### Shorthand Attributes ####
        zScore = self.zn

        #### Progress and Create HTML File Name ####
        writeMSG = ARCPY.GetIDMessage(84228)
        ARCPY.SetProgressor("default", writeMSG)
        ARCPY.AddMessage(writeMSG)
        if not htmlFile:
            prefix = ARCPY.GetIDMessage(84240)
            outputDir = UTILS.returnScratchWorkSpace()
            baseDir = UTILS.getBaseFolder(outputDir)
            htmlFile = UTILS.returnScratchName(prefix, fileType = "TEXT", 
                                               scratchWS = baseDir,
                                               extension = "html")

        #### Obtain Correct Images ####
        imageDir = UTILS.getImageDir()
        clustStr = ARCPY.GetIDMessage(84243)
        dispStr = ARCPY.GetIDMessage(84244)
        if zScore <= -2.58:
            imageFile = OS.path.join(imageDir, "clusteredPoints01.png")
            info = ("1%", clustStr)
            imageBox = OS.path.join(imageDir, "dispersedBox01.png")
        elif (-2.58 < zScore <= -1.96):
            imageFile = OS.path.join(imageDir, "clusteredPoints05.png")
            info = ("5%", clustStr)
            imageBox = OS.path.join(imageDir, "dispersedBox05.png")
        elif (-1.96 < zScore <= -1.65):
            imageFile = OS.path.join(imageDir, "clusteredPoints10.png")
            info = ("10%", clustStr)
            imageBox = OS.path.join(imageDir, "dispersedBox10.png")
        elif (-1.65 < zScore < 1.65):
            imageFile = OS.path.join(imageDir, "randomPoints.png")
            imageBox = OS.path.join(imageDir, "randomBox.png")
        elif (1.65 <= zScore < 1.96):
            imageFile = OS.path.join(imageDir, "dispersedPoints10.png")
            info = ("10%", dispStr)
            imageBox = OS.path.join(imageDir, "clusteredBox10.png")
        elif (1.96 <= zScore < 2.58):
            imageFile = OS.path.join(imageDir, "dispersedPoints05.png")
            info = ("5%", dispStr)
            imageBox = OS.path.join(imageDir, "clusteredBox05.png")
        else:
            imageFile = OS.path.join(imageDir, "dispersedPoints01.png")
            info = ("1%", dispStr)
            imageBox = OS.path.join(imageDir, "clusteredBox01.png")

        #### Footnote ####
        footStart = ARCPY.GetIDMessage(84230).format(zScore)
        if abs(zScore) >= 1.65:
            footEnd = ARCPY.GetIDMessage(84231)
            footEnd = footEnd.format(*info)
            footerText = footStart + footEnd 
        else:
            footEnd = ARCPY.GetIDMessage(84232)
            footerText = footStart + footEnd

        #### Root Element ####
        title = ARCPY.GetIDMessage(84161)
        reportElement, reportTree = REPORT.xmlReport(title = title)

        #### Begin Graphic SubElement ####
        graphicElement = REPORT.xmlGraphic(reportElement, imageFile, 
                                           footerText = footerText)

        #### Floating Table ####
        rowVals = [ [ARCPY.GetIDMessage(84164), self.ratioString, ""],
                    [ARCPY.GetIDMessage(84151), self.znString, imageBox],
                    [ARCPY.GetIDMessage(84152), self.pvString, ""] ]

        fTable = REPORT.xmlTable(graphicElement, rowVals, 
                                 tType = "ssFloat")

        #### NN Table ####
        rowVals = [ [ARCPY.GetIDMessage(84162), self.nnStringD],
                    [ARCPY.GetIDMessage(84163), self.enStringD],
                    [ARCPY.GetIDMessage(84164), self.ratioString],
                    [ARCPY.GetIDMessage(84151), self.znString],
                    [ARCPY.GetIDMessage(84152), self.pvString] ]

        nnTable = REPORT.xmlTable(reportElement, rowVals,
                                  title = ARCPY.GetIDMessage(84161))

        #### Dataset Table ####
        rowVals = [ [UTILS.addColon(ARCPY.GetIDMessage(84233)), 
                     self.ssdo.inputFC],
                    [UTILS.addColon(ARCPY.GetIDMessage(84235)),
                     self.concept],
                    [UTILS.addColon(ARCPY.GetIDMessage(84241)), 
                     LOCALE.format("%0.6f", self.studyArea)],
                    [UTILS.addColon(ARCPY.GetIDMessage(84418)),
                     str(self.ssdo.selectionSet)] ]

        dTable = REPORT.xmlTable(reportElement, rowVals,
                         title = ARCPY.GetIDMessage(84239))

        #### Create HTML ####
#.........这里部分代码省略.........
开发者ID:rvinc66,项目名称:ArcGISRuntimeBook,代码行数:103,代码来源:NearestNeighbor.py


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