InaSAFE Disaster risk assessment tool developed by AusAid -
Helper module for gui script functions.

Contact :


This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version., paths, iface)[source]

Add the layers described in a scenario file to QGIS.

  • scenario_dir (str) – Base directory to find path.
  • paths (str, list) – Path of scenario file (or a list of paths).
  • iface (QgsInterface) – iface instance to do necessary things to QGIS.

Exception, TypeError, FileNotFoundError

  • Exception - occurs when paths have illegal extension
  • TypeError - occurs when paths is not string or list
  • FileNotFoundError - occurs when file not found, path)[source]

Get a path and basename given a scenarioFilePath and path.

  • scenario_file_path (str) – Path to a scenario file.
  • path (str) –

Tuple containing path and base name

Return type:

(str, str)[source]

Return map canvas object[source]

Run the current scenario.

Parameters:dock – Dock instance, dock=None)[source]

Set the aggregation combo to use the layer with the given name.

  • aggregation_layer – str - a string representing the source name of the desired aggregation layer.
  • dock – a dock instance
Returns bool:

True on success, False in the case that the aggregation layer is not in the aggregation selector.


Probably won’t work for sublayers and anything else other than file based layers (e.g. shp)., dock=None)[source]

Set the function combo to use the function with the given id.

  • function_id – str - a string representing the unique identifier for the desired function.
  • dock – a dock instance
Returns bool:

True on success, False in the case that the function is not present in the function selector (based on the context of loaded hazard and exposure layers.