當前位置: 首頁>>代碼示例>>Python>>正文


Python ImpactFunction.map_canvas方法代碼示例

本文整理匯總了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
開發者ID:ismailsunni,項目名稱:inasafe,代碼行數:44,代碼來源:inasafe.py


注:本文中的safe.impact_function.impact_function.ImpactFunction.map_canvas方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。