Skip to content
Mohammad Fadli edited this page Jun 15, 2015 · 4 revisions

(still a draft)

Hazard Compiler

(as stated in FSD)

When the JakSAFE service is started and the first request is running, the request time minus 6 hours is set as t0 (start period of flooding event). Every 6 hours, system will request flood event data in latest 6 hours from DIMS. The response is JSON file that will be parsed and saved into database. If within two consecutive days, the response is null, then the latest time when DIMS give the response is set as t1 (end period of flooding event).

Before the system start to compile flood report, the system will query the fl_event table to check the availability of data from previous two days. If there is no record, then the system will set the request time minus 6 hours as t0 and request time as t1. Otherwise, if there is any data, system will set the request time as t1. T0 and t1 of each process will be recorded in auto_calc table.

The process is started by querying flood event data between t0 and t1, then classified them according the existence of id RT. The query result is saved into csv file, so there will be two csv file, they are report RT and report RW. These report will be compiled with boundary shapefile and kelas_dampak.csv. The compilation result of each reports then will be joined as a hazard shapefile (hazard.shp).

In case there is more than one record with same location but has different height, the height in that location is determined by taking the average value of height. For example, at RT 01/RW 01, in the first 6 hours (first report) is affeceted by 50 cm flood. The next 6 hours (second report), there is no report, then the next 6 hours (third report), that loaction is affected by 70 cm flood. When the data is compiled on the third report, the flood height at RT01/RW01 is (50+70)/2 = 60 cm.

Example 1

At RT 01/RW 01, the flood events happened with the following chronology (this data captured as json format and stored at MySQL table):

Date Time Height
1/1/2015 00:00:00 50cm
1/1/2015 01:00:00 50cm
1/1/2015 03:00:00 100cm
1/1/2015 04:00:00 100cm
1/1/2015 05:00:00 100cm

**Question: ** How JakServices will compiled it for the first six hour?

Hint: If there's some record within 6 hours, get the worst case height

**Answers: ** If the t0 is set at 00:00:00, so t1 = 06:00:00. The JakService wil compiled: The height will be taken as: 100cm This compiling process will be taken as 'worst case scenario' principle. So the record in MySQL should be like this: 1/1/2015; 06:00:00; 100cm

Example 2

Within 3 days, all the 6-hourly-compiled data will be recorded as:

Date Time Height
1/1/2015 06:00:00 100cm
1/1/2015 12:00:00 100cm
1/1/2015 18:00:00 50cm
1/1/2015 24:00:00 no flood
2/1/2015 06:00:00 50cm
2/1/2015 12:00:00 50cm
2/1/2015 18:00:00 50cm
2/1/2015 24:00:00 100cm
3/1/2015 06:00:00 100cm
3/1/2015 12:00:00 no flood
3/1/2015 18:00:00 50cm
3/1/2015 24:00:00 100cm

Question: How JakServices will capture those data as one batch of flood event in RT 001/ RW 01?

Answer: The height will be compiled as: height=average(100;100;50;0;..;50;100) = 62.5 The duration will be categorized as: 2.5 days ---no flood day(s) = (6 hours x 2)/24 hours = 0.5 days ---flooded days = (6 hours x 10)/24 hours = 2.5 days So the flood will be categorized as: B1 (height=10 to 70; duration=1-4)

data yg dari json kan disimpan di sql raw, .. data banjir yang udah di filter itu yang disimpan di dalam kejadian yang dicompile diambil dari table fl_event muai dari t0(periode awal banjir) sampai t1(waktu request) dari data ini kalu ada data di rt yang sama baru dihitung lama banjirnya..

oh oke dijumlahin ya nah kalo bolongnya agak lama gmn? misalkan kita rekap 1 bulan di awal bulan ada banjir 5 hari lalu off 10 hari ada lagi 5 hari itu gmn?

sama.. logicnya seperti itu juga.. 10 hari off nya itu sama sekali ga ada laporan banjir atau cuma di satu rt aja yg off? off untuk rt itu aja

iya logicnya seperti itu.. karena masih dalam satu periode pengamatan banjir..

jadi tetap dijumlahkan untuk lama waktunya, dan value banjirnya diambil yang tertinggi ya?

iya, tapi untuk banjirnya diambil rata-ratanya..

Oh bukan diambil max nya? pembedanya apa kez? yg diambil max dan yang dirataratakan?

okey Oh sori baru ngeh yg diambil worstcase itu adalah kalau kita compile dalam 6 jam nya ya? logic yg itu tetap kan? cuma kalau dalam multiple 6 jam-an, baru kita rata2kan? CMIIW

Clone this wiki locally