本文整理汇总了Python中SSUtilities.getImageDir方法的典型用法代码示例。如果您正苦于以下问题:Python SSUtilities.getImageDir方法的具体用法?Python SSUtilities.getImageDir怎么用?Python SSUtilities.getImageDir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SSUtilities
的用法示例。
在下文中一共展示了SSUtilities.getImageDir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createOutput
# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import getImageDir [as 别名]
def createOutput(self, outputTable, displayIt = False):
"""Creates K-Function Output Table.
INPUTS
outputTable (str): path to the output table
displayIt {bool, False}: create output graph?
"""
#### Allow Overwrite Output ####
ARCPY.env.overwriteOutput = 1
#### Get Output Table Name With Extension if Appropriate ####
outputTable, dbf = UTILS.returnTableName(outputTable)
#### Set Progressor ####
ARCPY.SetProgressor("default", ARCPY.GetIDMessage(84008))
#### Delete Table If Exists ####
UTILS.passiveDelete(outputTable)
#### Create Table ####
outPath, outName = OS.path.split(outputTable)
try:
DM.CreateTable(outPath, outName)
except:
ARCPY.AddIDMessage("ERROR", 541)
raise SystemExit()
#### Add Result Fields ####
fn = UTILS.getFieldNames(kOutputFieldNames, outPath)
expectedKName, observedKName, diffKName, lowKName, highKName = fn
outputFields = [expectedKName, observedKName, diffKName]
if self.permutations:
outputFields += [lowKName, highKName]
for field in outputFields:
UTILS.addEmptyField(outputTable, field, "DOUBLE")
#### Create Insert Cursor ####
try:
insert = DA.InsertCursor(outputTable, outputFields)
except:
ARCPY.AddIDMessage("ERROR", 204)
raise SystemExit()
#### Add Rows to Output Table ####
for testIter in xrange(self.nIncrements):
distVal = self.cutoffs[testIter]
ldVal = self.ld[testIter]
diffVal = ldVal - distVal
rowResult = [distVal, ldVal, diffVal]
if self.permutations:
ldMinVal = self.ldMin[testIter]
ldMaxVal = self.ldMax[testIter]
rowResult += [ldMinVal, ldMaxVal]
insert.insertRow(rowResult)
#### Clean Up ####
del insert
#### Make Table Visable in TOC if *.dbf Had To Be Added ####
if dbf:
ARCPY.SetParameterAsText(1, outputTable)
#### Display Results ####
if displayIt:
if "WIN" in SYS.platform.upper():
#### Set Progressor ####
ARCPY.SetProgressor("default", ARCPY.GetIDMessage(84186))
#### Get Image Directory ####
imageDir = UTILS.getImageDir()
#### Make List of Fields and Set Template File ####
yFields = [expectedKName, observedKName]
if self.permutations:
#### Add Confidence Envelopes ####
yFields.append(highKName)
yFields.append(lowKName)
tee = OS.path.join(imageDir, "KFunctionPlotEnv.tee")
else:
tee = OS.path.join(imageDir, "KFunctionPlot.tee")
xFields = [ expectedKName for i in yFields ]
#### Create Data Series String ####
dataStr = UTILS.createSeriesStr(xFields, yFields, outputTable)
#### Make Graph ####
DM.MakeGraph(tee, dataStr, "KFunction")
ARCPY.SetParameterAsText(11, "KFunction")
else:
ARCPY.AddIDMessage("Warning", 942)
示例2: reportHTML
# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import getImageDir [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)),
#.........这里部分代码省略.........
示例3: reportHTML
# 需要导入模块: import SSUtilities [as 别名]
# 或者: from SSUtilities import getImageDir [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 ####
#.........这里部分代码省略.........