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¶
Type fTools on the search bar then enable.
Load your layer .
menuselection: Vector –> Geometry Tools –> Export/Add geometry columns Choose where layer will the Area and Perimeter data be added. Choose Layer CRS for calculation.
Note
Make sure that your layer has a correct CRS before choosing Layer CRS for calculation.
- 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.
On Output field name Add name for population density (e.g., popden).
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 and click .
Adding Numerical Data for Hazards¶
Right click your Flood layer, then select Open Attribute Table.
Sort your data by clicking the field name:
Selecting by group of data by clicking on the row number Shift (Keyboard) up to the last data.
Since we’re going to make a new field, check Create a new field.
On Output field name Add name for hazard level (e.g., haz_level).
Set Expression according to your flood data.
- code::
- Low = ‘1’ Medium = ‘2’ High = ‘3’
Converting Vector to Raster¶
Population Density
.
On `Input file (shapefile) select vector layer to be rasterize.
On Attribute field field name of Population Density to be rasterize.
On Output file for rasterized vecto(raster) click Select button.
Choose file path for saving the raster, add name select .TIF as image format then Save.
6. Click Raster resolution in map units per pixel. Set the Horizontal and Vertical to 100.
- Click, OK then choose WGS 84 / UTM zone 51N as your projection.
- 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:
Re-projecting raster layers¶
We’re going to set your projection to WGS 84 because it is the default projection which InaSAFE can recognize.
Setting the the layers in the Keyword Editor¶
Hazard
- Click on our hazard layer with WGS 84 projection (e.g, haz_level_wgs84)
- Click Keyword Editor
- Select Hazard
- Click Show advanced editor
Keyword: subcategory Value: flood Keyword: unit Value: m
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
- Click on our exposure layer with WGS 84 projection (e.g, popden_wgs84)
- Click Keyword Editor
- Select Exposure
- Click Show advanced editor
Keyword: subcategory Value: population
Aggregation
Select your Administrative Boundary layer which is vector
Select Postprocessing
Set Aggregation attribute as Barangay
Click OK
Click Run