Pre-processing layers for use InaSAFE

Before using your data layers (hazard and exposure) in InaSAFE certain preprocessing are needed such as attribute and format conversions. This will ensure that the layers and its values are correct in order to provide a reliable result.

Computing area and perimeters of a polygon layer

  1. Plugins ‣ Manage and install plugins...

  2. Type fTools on the search bar then enable.

  3. Load your layer .

  4. menuselection:Vector –> Geometry Tools –> Export/Add geometry columns
  5. Choose where layer will the Area and Perimeter data be added. Choose Layer CRS for calculation.

    _images/brgy_area.png

Note

Make sure that your layer has a correct CRS before choosing Layer CRS for calculation.

  1. Check if Area and Perimeter were added, Right click on the layer then Open Attribute Table

Now that we have a population and area on our data we’re going to add a new column for population density.

  1. On Open Attribute Table click mActionToggleEditing then mActionCalculateField .

  2. On Output field name Add name for population density (e.g., popden).

    _images/fld_calc.png
  3. Add this formula on ‘Expression’ Population / (Area/10000)

To do that:

  • On the Function List choose Fields and Values.
  • First, double click population column which is ‘2010_Pop’.
  • Add division sign ‘/’.
  • Click open parenthesis, double click ‘AREA’ in `Fields and Values ` divided by 10000 then close parenthesis.
  • Click, OK, Save mActionFileSave and click mActionToggleEditing.

Adding Numerical Data for Hazards

  1. Right click your Flood layer, then select Open Attribute Table.

  2. Click mActionToggleEditing.

  3. Sort your data by clicking the field name:

    _images/sort_data.png
  4. Selecting by group of data by clicking on the row number Shift (Keyboard) up to the last data.

    _images/haz_calc.png
  5. Click mActionCalculateField .

  6. Since we’re going to make a new field, check Create a new field.

  7. On Output field name Add name for hazard level (e.g., haz_level).

    _images/haz_calc.png
  8. Set Expression according to your flood data.

code::
Low = ‘1’ Medium = ‘2’ High = ‘3’
  1. Now that we already have a field for numerical hazard data, on Field Calculator check Update existing field.

    _images/exist_calc.png
  2. Click, OK, Save mActionFileSave and click mActionToggleEditing.

Converting Vector to Raster

Population Density

  1. Raster ‣ Conversion ‣ Rasterize.

  2. On `Input file (shapefile) select vector layer to be rasterize.

  3. On Attribute field field name of Population Density to be rasterize.

    _images/input_attr.png
  4. On Output file for rasterized vecto(raster) click Select button.

  5. Choose file path for saving the raster, add name select .TIF as image format then Save.

    _images/pop_tif.png

6. Click Raster resolution in map units per pixel. Set the Horizontal and Vertical to 100.

  1. Click, OK then choose WGS 84 / UTM zone 51N as your projection.
  2. Click OK twice then Close.

Warning

Look out for the OK button you’re clicking you may duplicate creating raster layer.

Flood

Same instruction for Population Density. Just change layer name and attribute field like this:

_images/haz_attr.png

Re-projecting raster layers

We’re going to set your projection to WGS 84 because it is the default projection which InaSAFE can recognize.

  1. Right click on raster layer.

  2. Select Save as...

  3. Browse where to save raster layer. Then save as .tif file.

    _images/saveas_wgs84.png
  4. Change then Choose WGS 84 as CRS.

    _images/wgs84.png
  5. Click OK.

Setting the the layers in the Keyword Editor

Hazard

  1. Click on our hazard layer with WGS 84 projection (e.g, haz_level_wgs84)
  2. Click Keyword Editor keyword_editor
  3. Select Hazard
  4. Click Show advanced editor

Keyword: subcategory Value: flood Keyword: unit Value: m

  1. Add to list then OK

    _images/key_haz.png

Note

We’re just trying to demo how your data will work on InaSAFE. 1m, 2m, 3m are not representing Low, Moderate and High. Better if you input your flood depth in meters at Attribute Table. Categorical hazard data are still on development. We will update you once it is done.

Population

  1. Click on our exposure layer with WGS 84 projection (e.g, popden_wgs84)
  2. Click Keyword Editor keyword_editor
  3. Select Exposure
  4. Click Show advanced editor

Keyword: subcategory Value: population

  1. Add to list then OK

    _images/key_pop.png

Aggregation

  1. Select your Administrative Boundary layer which is vector

  2. Click Keyword Editor keyword_editor

  3. Select Postprocessing

  4. Set Aggregation attribute as Barangay

    _images/aggr.png
  5. Click OK

Click Run