Open timlinux opened 8 years ago
@mbernasocchi has plans to start implementing these tools too....
Hi @samnawi , @ivanbusthomi & @felix-yew - this is an RFC about the next important phase of UI development for InaSAFE. Please review this proposal and make comments. What UI tools do you think are most relevant to DM users in Indonesia; what should be a priority for DMI to fund and support? This work will be our priority in the next quarter and for InaSAFE 4.3
@timlinux - do you still want input to this in the light of the InaSAFE roadmap discussion in September?
Problem
This RFC describes elements that should be user configurable within the architecture of InaSAFE 4.0 and what the benefit and role of these components will be:
Current status: In progress
Value Maps (exposure classifications)
Purpose: Value maps provide a way to map user's data to known concepts in InaSAFE. For example in road exposure, we will report on a predefined list of classes of road. The default classes InaSAFE provides for roads are:
The creation of a new value map definition would allow power users to create a new set of reporting classes (e.g. Motorway, Main, Secondary) which match the reporting requirements of the user's organization. A proposed user interface for editing value maps would look something like this:
Note: The above is a mockup and we are not planning to implement GUI's for managing these right now. Rather the user should edit the text definition as shown in the example below:
Generated code example:
Outcome: Implementing a new exposure value mapping classification will make it possible for the user to select that classification in their InaSAFE settings dialog as part of their profile:
When a value mapping classification is selected in the user profile, the keywords wizard will be affected. The value mapping screen in the keywords wizard will reflect the currently selected value maps in the user profile:
The concepts in the tree to the right are taken from the value map.
Classifications (hazard classifications)
Purpose: Hazard classifications specify how a particular hazard type is deconstructed into different severity levels. For example for a flood hazard we might have these hazard classes:
The creation of a new hazard classifications would support the development of region specific classifications for the same hazard. For example a particular country may prefer to work with four hazard classes for flood rather then three. A proposed user interface for editing hazard classes maps would look something like this:
The min/max for each class are used when the hazard data is continuous to define thresholds for each class break.
An example specification for flood classes (as a python dictionary) is shown below:
Outcome:
When creating keywords for a hazard layer, the active classification profile for the user will be used.
Fields
Purpose: Fields allow you to establish which columns in the hazard, exposure or hazard dataset map to specific concepts. For example you you have an aggregation layer, defining which field contains the adult ratio will allow InaSAFE to scan through the concepts you have defined and map them to well known concepts within InaSAFE. With this mechanism we would have a semantic match between your field (perhaps called 'ratio_of_adults' in your own dataset) to the concept 'adult_ratio' within InaSAFE. Once this semantic match has been made, we can determine which post-processors (see below) can be used.
Notes:
~/.qgis2/inasafe
), that field definition will mask the one provided by InaSAFE.Note: The above mockup is missing a field category column - see below.
Note that there are four types of fields that you can define:
Post processors
Post processors are the core of InaSAFE. Post processors operate at an exposure feature level. After preparing the intermediate impact layer, InaSAFE will check the keywords of this layer to see which fields are defined, as well as checking the fields of the aggregate hazard layer. The cross product of these layers will determine which post processors can be run.
Note: In versions of InaSAFE prior to 4.0 the list of post processors could be user selected at run time just before running an impact function. In InaSAFE 4.0 we changed this behaviour so that post processors alway run if they have sufficient fields available.
The post processor results are all written to the final impact layer into fields that are again defined in the fields definitions. Thus a post processor is defined as one or more intermediate impact fields that are processed to produce one or more final impact fields.
Another important thing to note about post processors: Post processors are atomic. This means that no post processor may require the outputs of another post processor as an input requirement.
Note: The order in which post-processors is processed is also non-deterministic.
Below you can see an example of how we might support the creation of new post-processors by power users through a simple user interface:
For ease of understanding, we can divide the post processors below into a number of different subgroups. These are described below:
Vulnerabilities
Vulnerability post processors define specific calculations that relate to the vulnerability characteristics of exposure data. For example people can be more vulnerable if they are disabled, aged, visually impaired, pregnant etc. Roads may be vulnerable if they are at ground level for floods, yet the same road may be less vulnerable in the event of an earthquake. Conversely an overpass or elevated road may be less vulnerable in floods but more so in the case of an earthquake.
Note: As of 4.0 not all of these nuanced rules are implemented, but they are on the roadmap for future versions of InaSAFE.
Demographics
Demographic post processors seek to break down the impact report by population groups. For example they might produce new fields for counts of children, adults, elderly people. These numbers can be produced when an exposure layer provides a population column (e.g. building exposure with a count of inhabitants, or a census layer with a count of inhabitants per census area). There are many ways that population based counts can be derived. Here is an example of a post processor that performs a gender analysis:
You can see in this example that the gender processor requires two inputs: a population column and a gender ratio column. Note that we have a system of global defaults that can be used to autogenerate e.g. the gender ratio column if it is not present in the exposure dataset.
The output columns are also defined in the post processor definition. In this case the post processor only defines one output column: 'women', although there is no limit to how many output columns a post processor may write.
One thing to note is the formula defined in the output section of the post processor. This is where the actual calculation is defined.
population * gender_ratio
In other words: Multiply the content of the population column by the content of the gender_ratio column and write the outputs into a column named "women_count_field".
Disabilities
Building properties
Minimum needs
DaLA
Exposure Definitions
Hazard Definitions