本文整理汇总了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;未经允许,请勿转载。 |
请发表评论