本文整理匯總了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)