• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python test_qgspallabeling_base.TestQgsPalLabeling类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中test_qgspallabeling_base.TestQgsPalLabeling的典型用法代码示例。如果您正苦于以下问题:Python TestQgsPalLabeling类的具体用法?Python TestQgsPalLabeling怎么用?Python TestQgsPalLabeling使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: setUp

 def setUp(self):
     """Run before each test."""
     self.configTest('pal_server', 'sp')
     TestQgsPalLabeling.setDefaultEngineSettings()
     self.lyr = self.defaultSettings()
     self.params = self.defaultWmsParams('point')
     self._TestImage = ''
开发者ID:CSRedRat,项目名称:QGIS,代码行数:7,代码来源:test_qgspallabeling_server.py


示例2: tearDownClass

 def tearDownClass(cls):
     """Run after all tests"""
     TestQgsPalLabeling.tearDownClass()
     cls.removeMapLayer(cls.layer)
     cls.layer = None
     # avoid crash on finish, probably related to https://bugreports.qt.io/browse/QTBUG-35760
     QThreadPool.globalInstance().waitForDone()
开发者ID:minorua,项目名称:QGIS,代码行数:7,代码来源:test_qgspallabeling_composer.py


示例3: setUpClass

 def setUpClass(cls):
     TestQgsPalLabeling.setUpClass()
     cls.setUpServerProjectAndDir(TESTPROJPATH, TESTPROJDIR)
     cls.layer = TestQgsPalLabeling.loadFeatureLayer('background')
     cls.layer = TestQgsPalLabeling.loadFeatureLayer('point')
     cls.checkmismatch = 1000
     cls.checkgroup = ''
开发者ID:xxsurvey,项目名称:Quantum-GIS,代码行数:7,代码来源:test_qgspallabeling_server.py


示例4: test_polygon_placement_with_hole_and_point

 def test_polygon_placement_with_hole_and_point(self):
     # Testing that hole from a feature is not treated as an obstacle for other feature's labels
     self.layer = TestQgsPalLabeling.loadFeatureLayer('point')
     polyLayer = TestQgsPalLabeling.loadFeatureLayer('polygon_with_hole')
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.checkTest()
     self.removeMapLayer(self.layer)
     self.removeMapLayer(polyLayer)
     self.layer = None
开发者ID:Cracert,项目名称:Quantum-GIS,代码行数:9,代码来源:test_qgspallabeling_placement.py


示例5: test_point_placement_narrow_polygon_obstacle

 def test_point_placement_narrow_polygon_obstacle(self):
     # Default point label placement with narrow polygon obstacle
     self.layer = TestQgsPalLabeling.loadFeatureLayer('point')
     polyLayer = TestQgsPalLabeling.loadFeatureLayer('narrow_polygon')
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.checkTest()
     self.removeMapLayer(self.layer)
     self.removeMapLayer(polyLayer)
     self.layer = None
开发者ID:Cracert,项目名称:Quantum-GIS,代码行数:9,代码来源:test_qgspallabeling_placement.py


示例6: test_multipolygon_obstacle

 def test_multipolygon_obstacle(self):
     # Test that all parts of multipolygon are used as an obstacle
     self.layer = TestQgsPalLabeling.loadFeatureLayer('point')
     polyLayer = TestQgsPalLabeling.loadFeatureLayer('multi_polygon')
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.checkTest()
     self.removeMapLayer(self.layer)
     self.removeMapLayer(polyLayer)
     self.layer = None
开发者ID:Cracert,项目名称:Quantum-GIS,代码行数:9,代码来源:test_qgspallabeling_placement.py


示例7: tearDownClass

 def tearDownClass(cls):
     """Run after all tests"""
     TestQgsPalLabeling.tearDownClass()
     # layers removed, save empty project file
     cls._TestProj.write()
     if "PAL_SERVER_TEMP" in os.environ:
         MAPSERV.stop_processes()
         MAPSERV.open_temp_dir()
     else:
         MAPSERV.shutdown()
开发者ID:CSRedRat,项目名称:QGIS,代码行数:10,代码来源:test_qgspallabeling_server.py


示例8: test_point_ordered_placement4

 def test_point_ordered_placement4(self):
     # Test ordered placements for point (3 obstacle)
     self.layer = TestQgsPalLabeling.loadFeatureLayer('point_ordered_placement')
     obstacleLayer = TestQgsPalLabeling.loadFeatureLayer('point_ordered_obstacle3')
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.lyr.placement = QgsPalLayerSettings.OrderedPositionsAroundPoint
     self.lyr.dist = 2
     self.checkTest()
     self.removeMapLayer(obstacleLayer)
     self.removeMapLayer(self.layer)
     self.layer = None
开发者ID:Cracert,项目名称:Quantum-GIS,代码行数:11,代码来源:test_qgspallabeling_placement.py


示例9: test_point_dd_ordered_placement1

 def test_point_dd_ordered_placement1(self):
     # Test ordered placements for point with data defined order and obstacle
     self.layer = TestQgsPalLabeling.loadFeatureLayer("point_ordered_placement")
     obstacleLayer = TestQgsPalLabeling.loadFeatureLayer("point_ordered_obstacle_top")
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.lyr.placement = QgsPalLayerSettings.OrderedPositionsAroundPoint
     self.lyr.dist = 2
     self.lyr.setDataDefinedProperty(QgsPalLayerSettings.PredefinedPositionOrder, True, True, "'T,B'", None)
     self.checkTest()
     self.removeMapLayer(obstacleLayer)
     self.removeMapLayer(self.layer)
     self.lyr.removeDataDefinedProperty(QgsPalLayerSettings.PredefinedPositionOrder)
     self.layer = None
开发者ID:GrokImageCompression,项目名称:QGIS,代码行数:13,代码来源:test_qgspallabeling_placement.py


示例10: test_point_dd_ordered_placement1

 def test_point_dd_ordered_placement1(self):
     # Test ordered placements for point with data defined order and obstacle
     self.layer = TestQgsPalLabeling.loadFeatureLayer('point_ordered_placement')
     obstacleLayer = TestQgsPalLabeling.loadFeatureLayer('point_ordered_obstacle_top')
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.lyr.placement = QgsPalLayerSettings.OrderedPositionsAroundPoint
     self.lyr.dist = 2
     self.lyr.dataDefinedProperties().setProperty(QgsPalLayerSettings.PredefinedPositionOrder, QgsProperty.fromExpression("'T,B'"))
     self.checkTest()
     self.removeMapLayer(obstacleLayer)
     self.removeMapLayer(self.layer)
     self.lyr.dataDefinedProperties().setProperty(QgsPalLayerSettings.PredefinedPositionOrder, QgsProperty())
     self.layer = None
开发者ID:Cracert,项目名称:Quantum-GIS,代码行数:13,代码来源:test_qgspallabeling_placement.py


示例11: setUpClass

    def setUpClass(cls):
        TestQgsPalLabeling.setUpClass()

        cls._TestProj = QgsProject.instance()
        cls._TestProj.setFileName(str(TESTPROJPATH).strip())
        if not cls._TestProjSetup:
            try:
                shutil.copy(cls._PalFeaturesDb, TESTPROJDIR)
                for qml in glob.glob(cls._PalDataDir + os.sep + '*.qml'):
                    shutil.copy(qml, TESTPROJDIR)
            except IOError, e:
                raise IOError(str(e) +
                              '\nCould not set up test server directory')
            cls._TestProjSetup = True
开发者ID:AnAvidDeveloper,项目名称:QGIS,代码行数:14,代码来源:test_qgspallabeling_server.py


示例12: test_point_placement_around_obstacle

 def test_point_placement_around_obstacle(self):
     # Default point label placement with obstacle
     self.layer = TestQgsPalLabeling.loadFeatureLayer("point2")
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.checkTest()
     self.removeMapLayer(self.layer)
     self.layer = None
开发者ID:GrokImageCompression,项目名称:QGIS,代码行数:7,代码来源:test_qgspallabeling_placement.py


示例13: test_point_placement_around_obstacle_large_symbol

 def test_point_placement_around_obstacle_large_symbol(self):
     # Default point label placement with obstacle and large symbols
     self.layer = TestQgsPalLabeling.loadFeatureLayer('point3')
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.checkTest()
     self.removeMapLayer(self.layer)
     self.layer = None
开发者ID:Cracert,项目名称:Quantum-GIS,代码行数:7,代码来源:test_qgspallabeling_placement.py


示例14: test_point_placement_around

 def test_point_placement_around(self):
     # Default point label placement
     self.layer = TestQgsPalLabeling.loadFeatureLayer('point')
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.checkTest()
     self.removeMapLayer(self.layer)
     self.layer = None
开发者ID:Cracert,项目名称:Quantum-GIS,代码行数:7,代码来源:test_qgspallabeling_placement.py


示例15: test_label_line_over_small_angles

 def test_label_line_over_small_angles(self):
     # Test that labeling a line using parallel labels will place labels near center of straightish line
     self.layer = TestQgsPalLabeling.loadFeatureLayer('line_placement_3')
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.lyr.placement = QgsPalLayerSettings.Line
     self.checkTest()
     self.removeMapLayer(self.layer)
     self.layer = None
开发者ID:Cracert,项目名称:Quantum-GIS,代码行数:8,代码来源:test_qgspallabeling_placement.py


示例16: test_prefer_more_horizontal_lines

 def test_prefer_more_horizontal_lines(self):
     # Test that labeling a line using parallel labels will tend to place the labels over more horizontal sections
     self.layer = TestQgsPalLabeling.loadFeatureLayer('line_placement_2')
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.lyr.placement = QgsPalLayerSettings.Line
     self.checkTest()
     self.removeMapLayer(self.layer)
     self.layer = None
开发者ID:Cracert,项目名称:Quantum-GIS,代码行数:8,代码来源:test_qgspallabeling_placement.py


示例17: test_small_polygon_placement_perimeter

 def test_small_polygon_placement_perimeter(self):
     # Default polygon perimeter placement for small polygon
     self.layer = TestQgsPalLabeling.loadFeatureLayer('polygon_small')
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.lyr.placement = QgsPalLayerSettings.Line
     self.checkTest()
     self.removeMapLayer(self.layer)
     self.layer = None
开发者ID:Cracert,项目名称:Quantum-GIS,代码行数:8,代码来源:test_qgspallabeling_placement.py


示例18: test_label_line_toward_center

 def test_label_line_toward_center(self):
     # Test that labeling a line using parallel labels will try to place labels as close to center of line as possible
     self.layer = TestQgsPalLabeling.loadFeatureLayer('line_placement_4')
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.lyr.placement = QgsPalLayerSettings.Line
     self.checkTest()
     self.removeMapLayer(self.layer)
     self.layer = None
开发者ID:Cracert,项目名称:Quantum-GIS,代码行数:8,代码来源:test_qgspallabeling_placement.py


示例19: test_label_line_avoid_jaggy

 def test_label_line_avoid_jaggy(self):
     # Test that labeling a line using parallel labels won't place labels over jaggy bits of line
     self.layer = TestQgsPalLabeling.loadFeatureLayer('line_placement_5')
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.lyr.placement = QgsPalLayerSettings.Line
     self.checkTest()
     self.removeMapLayer(self.layer)
     self.layer = None
开发者ID:Cracert,项目名称:Quantum-GIS,代码行数:8,代码来源:test_qgspallabeling_placement.py


示例20: test_prefer_longer_lines_over_shorter

 def test_prefer_longer_lines_over_shorter(self):
     # Test that labeling a line using parallel labels will tend to place the labels over the longer straight parts of
     # the line
     self.layer = TestQgsPalLabeling.loadFeatureLayer('line_placement_1')
     self._TestMapSettings = self.cloneMapSettings(self._MapSettings)
     self.lyr.placement = QgsPalLayerSettings.Line
     self.checkTest()
     self.removeMapLayer(self.layer)
     self.layer = None
开发者ID:Cracert,项目名称:Quantum-GIS,代码行数:9,代码来源:test_qgspallabeling_placement.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap