本文整理汇总了Python中safe.impact_function.impact_function.ImpactFunction.map_canvas方法的典型用法代码示例。如果您正苦于以下问题:Python ImpactFunction.map_canvas方法的具体用法?Python ImpactFunction.map_canvas怎么用?Python ImpactFunction.map_canvas使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类safe.impact_function.impact_function.ImpactFunction
的用法示例。
在下文中一共展示了ImpactFunction.map_canvas方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: impact_function_setup
# 需要导入模块: from safe.impact_function.impact_function import ImpactFunction [as 别名]
# 或者: from safe.impact_function.impact_function.ImpactFunction import map_canvas [as 别名]
def impact_function_setup(
command_line_arguments, hazard, exposure, aggregation=None):
"""Sets up an analysis object.
.. versionadded:: 3.2
:param command_line_arguments: User inputs.
:type command_line_arguments: CommandLineArguments
:param hazard: Hazard layer
:type hazard: QgsLayer
:param exposure: Exposure Layer
:type exposure: QgsLayer
:param aggregation: Aggregation Layer
:type aggregation: QgsLayer
:raises: Exception
"""
# IF
impact_function = ImpactFunction()
impact_function.hazard = hazard
impact_function.exposure = exposure
impact_function.aggregation = aggregation
impact_function.map_canvas = CANVAS
# QSetting context
settings = QSettings()
crs = settings.value('inasafe/user_extent_crs', '', type=str)
impact_function.requested_extent_crs = QgsCoordinateReferenceSystem(crs)
try:
impact_function.requested_extent = QgsRectangle(
float(command_line_arguments.extent[0]),
float(command_line_arguments.extent[1]),
float(command_line_arguments.extent[2]),
float(command_line_arguments.extent[3])
)
except AttributeError:
print "No extents"
pass
return impact_function