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

Python utilities.load_standard_layers函数代码示例

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

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



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

示例1: setUp

    def setUp(self):
        """Fixture run before all tests"""
        register_impact_functions()
        self.maxDiff = None  # show full diff for assert errors
        os.environ['LANG'] = 'en'
        self.DOCK.show_only_visible_layers_flag = True
        load_standard_layers(self.DOCK)
        self.DOCK.cboHazard.setCurrentIndex(0)
        self.DOCK.cboExposure.setCurrentIndex(0)
        self.DOCK.cboFunction.setCurrentIndex(0)
        self.DOCK.run_in_thread_flag = False
        self.DOCK.show_only_visible_layers_flag = False
        self.DOCK.set_layer_from_title_flag = False
        self.DOCK.zoom_to_impact_flag = False
        self.DOCK.hide_exposure_flag = False
        self.DOCK.show_intermediate_layers = False
        set_jakarta_extent()

        self._keywordIO = KeywordIO()
        self._defaults = get_defaults()

        # Set extent as Jakarta extent
        geo_crs = QgsCoordinateReferenceSystem()
        geo_crs.createFromSrid(4326)
        self.extent = extent_to_geo_array(CANVAS.extent(), geo_crs)
开发者ID:jobel-openscience,项目名称:inasafe,代码行数:25,代码来源:test_aggregator.py


示例2: setUp

    def setUp(self):
        """Fixture run before all tests"""
        register_impact_functions()

        self.dock.show_only_visible_layers_flag = True
        load_standard_layers(self.dock)
        self.dock.cboHazard.setCurrentIndex(0)
        self.dock.cboExposure.setCurrentIndex(0)
        self.dock.cboFunction.setCurrentIndex(0)
        self.dock.run_in_thread_flag = False
        self.dock.show_only_visible_layers_flag = False
        self.dock.set_layer_from_title_flag = False
        self.dock.zoom_to_impact_flag = False
        self.dock.hide_exposure_flag = False
        self.dock.show_intermediate_layers = False
        self.dock.user_extent = None
        self.dock.user_extent_crs = None
        # For these tests we will generally use explicit overlap
        # between hazard, exposure and view, so make that default
        # see also safe/test/utilities.py where this is globally
        # set to HazardExposure
        settings = QtCore.QSettings()
        settings.setValue(
            'inasafe/analysis_extents_mode',
            'HazardExposureView')
开发者ID:lucernae,项目名称:inasafe,代码行数:25,代码来源:test_dock.py


示例3: setUp

    def setUp(self):
        """Fixture run before all tests."""
        os.environ['LANG'] = 'en'
        self.DOCK.show_only_visible_layers_flag = True
        load_standard_layers(self.DOCK)
        self.DOCK.hazard_layer_combo.setCurrentIndex(0)
        self.DOCK.exposure_layer_combo.setCurrentIndex(0)
        self.DOCK.run_in_thread_flag = False
        self.DOCK.show_only_visible_layers_flag = False
        self.DOCK.set_layer_from_title_flag = False
        self.DOCK.zoom_to_impact_flag = False
        self.DOCK.hide_exposure_flag = False

        # Create scenario dialog
        self.save_scenario_dialog = SaveScenarioDialog(IFACE, self.DOCK)
开发者ID:timlinux,项目名称:inasafe,代码行数:15,代码来源:test_save_scenario.py


示例4: setUp

 def setUp(self):
     """Fixture run before all tests"""
     os.environ['LANG'] = 'en'
     DOCK.show_only_visible_layers_flag = True
     load_standard_layers(DOCK)
     DOCK.cboHazard.setCurrentIndex(0)
     DOCK.cboExposure.setCurrentIndex(0)
     DOCK.cboFunction.setCurrentIndex(0)
     DOCK.run_in_thread_flag = False
     DOCK.show_only_visible_layers_flag = False
     DOCK.set_layer_from_title_flag = False
     DOCK.zoom_to_impact_flag = False
     DOCK.hide_exposure_flag = False
     DOCK.show_intermediate_layers = False
     set_jakarta_extent()
开发者ID:severinmenard,项目名称:inasafe,代码行数:15,代码来源:test_postprocessor_manager.py


示例5: setUp

    def setUp(self):
        """Fixture run before all tests."""
        os.environ['LANG'] = 'en'
        DOCK.show_only_visible_layers_flag = True
        load_standard_layers(DOCK)
        DOCK.cboHazard.setCurrentIndex(0)
        DOCK.cboExposure.setCurrentIndex(0)
        DOCK.cboFunction.setCurrentIndex(0)
        DOCK.run_in_thread_flag = False
        DOCK.show_only_visible_layers_flag = False
        DOCK.set_layer_from_title_flag = False
        DOCK.zoom_to_impact_flag = False
        DOCK.hide_exposure_flag = False
        DOCK.show_intermediate_layers = False

        # Create scenario dialog
        self.save_scenario_dialog = SaveScenarioDialog(IFACE, DOCK)
开发者ID:severinmenard,项目名称:inasafe,代码行数:17,代码来源:test_save_scenario.py


示例6: setUp

    def setUp(self):
        """Fixture run before all tests"""
        register_impact_functions()

        DOCK.show_only_visible_layers_flag = True
        load_standard_layers(DOCK)
        DOCK.cboHazard.setCurrentIndex(0)
        DOCK.cboExposure.setCurrentIndex(0)
        DOCK.cboFunction.setCurrentIndex(0)
        DOCK.run_in_thread_flag = False
        DOCK.show_only_visible_layers_flag = False
        DOCK.set_layer_from_title_flag = False
        DOCK.zoom_to_impact_flag = False
        DOCK.hide_exposure_flag = False
        DOCK.show_intermediate_layers = False
        DOCK.user_extent = None
        DOCK.user_extent_crs = None
开发者ID:Charlotte-Morgan,项目名称:inasafe,代码行数:17,代码来源:test_dock.py


示例7: setUp

 def setUp(self):
     """Fixture run before all tests."""
     self.dock.show_only_visible_layers_flag = True
     load_standard_layers(self.dock)
     self.dock.hazard_layer_combo.setCurrentIndex(1)
     self.dock.exposure_layer_combo.setCurrentIndex(0)
     self.dock.show_only_visible_layers_flag = False
     self.dock.set_layer_from_title_flag = False
     self.dock.zoom_to_impact_flag = False
     self.dock.hide_exposure_flag = False
     self.dock.user_extent = None
     self.dock.user_extent_crs = None
     # For these tests we will generally use explicit overlap
     # between hazard, exposure and view, so make that default
     # see also safe/test/utilities.py where this is globally
     # set to HazardExposure
     settings = QtCore.QSettings()
     settings.setValue(
         'inasafe/analysis_extents_mode', HAZARD_EXPOSURE_VIEW)
开发者ID:inasafe,项目名称:inasafe,代码行数:19,代码来源:test_dock.py


示例8: test_init

    def test_init(self):
        """Test initialization with different layers.."""
        # No layer
        QgsProject.instance().removeAllMapLayers()
        dialog = MetadataConverterDialog(PARENT, IFACE)
        self.assertEqual(dialog.input_layer_combo_box.count(), 0)
        dialog.close()

        # Load many layers
        QgsProject.instance().removeAllMapLayers()
        load_standard_layers()
        dialog = MetadataConverterDialog(PARENT, IFACE)
        self.assertGreater(dialog.input_layer_combo_box.count(), 0)
        dialog.close()

        # Load aggregation layer
        QgsProject.instance().removeAllMapLayers()
        layer = load_test_vector_layer(
            'gisv4', 'aggregation', 'small_grid_complex.geojson', clone=True)
        QgsProject.instance().addMapLayer(layer)
        dialog = MetadataConverterDialog(PARENT, IFACE)
        dialog.input_layer_combo_box.setLayer(layer)
        self.assertEqual(dialog.input_layer_combo_box.count(), 1)
        self.assertFalse(dialog.target_exposure_combo_box.isEnabled())
        dialog.close()

        # Load hazard layer, must have the target exposure
        QgsProject.instance().removeAllMapLayers()
        layer = load_test_vector_layer(
            'gisv4', 'hazard', 'tsunami_vector.geojson', clone=True)
        QgsProject.instance().addMapLayer(layer)
        dialog = MetadataConverterDialog(PARENT, IFACE)
        dialog.input_layer_combo_box.setLayer(layer)
        self.assertEqual(dialog.input_layer_combo_box.count(), 1)
        num_exposures = len(layer.keywords['value_maps'])
        self.assertEqual(
            dialog.target_exposure_combo_box.count(), num_exposures)
        dialog.close()
开发者ID:inasafe,项目名称:inasafe,代码行数:38,代码来源:test_metadata_converter.py


示例9: test_load_layers

    def test_load_layers(self):
        """Layers can be loaded and list widget was updated appropriately
        """

        hazard_layer_count, exposure_layer_count = load_standard_layers()
        message = 'Expect %s layer(s) in hazard list widget but got %s' % (
            hazard_layer_count, self.dock.cboHazard.count())
        # pylint: disable=W0106
        self.assertEqual(self.dock.cboHazard.count(),
                         hazard_layer_count), message
        message = 'Expect %s layer(s) in exposure list widget but got %s' % (
            exposure_layer_count, self.dock.cboExposure.count())
        self.assertEqual(self.dock.cboExposure.count(),
                         exposure_layer_count), message
开发者ID:lucernae,项目名称:inasafe,代码行数:14,代码来源:test_dock.py


示例10: add_test_layers

 def add_test_layers(self):
     """Add standard test layers."""
     from safe.test.utilities import load_standard_layers
     load_standard_layers()
开发者ID:NyakudyaA,项目名称:inasafe,代码行数:4,代码来源:plugin.py


示例11: add_test_layers

 def add_test_layers(self):
     """Add standard test layers."""
     from safe.test.utilities import load_standard_layers
     load_standard_layers()
     rect = QgsRectangle(106.806, -6.195, 106.837, -6.167)
     self.iface.mapCanvas().setExtent(rect)
开发者ID:jobel-openscience,项目名称:inasafe,代码行数:6,代码来源:plugin.py



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Python utilities.load_test_vector_layer函数代码示例发布时间:2022-05-27
下一篇:
Python utilities.load_layer函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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