本文整理汇总了Python中safe_qgis.map.Map.renderImpactTable方法的典型用法代码示例。如果您正苦于以下问题:Python Map.renderImpactTable方法的具体用法?Python Map.renderImpactTable怎么用?Python Map.renderImpactTable使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类safe_qgis.map.Map
的用法示例。
在下文中一共展示了Map.renderImpactTable方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Xtest_renderTable
# 需要导入模块: from safe_qgis.map import Map [as 别名]
# 或者: from safe_qgis.map.Map import renderImpactTable [as 别名]
def Xtest_renderTable(self):
"""Test that html renders nicely. Commented out for now until we work
out how to get webkit to do offscreen rendering nicely."""
myFilename = 'test_floodimpact.tif'
myLayer, myType = loadLayer(myFilename)
CANVAS.refresh()
del myType
myMessage = 'Layer is not valid: %s' % myFilename
assert myLayer.isValid(), myMessage
myMap = Map(IFACE)
myMap.setImpactLayer(myLayer)
myPixmap = myMap.renderImpactTable()
assert myPixmap is not None
myExpectedWidth = 500
myExpectedHeight = 300
myMessage = 'Invalid width - got %s expected %s' % (
myPixmap.width(),
myExpectedWidth)
assert myPixmap.width() == myExpectedWidth, myMessage
myMessage = 'Invalid height - got %s expected %s' % (
myPixmap.height(),
myExpectedHeight)
assert myPixmap.height() == myExpectedHeight
myPath = os.path.join(temp_dir(), 'renderImpactTable.png')
myPixmap.save(myPath, 'PNG')
myExpectedHash = 'c9164d5c2bb85c6081905456ab827f3e'
assertHashForFile(myExpectedHash, myPath)