本文整理汇总了Python中utilities.mapSettingsString函数的典型用法代码示例。如果您正苦于以下问题:Python mapSettingsString函数的具体用法?Python mapSettingsString怎么用?Python mapSettingsString使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mapSettingsString函数的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1: checkTest
def checkTest(self, **kwargs):
self.layer.setLabeling(QgsVectorLayerSimpleLabeling(self.lyr))
ms = self._MapSettings # class settings
settings_type = 'Class'
if self._TestMapSettings is not None:
ms = self._TestMapSettings # per test settings
settings_type = 'Test'
if 'PAL_VERBOSE' in os.environ:
qDebug('MapSettings type: {0}'.format(settings_type))
qDebug(mapSettingsString(ms))
img = renderMapToImage(ms, parallel=False)
self._TestImage = getTempfilePath('png')
if not img.save(self._TestImage, 'png'):
os.unlink(self._TestImage)
raise OSError('Failed to save output from map render job')
self.saveControlImage(self._TestImage)
mismatch = 0
if 'PAL_NO_MISMATCH' not in os.environ:
# some mismatch expected
mismatch = self._Mismatch if self._Mismatch else 0
if self._TestGroup in self._Mismatches:
mismatch = self._Mismatches[self._TestGroup]
colortol = 0
if 'PAL_NO_COLORTOL' not in os.environ:
colortol = self._ColorTol if self._ColorTol else 0
if self._TestGroup in self._ColorTols:
colortol = self._ColorTols[self._TestGroup]
self.assertTrue(*self.renderCheck(mismatch=mismatch,
colortol=colortol,
imgpath=self._TestImage))
开发者ID:giohappy,项目名称:QGIS,代码行数:33,代码来源:test_qgspallabeling_canvas.py
示例2: checkTest
def checkTest(self, **kwargs):
self.lyr.writeToLayer(self.layer)
ms = self._MapSettings # class settings
settings_type = "Class"
if self._TestMapSettings is not None:
ms = self._TestMapSettings # per test settings
settings_type = "Test"
if "PAL_VERBOSE" in os.environ:
qDebug("MapSettings type: {0}".format(settings_type))
qDebug(mapSettingsString(ms))
img = renderMapToImage(ms, parallel=False)
self._TestImage = getTempfilePath("png")
if not img.save(self._TestImage, "png"):
os.unlink(self._TestImage)
raise OSError("Failed to save output from map render job")
self.saveControlImage(self._TestImage)
mismatch = 0
if "PAL_NO_MISMATCH" not in os.environ:
# some mismatch expected
mismatch = self._Mismatch if self._Mismatch else 0
if self._TestGroup in self._Mismatches:
mismatch = self._Mismatches[self._TestGroup]
colortol = 0
if "PAL_NO_COLORTOL" not in os.environ:
colortol = self._ColorTol if self._ColorTol else 0
if self._TestGroup in self._ColorTols:
colortol = self._ColorTols[self._TestGroup]
self.assertTrue(*self.renderCheck(mismatch=mismatch, colortol=colortol, imgpath=self._TestImage))
开发者ID:GrokImageCompression,项目名称:QGIS,代码行数:31,代码来源:test_qgspallabeling_placement.py
示例3: checkTest
def checkTest(self, **kwargs):
self.sync_map_settings()
self.lyr.writeToLayer(self.layer)
# save project file
self._TestProj.write()
# always restart FCGI before tests, so settings can be applied
# MAPSERV.fcgi_server_process().start()
# get server results
# print self.params.__repr__()
ms = self._MapSettings # class settings
settings_type = 'Class'
if self._TestMapSettings is not None:
ms = self._TestMapSettings # per test settings
settings_type = 'Test'
if 'PAL_VERBOSE' in os.environ:
qDebug('MapSettings type: {0}'.format(settings_type))
qDebug(mapSettingsString(ms))
res_m, self._TestImage, url = MAPSERV.get_map(self.get_request_params(), False)
# print self._TestImage.__repr__()
if 'PAL_VERBOSE' in os.environ:
qDebug('GetMap request:\n {0}\n'.format(url))
self.saveControlImage(self._TestImage)
self.assertTrue(res_m, 'Failed to retrieve/save image from test server')
mismatch = 0
if 'PAL_NO_MISMATCH' not in os.environ:
# some mismatch expected
mismatch = self._Mismatch if self._Mismatch else 20
if self._TestGroup in self._Mismatches:
mismatch = self._Mismatches[self._TestGroup]
colortol = 0
if 'PAL_NO_COLORTOL' not in os.environ:
# some mismatch expected
# colortol = self._ColorTol if self._ColorTol else 10
if self._TestGroup in self._ColorTols:
colortol = self._ColorTols[self._TestGroup]
self.assertTrue(*self.renderCheck(mismatch=mismatch,
colortol=colortol,
imgpath=self._TestImage))
开发者ID:Geoneer,项目名称:QGIS,代码行数:40,代码来源:test_qgspallabeling_server.py
注:本文中的utilities.mapSettingsString函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论