From 26e49b4d9c5f7c091b93a6afb8b770838451e65f Mon Sep 17 00:00:00 2001 From: jannisvisser Date: Mon, 2 Dec 2024 14:01:29 +0100 Subject: [PATCH] fix: update blantyre mock data --- .../flood_extent_0-hour_MWI/coverage.xml | 37 ++-- .../flood_extent_15-hour_MWI/coverage.xml | 37 ++-- .../flood_extent_18-hour_MWI/coverage.xml | 37 ++-- .../flood_extent_21-hour_MWI/coverage.xml | 37 ++-- .../example/MWI/flash-floods/buildings.json | 202 ++++++++++++++++++ .../dto/example/MWI/flash-floods/roads.json | 15 +- .../MWI/flash-floods/health_sites.json | 13 +- .../dto/example/MWI/flash-floods/schools.json | 12 +- .../flash-floods/waterpoints_internal.json | 31 +-- .../upload-alert_threshold-3.json | 98 ++------- .../upload-damage_estimation-3.json | 98 ++------- .../upload-nr_affected_buildings-3.json | 98 ++------- .../upload-nr_affected_clinics-3.json | 98 ++------- .../upload-nr_affected_roads-3.json | 98 ++------- .../upload-nr_affected_schools-3.json | 98 ++------- .../upload-nr_affected_waterpoints-3.json | 98 ++------- .../upload-population_affected-3.json | 98 ++------- .../src/scripts/mock-helper.service.ts | 36 ++-- 18 files changed, 446 insertions(+), 795 deletions(-) diff --git a/services/API-service/geoserver-volume/geoserver-layers/flood_extent_0-hour_MWI/flood_extent_0-hour_MWI/coverage.xml b/services/API-service/geoserver-volume/geoserver-layers/flood_extent_0-hour_MWI/flood_extent_0-hour_MWI/coverage.xml index abab48cbb..3c04484c2 100644 --- a/services/API-service/geoserver-volume/geoserver-layers/flood_extent_0-hour_MWI/flood_extent_0-hour_MWI/coverage.xml +++ b/services/API-service/geoserver-volume/geoserver-layers/flood_extent_0-hour_MWI/flood_extent_0-hour_MWI/coverage.xml @@ -12,28 +12,29 @@ WCS GeoTIFF - GEOGCS["WGS 84", - DATUM["World Geodetic System 1984", - SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], - AUTHORITY["EPSG","6326"]], - PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], - UNIT["degree", 0.017453292519943295], - AXIS["Geodetic longitude", EAST], - AXIS["Geodetic latitude", NORTH], - AUTHORITY["EPSG","4326"]] + GEOGCS["WGS 84", + DATUM["World Geodetic System 1984", + SPHEROID["WGS 84", 6378137.0, 298.257223563, + AUTHORITY["EPSG","7030"]], + AUTHORITY["EPSG","6326"]], + PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], + UNIT["degree", 0.017453292519943295], + AXIS["Geodetic longitude", EAST], + AXIS["Geodetic latitude", NORTH], + AUTHORITY["EPSG","4326"]] EPSG:4326 - 33.53282861830312 - 33.978726334909005 - -11.103218069058544 - -10.827279844250857 + 33.2196966469999992 + 34.2166875660000969 + -12.3751980819998995 + -9.7888203069999804 EPSG:4326 - 33.53282861830312 - 33.978726334909005 - -11.103218069058544 - -10.827279844250857 + 33.2196966469999992 + 34.2166875660000969 + -12.3751980819998995 + -9.7888203069999804 EPSG:4326 REPROJECT_TO_DECLARED @@ -107,7 +108,7 @@ InputTransparentColor - + SUGGESTED_TILE_SIZE diff --git a/services/API-service/geoserver-volume/geoserver-layers/flood_extent_15-hour_MWI/flood_extent_15-hour_MWI/coverage.xml b/services/API-service/geoserver-volume/geoserver-layers/flood_extent_15-hour_MWI/flood_extent_15-hour_MWI/coverage.xml index 66a1061a9..3c3484a38 100644 --- a/services/API-service/geoserver-volume/geoserver-layers/flood_extent_15-hour_MWI/flood_extent_15-hour_MWI/coverage.xml +++ b/services/API-service/geoserver-volume/geoserver-layers/flood_extent_15-hour_MWI/flood_extent_15-hour_MWI/coverage.xml @@ -12,28 +12,29 @@ WCS GeoTIFF - GEOGCS["WGS 84", - DATUM["World Geodetic System 1984", - SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], - AUTHORITY["EPSG","6326"]], - PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], - UNIT["degree", 0.017453292519943295], - AXIS["Geodetic longitude", EAST], - AXIS["Geodetic latitude", NORTH], - AUTHORITY["EPSG","4326"]] + GEOGCS["WGS 84", + DATUM["World Geodetic System 1984", + SPHEROID["WGS 84", 6378137.0, 298.257223563, + AUTHORITY["EPSG","7030"]], + AUTHORITY["EPSG","6326"]], + PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], + UNIT["degree", 0.017453292519943295], + AXIS["Geodetic longitude", EAST], + AXIS["Geodetic latitude", NORTH], + AUTHORITY["EPSG","4326"]] EPSG:4326 - 33.6103 - 34.1324 - -11.1325 - -10.8 + 33.2196966469999992 + 34.2166875660000969 + -12.3751980819998995 + -9.7888203069999804 EPSG:4326 - 33.6103 - 34.1324 - -11.1325 - -10.8 + 33.2196966469999992 + 34.2166875660000969 + -12.3751980819998995 + -9.7888203069999804 EPSG:4326 REPROJECT_TO_DECLARED @@ -107,7 +108,7 @@ InputTransparentColor - + SUGGESTED_TILE_SIZE diff --git a/services/API-service/geoserver-volume/geoserver-layers/flood_extent_18-hour_MWI/flood_extent_18-hour_MWI/coverage.xml b/services/API-service/geoserver-volume/geoserver-layers/flood_extent_18-hour_MWI/flood_extent_18-hour_MWI/coverage.xml index c9aeb68bf..6bde45230 100644 --- a/services/API-service/geoserver-volume/geoserver-layers/flood_extent_18-hour_MWI/flood_extent_18-hour_MWI/coverage.xml +++ b/services/API-service/geoserver-volume/geoserver-layers/flood_extent_18-hour_MWI/flood_extent_18-hour_MWI/coverage.xml @@ -12,28 +12,29 @@ WCS GeoTIFF - GEOGCS["WGS 84", - DATUM["World Geodetic System 1984", - SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], - AUTHORITY["EPSG","6326"]], - PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], - UNIT["degree", 0.017453292519943295], - AXIS["Geodetic longitude", EAST], - AXIS["Geodetic latitude", NORTH], - AUTHORITY["EPSG","4326"]] + GEOGCS["WGS 84", + DATUM["World Geodetic System 1984", + SPHEROID["WGS 84", 6378137.0, 298.257223563, + AUTHORITY["EPSG","7030"]], + AUTHORITY["EPSG","6326"]], + PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], + UNIT["degree", 0.017453292519943295], + AXIS["Geodetic longitude", EAST], + AXIS["Geodetic latitude", NORTH], + AUTHORITY["EPSG","4326"]] EPSG:4326 - 33.6103 - 34.1324 - -11.1325 - -10.8 + 33.2196966469999992 + 34.2166875660000969 + -12.3751980819998995 + -9.7888203069999804 EPSG:4326 - 33.6103 - 34.1324 - -11.1325 - -10.8 + 33.2196966469999992 + 34.2166875660000969 + -12.3751980819998995 + -9.7888203069999804 EPSG:4326 REPROJECT_TO_DECLARED @@ -107,7 +108,7 @@ InputTransparentColor - + SUGGESTED_TILE_SIZE diff --git a/services/API-service/geoserver-volume/geoserver-layers/flood_extent_21-hour_MWI/flood_extent_21-hour_MWI/coverage.xml b/services/API-service/geoserver-volume/geoserver-layers/flood_extent_21-hour_MWI/flood_extent_21-hour_MWI/coverage.xml index a3baec626..682840b98 100644 --- a/services/API-service/geoserver-volume/geoserver-layers/flood_extent_21-hour_MWI/flood_extent_21-hour_MWI/coverage.xml +++ b/services/API-service/geoserver-volume/geoserver-layers/flood_extent_21-hour_MWI/flood_extent_21-hour_MWI/coverage.xml @@ -12,28 +12,29 @@ WCS GeoTIFF - GEOGCS["WGS 84", - DATUM["World Geodetic System 1984", - SPHEROID["WGS 84", 6378137.0, 298.257223563, AUTHORITY["EPSG","7030"]], - AUTHORITY["EPSG","6326"]], - PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], - UNIT["degree", 0.017453292519943295], - AXIS["Geodetic longitude", EAST], - AXIS["Geodetic latitude", NORTH], - AUTHORITY["EPSG","4326"]] + GEOGCS["WGS 84", + DATUM["World Geodetic System 1984", + SPHEROID["WGS 84", 6378137.0, 298.257223563, + AUTHORITY["EPSG","7030"]], + AUTHORITY["EPSG","6326"]], + PRIMEM["Greenwich", 0.0, AUTHORITY["EPSG","8901"]], + UNIT["degree", 0.017453292519943295], + AXIS["Geodetic longitude", EAST], + AXIS["Geodetic latitude", NORTH], + AUTHORITY["EPSG","4326"]] EPSG:4326 - 33.6103 - 34.1324 - -11.1325 - -10.8 + 33.2196966469999992 + 34.2166875660000969 + -12.3751980819998995 + -9.7888203069999804 EPSG:4326 - 33.6103 - 34.1324 - -11.1325 - -10.8 + 33.2196966469999992 + 34.2166875660000969 + -12.3751980819998995 + -9.7888203069999804 EPSG:4326 REPROJECT_TO_DECLARED @@ -107,7 +108,7 @@ InputTransparentColor - + SUGGESTED_TILE_SIZE diff --git a/services/API-service/src/api/lines-data/dto/example/MWI/flash-floods/buildings.json b/services/API-service/src/api/lines-data/dto/example/MWI/flash-floods/buildings.json index c73e17fea..b635b92aa 100644 --- a/services/API-service/src/api/lines-data/dto/example/MWI/flash-floods/buildings.json +++ b/services/API-service/src/api/lines-data/dto/example/MWI/flash-floods/buildings.json @@ -47,5 +47,207 @@ "3775", "3776", "3777" + ], + "0-hour": [ + "90190", + "99956", + "99966", + "99971", + "99978", + "99984", + "99988", + "99994", + "99999", + "100061", + "100062", + "100063", + "100064", + "100065", + "100066", + "100067", + "100068", + "100231", + "100238", + "100257", + "100258", + "100259", + "100260", + "100262", + "100263", + "100264", + "100265", + "100266", + "100268", + "100269", + "100270", + "100271", + "100272", + "100274", + "100276", + "100277", + "100278", + "100279", + "100280", + "100430", + "100486", + "100498", + "100501", + "101695", + "103763", + "104322", + "105120", + "107096", + "107097", + "107402", + "108456", + "108457", + "108459", + "108460", + "108461", + "108462", + "108465", + "108466", + "108467", + "108468", + "108469", + "108472", + "108474", + "108475", + "108477", + "108478", + "108484", + "108577", + "108582", + "108588", + "108590", + "108591", + "108592", + "108593", + "108594", + "108595", + "108822", + "108823", + "108825", + "108829", + "108831", + "108832", + "108834", + "108836", + "108842", + "108843", + "108849", + "108858", + "108859", + "108861", + "108963", + "108967", + "108971", + "108972", + "108973", + "108974", + "108980", + "108983", + "108984", + "109062", + "109064", + "109065", + "109069", + "109072", + "109074", + "109077", + "109078", + "109080", + "109114", + "109122", + "109124", + "109127", + "109130", + "109134", + "109140", + "109630", + "110831", + "110863", + "110864", + "110864", + "110865", + "110866", + "110867", + "110868", + "110869", + "110870", + "110871", + "110872", + "110873", + "110874", + "110877", + "110878", + "110879", + "110880", + "110881", + "110883", + "110884", + "110885", + "110886", + "110908", + "110909", + "110911", + "110912", + "110913", + "110914", + "110915", + "110916", + "110917", + "110918", + "110920", + "110921", + "110922", + "110923", + "110924", + "110926", + "110927", + "110928", + "110929", + "110930", + "110931", + "110932", + "110933", + "110935", + "110936", + "110937", + "110938", + "110948", + "110951", + "110958", + "110966", + "110967", + "110968", + "110996", + "111001", + "111001", + "111003", + "111018", + "111019", + "111020", + "111024", + "111071", + "111072", + "111073", + "111074", + "111076", + "111077", + "111080", + "111082", + "111084", + "111135", + "111136", + "111137", + "111146", + "111147", + "111148", + "111152", + "111154", + "111157", + "111159", + "111165" ] } diff --git a/services/API-service/src/api/lines-data/dto/example/MWI/flash-floods/roads.json b/services/API-service/src/api/lines-data/dto/example/MWI/flash-floods/roads.json index 5b62b5d5d..7a14267dc 100644 --- a/services/API-service/src/api/lines-data/dto/example/MWI/flash-floods/roads.json +++ b/services/API-service/src/api/lines-data/dto/example/MWI/flash-floods/roads.json @@ -56,7 +56,8 @@ "400983", "400984", "400985", - "400986"], + "400986" + ], "6-hour": [ "251852", "11621", @@ -128,5 +129,17 @@ "282557", "196", "278512" + ], + "0-hour": [ + "407842", + "408811", + "408905", + "411228", + "411617", + "413988", + "415374", + "415375", + "415791", + "415791" ] } diff --git a/services/API-service/src/api/point-data/dto/example/MWI/flash-floods/health_sites.json b/services/API-service/src/api/point-data/dto/example/MWI/flash-floods/health_sites.json index 408ce8e32..16ed2f600 100644 --- a/services/API-service/src/api/point-data/dto/example/MWI/flash-floods/health_sites.json +++ b/services/API-service/src/api/point-data/dto/example/MWI/flash-floods/health_sites.json @@ -1,10 +1,9 @@ { - "24-hour": [ - { "fid": "16", "value": true} - ], + "0-hour": [], "6-hour": [ - { "fid": "76", "value": true}, - { "fid": "146", "value": true}, - { "fid": "356", "value": true} - ] + { "fid": "76", "value": true }, + { "fid": "146", "value": true }, + { "fid": "356", "value": true } + ], + "24-hour": [{ "fid": "16", "value": true }] } diff --git a/services/API-service/src/api/point-data/dto/example/MWI/flash-floods/schools.json b/services/API-service/src/api/point-data/dto/example/MWI/flash-floods/schools.json index 05ecf422c..1cf7c9cd1 100644 --- a/services/API-service/src/api/point-data/dto/example/MWI/flash-floods/schools.json +++ b/services/API-service/src/api/point-data/dto/example/MWI/flash-floods/schools.json @@ -1,9 +1,13 @@ { + "0-hour": [ + { "fid": "606118", "value": true }, + { "fid": "606075", "value": true } + ], "6-hour": [ - { "fid": "334", "value": true}, - { "fid": "359", "value": true}, - { "fid": "130", "value": true}, - { "fid": "234", "value": true} + { "fid": "334", "value": true }, + { "fid": "359", "value": true }, + { "fid": "130", "value": true }, + { "fid": "234", "value": true } ], "24-hour": [] } diff --git a/services/API-service/src/api/point-data/dto/example/MWI/flash-floods/waterpoints_internal.json b/services/API-service/src/api/point-data/dto/example/MWI/flash-floods/waterpoints_internal.json index d42ee109c..e791d1dcc 100644 --- a/services/API-service/src/api/point-data/dto/example/MWI/flash-floods/waterpoints_internal.json +++ b/services/API-service/src/api/point-data/dto/example/MWI/flash-floods/waterpoints_internal.json @@ -1,19 +1,20 @@ { - "24-hour": [ - { "fid": "11607", "value": true}, - { "fid": "3583", "value": true} - ], + "0-hour": [], "6-hour": [ - { "fid": "32309", "value": true}, - { "fid": "8088", "value": true}, - { "fid": "18275", "value": true}, - { "fid": "2669", "value": true}, - { "fid": "27789", "value": true}, - { "fid": "17311", "value": true}, - { "fid": "3751", "value": true}, - { "fid": "156", "value": true}, - { "fid": "3608", "value": true}, - { "fid": "25527", "value": true}, - { "fid": "32315", "value": true} + { "fid": "32309", "value": true }, + { "fid": "8088", "value": true }, + { "fid": "18275", "value": true }, + { "fid": "2669", "value": true }, + { "fid": "27789", "value": true }, + { "fid": "17311", "value": true }, + { "fid": "3751", "value": true }, + { "fid": "156", "value": true }, + { "fid": "3608", "value": true }, + { "fid": "25527", "value": true }, + { "fid": "32315", "value": true } + ], + "24-hour": [ + { "fid": "11607", "value": true }, + { "fid": "3583", "value": true } ] } diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-alert_threshold-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-alert_threshold-3.json index 48e896fdb..a3cb17b8e 100644 --- a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-alert_threshold-3.json +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-alert_threshold-3.json @@ -1,106 +1,34 @@ [ - { - "placeCode": "MW31531", - "amount": 1 - }, - { - "placeCode": "MW31532", - "amount": 1 - }, - { - "placeCode": "MW31533", - "amount": 1 - }, - { - "placeCode": "MW31534", - "amount": 1 - }, - { - "placeCode": "MW31535", - "amount": 1 - }, - { - "placeCode": "MW31536", - "amount": 1 - }, - { - "placeCode": "MW31537", - "amount": 1 - }, - { - "placeCode": "MW31538", - "amount": 1 - }, - { - "placeCode": "MW31539", - "amount": 1 - }, - { - "placeCode": "MW31540", - "amount": 1 - }, { "placeCode": "MW31541", - "amount": 1 - }, - { - "placeCode": "MW31542", - "amount": 1 - }, - { - "placeCode": "MW31543", - "amount": 1 - }, - { - "placeCode": "MW31544", - "amount": 1 - }, - { - "placeCode": "MW31545", - "amount": 1 - }, - { - "placeCode": "MW31546", - "amount": 1 - }, - { - "placeCode": "MW31547", - "amount": 1 + "amount": 1.0 }, { "placeCode": "MW31548", - "amount": 1 + "amount": 1.0 }, { "placeCode": "MW31549", - "amount": 1 - }, - { - "placeCode": "MW31550", - "amount": 1 - }, - { - "placeCode": "MW31551", - "amount": 1 + "amount": 1.0 }, { - "placeCode": "MW31552", - "amount": 1 + "placeCode": "MW31542", + "amount": 1.0 }, { - "placeCode": "MW31553", - "amount": 1 + "placeCode": "MW31536", + "amount": 1.0 }, { - "placeCode": "MW31554", - "amount": 1 + "placeCode": "MW31535", + "amount": 1.0 }, { - "placeCode": "MW31555", - "amount": 1 + "placeCode": "MW31534", + "amount": 1.0 }, { - "placeCode": "MW31556", - "amount": 1 + "placeCode": "MW31547", + "amount": 1.0 } ] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-damage_estimation-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-damage_estimation-3.json index 58b9d71c4..c78d0b7fb 100644 --- a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-damage_estimation-3.json +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-damage_estimation-3.json @@ -1,106 +1,34 @@ [ - { - "placeCode": "MW31531", - "amount": 10000 - }, - { - "placeCode": "MW31532", - "amount": 10000 - }, - { - "placeCode": "MW31533", - "amount": 10000 - }, - { - "placeCode": "MW31534", - "amount": 10000 - }, - { - "placeCode": "MW31535", - "amount": 10000 - }, - { - "placeCode": "MW31536", - "amount": 10000 - }, - { - "placeCode": "MW31537", - "amount": 10000 - }, - { - "placeCode": "MW31538", - "amount": 10000 - }, - { - "placeCode": "MW31539", - "amount": 10000 - }, - { - "placeCode": "MW31540", - "amount": 10000 - }, { "placeCode": "MW31541", - "amount": 10000 - }, - { - "placeCode": "MW31542", - "amount": 10000 - }, - { - "placeCode": "MW31543", - "amount": 10000 - }, - { - "placeCode": "MW31544", - "amount": 10000 - }, - { - "placeCode": "MW31545", - "amount": 10000 - }, - { - "placeCode": "MW31546", - "amount": 10000 - }, - { - "placeCode": "MW31547", - "amount": 10000 + "amount": 8.7372205e8 }, { "placeCode": "MW31548", - "amount": 10000 + "amount": 0.0 }, { "placeCode": "MW31549", - "amount": 10000 - }, - { - "placeCode": "MW31550", - "amount": 10000 - }, - { - "placeCode": "MW31551", - "amount": 10000 + "amount": 2.03924992e9 }, { - "placeCode": "MW31552", - "amount": 10000 + "placeCode": "MW31542", + "amount": 1.37519526e9 }, { - "placeCode": "MW31553", - "amount": 10000 + "placeCode": "MW31536", + "amount": 9.9143635e8 }, { - "placeCode": "MW31554", - "amount": 10000 + "placeCode": "MW31535", + "amount": 0.0 }, { - "placeCode": "MW31555", - "amount": 10000 + "placeCode": "MW31534", + "amount": 1.42163226e9 }, { - "placeCode": "MW31556", - "amount": 10000 + "placeCode": "MW31547", + "amount": 1.25558096e8 } ] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_buildings-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_buildings-3.json index 48e896fdb..5066aeb40 100644 --- a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_buildings-3.json +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_buildings-3.json @@ -1,106 +1,34 @@ [ - { - "placeCode": "MW31531", - "amount": 1 - }, - { - "placeCode": "MW31532", - "amount": 1 - }, - { - "placeCode": "MW31533", - "amount": 1 - }, - { - "placeCode": "MW31534", - "amount": 1 - }, - { - "placeCode": "MW31535", - "amount": 1 - }, - { - "placeCode": "MW31536", - "amount": 1 - }, - { - "placeCode": "MW31537", - "amount": 1 - }, - { - "placeCode": "MW31538", - "amount": 1 - }, - { - "placeCode": "MW31539", - "amount": 1 - }, - { - "placeCode": "MW31540", - "amount": 1 - }, { "placeCode": "MW31541", - "amount": 1 - }, - { - "placeCode": "MW31542", - "amount": 1 - }, - { - "placeCode": "MW31543", - "amount": 1 - }, - { - "placeCode": "MW31544", - "amount": 1 - }, - { - "placeCode": "MW31545", - "amount": 1 - }, - { - "placeCode": "MW31546", - "amount": 1 - }, - { - "placeCode": "MW31547", - "amount": 1 + "amount": 67.0 }, { "placeCode": "MW31548", - "amount": 1 + "amount": 318.0 }, { "placeCode": "MW31549", - "amount": 1 - }, - { - "placeCode": "MW31550", - "amount": 1 - }, - { - "placeCode": "MW31551", - "amount": 1 + "amount": 413.0 }, { - "placeCode": "MW31552", - "amount": 1 + "placeCode": "MW31542", + "amount": 199.0 }, { - "placeCode": "MW31553", - "amount": 1 + "placeCode": "MW31536", + "amount": 158.0 }, { - "placeCode": "MW31554", - "amount": 1 + "placeCode": "MW31535", + "amount": 808.0 }, { - "placeCode": "MW31555", - "amount": 1 + "placeCode": "MW31534", + "amount": 173.0 }, { - "placeCode": "MW31556", - "amount": 1 + "placeCode": "MW31547", + "amount": 4.0 } ] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_clinics-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_clinics-3.json index 48e896fdb..71189adf2 100644 --- a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_clinics-3.json +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_clinics-3.json @@ -1,106 +1,34 @@ [ - { - "placeCode": "MW31531", - "amount": 1 - }, - { - "placeCode": "MW31532", - "amount": 1 - }, - { - "placeCode": "MW31533", - "amount": 1 - }, - { - "placeCode": "MW31534", - "amount": 1 - }, - { - "placeCode": "MW31535", - "amount": 1 - }, - { - "placeCode": "MW31536", - "amount": 1 - }, - { - "placeCode": "MW31537", - "amount": 1 - }, - { - "placeCode": "MW31538", - "amount": 1 - }, - { - "placeCode": "MW31539", - "amount": 1 - }, - { - "placeCode": "MW31540", - "amount": 1 - }, { "placeCode": "MW31541", - "amount": 1 - }, - { - "placeCode": "MW31542", - "amount": 1 - }, - { - "placeCode": "MW31543", - "amount": 1 - }, - { - "placeCode": "MW31544", - "amount": 1 - }, - { - "placeCode": "MW31545", - "amount": 1 - }, - { - "placeCode": "MW31546", - "amount": 1 - }, - { - "placeCode": "MW31547", - "amount": 1 + "amount": 0.0 }, { "placeCode": "MW31548", - "amount": 1 + "amount": 0.0 }, { "placeCode": "MW31549", - "amount": 1 - }, - { - "placeCode": "MW31550", - "amount": 1 - }, - { - "placeCode": "MW31551", - "amount": 1 + "amount": 0.0 }, { - "placeCode": "MW31552", - "amount": 1 + "placeCode": "MW31542", + "amount": 0.0 }, { - "placeCode": "MW31553", - "amount": 1 + "placeCode": "MW31536", + "amount": 0.0 }, { - "placeCode": "MW31554", - "amount": 1 + "placeCode": "MW31535", + "amount": 0.0 }, { - "placeCode": "MW31555", - "amount": 1 + "placeCode": "MW31534", + "amount": 0.0 }, { - "placeCode": "MW31556", - "amount": 1 + "placeCode": "MW31547", + "amount": 0.0 } ] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_roads-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_roads-3.json index 48e896fdb..23d1784ab 100644 --- a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_roads-3.json +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_roads-3.json @@ -1,106 +1,34 @@ [ - { - "placeCode": "MW31531", - "amount": 1 - }, - { - "placeCode": "MW31532", - "amount": 1 - }, - { - "placeCode": "MW31533", - "amount": 1 - }, - { - "placeCode": "MW31534", - "amount": 1 - }, - { - "placeCode": "MW31535", - "amount": 1 - }, - { - "placeCode": "MW31536", - "amount": 1 - }, - { - "placeCode": "MW31537", - "amount": 1 - }, - { - "placeCode": "MW31538", - "amount": 1 - }, - { - "placeCode": "MW31539", - "amount": 1 - }, - { - "placeCode": "MW31540", - "amount": 1 - }, { "placeCode": "MW31541", - "amount": 1 - }, - { - "placeCode": "MW31542", - "amount": 1 - }, - { - "placeCode": "MW31543", - "amount": 1 - }, - { - "placeCode": "MW31544", - "amount": 1 - }, - { - "placeCode": "MW31545", - "amount": 1 - }, - { - "placeCode": "MW31546", - "amount": 1 - }, - { - "placeCode": "MW31547", - "amount": 1 + "amount": 28.0 }, { "placeCode": "MW31548", - "amount": 1 + "amount": 39.0 }, { "placeCode": "MW31549", - "amount": 1 - }, - { - "placeCode": "MW31550", - "amount": 1 - }, - { - "placeCode": "MW31551", - "amount": 1 + "amount": 43.0 }, { - "placeCode": "MW31552", - "amount": 1 + "placeCode": "MW31542", + "amount": 29.0 }, { - "placeCode": "MW31553", - "amount": 1 + "placeCode": "MW31536", + "amount": 16.0 }, { - "placeCode": "MW31554", - "amount": 1 + "placeCode": "MW31535", + "amount": 74.0 }, { - "placeCode": "MW31555", - "amount": 1 + "placeCode": "MW31534", + "amount": 49.0 }, { - "placeCode": "MW31556", - "amount": 1 + "placeCode": "MW31547", + "amount": 19.0 } ] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_schools-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_schools-3.json index 48e896fdb..53488053a 100644 --- a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_schools-3.json +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_schools-3.json @@ -1,106 +1,34 @@ [ - { - "placeCode": "MW31531", - "amount": 1 - }, - { - "placeCode": "MW31532", - "amount": 1 - }, - { - "placeCode": "MW31533", - "amount": 1 - }, - { - "placeCode": "MW31534", - "amount": 1 - }, - { - "placeCode": "MW31535", - "amount": 1 - }, - { - "placeCode": "MW31536", - "amount": 1 - }, - { - "placeCode": "MW31537", - "amount": 1 - }, - { - "placeCode": "MW31538", - "amount": 1 - }, - { - "placeCode": "MW31539", - "amount": 1 - }, - { - "placeCode": "MW31540", - "amount": 1 - }, { "placeCode": "MW31541", - "amount": 1 - }, - { - "placeCode": "MW31542", - "amount": 1 - }, - { - "placeCode": "MW31543", - "amount": 1 - }, - { - "placeCode": "MW31544", - "amount": 1 - }, - { - "placeCode": "MW31545", - "amount": 1 - }, - { - "placeCode": "MW31546", - "amount": 1 - }, - { - "placeCode": "MW31547", - "amount": 1 + "amount": 0.0 }, { "placeCode": "MW31548", - "amount": 1 + "amount": 0.0 }, { "placeCode": "MW31549", - "amount": 1 - }, - { - "placeCode": "MW31550", - "amount": 1 - }, - { - "placeCode": "MW31551", - "amount": 1 + "amount": 0.0 }, { - "placeCode": "MW31552", - "amount": 1 + "placeCode": "MW31542", + "amount": 0.0 }, { - "placeCode": "MW31553", - "amount": 1 + "placeCode": "MW31536", + "amount": 1.0 }, { - "placeCode": "MW31554", - "amount": 1 + "placeCode": "MW31535", + "amount": 0.0 }, { - "placeCode": "MW31555", - "amount": 1 + "placeCode": "MW31534", + "amount": 0.0 }, { - "placeCode": "MW31556", - "amount": 1 + "placeCode": "MW31547", + "amount": 1.0 } ] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_waterpoints-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_waterpoints-3.json index 48e896fdb..71189adf2 100644 --- a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_waterpoints-3.json +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-nr_affected_waterpoints-3.json @@ -1,106 +1,34 @@ [ - { - "placeCode": "MW31531", - "amount": 1 - }, - { - "placeCode": "MW31532", - "amount": 1 - }, - { - "placeCode": "MW31533", - "amount": 1 - }, - { - "placeCode": "MW31534", - "amount": 1 - }, - { - "placeCode": "MW31535", - "amount": 1 - }, - { - "placeCode": "MW31536", - "amount": 1 - }, - { - "placeCode": "MW31537", - "amount": 1 - }, - { - "placeCode": "MW31538", - "amount": 1 - }, - { - "placeCode": "MW31539", - "amount": 1 - }, - { - "placeCode": "MW31540", - "amount": 1 - }, { "placeCode": "MW31541", - "amount": 1 - }, - { - "placeCode": "MW31542", - "amount": 1 - }, - { - "placeCode": "MW31543", - "amount": 1 - }, - { - "placeCode": "MW31544", - "amount": 1 - }, - { - "placeCode": "MW31545", - "amount": 1 - }, - { - "placeCode": "MW31546", - "amount": 1 - }, - { - "placeCode": "MW31547", - "amount": 1 + "amount": 0.0 }, { "placeCode": "MW31548", - "amount": 1 + "amount": 0.0 }, { "placeCode": "MW31549", - "amount": 1 - }, - { - "placeCode": "MW31550", - "amount": 1 - }, - { - "placeCode": "MW31551", - "amount": 1 + "amount": 0.0 }, { - "placeCode": "MW31552", - "amount": 1 + "placeCode": "MW31542", + "amount": 0.0 }, { - "placeCode": "MW31553", - "amount": 1 + "placeCode": "MW31536", + "amount": 0.0 }, { - "placeCode": "MW31554", - "amount": 1 + "placeCode": "MW31535", + "amount": 0.0 }, { - "placeCode": "MW31555", - "amount": 1 + "placeCode": "MW31534", + "amount": 0.0 }, { - "placeCode": "MW31556", - "amount": 1 + "placeCode": "MW31547", + "amount": 0.0 } ] diff --git a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-population_affected-3.json b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-population_affected-3.json index cae9456f7..297e1599e 100644 --- a/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-population_affected-3.json +++ b/services/API-service/src/scripts/mock-data/flash-floods/MWI/trigger/Blantyre City/upload-population_affected-3.json @@ -1,106 +1,34 @@ [ - { - "placeCode": "MW31531", - "amount": 100 - }, - { - "placeCode": "MW31532", - "amount": 100 - }, - { - "placeCode": "MW31533", - "amount": 100 - }, - { - "placeCode": "MW31534", - "amount": 100 - }, - { - "placeCode": "MW31535", - "amount": 100 - }, - { - "placeCode": "MW31536", - "amount": 100 - }, - { - "placeCode": "MW31537", - "amount": 100 - }, - { - "placeCode": "MW31538", - "amount": 100 - }, - { - "placeCode": "MW31539", - "amount": 100 - }, - { - "placeCode": "MW31540", - "amount": 100 - }, { "placeCode": "MW31541", - "amount": 100 - }, - { - "placeCode": "MW31542", - "amount": 100 - }, - { - "placeCode": "MW31543", - "amount": 100 - }, - { - "placeCode": "MW31544", - "amount": 100 - }, - { - "placeCode": "MW31545", - "amount": 100 - }, - { - "placeCode": "MW31546", - "amount": 100 - }, - { - "placeCode": "MW31547", - "amount": 100 + "amount": 174.0 }, { "placeCode": "MW31548", - "amount": 100 + "amount": 671.0 }, { "placeCode": "MW31549", - "amount": 100 - }, - { - "placeCode": "MW31550", - "amount": 100 - }, - { - "placeCode": "MW31551", - "amount": 100 + "amount": 390.0 }, { - "placeCode": "MW31552", - "amount": 100 + "placeCode": "MW31542", + "amount": 209.0 }, { - "placeCode": "MW31553", - "amount": 100 + "placeCode": "MW31536", + "amount": 432.0 }, { - "placeCode": "MW31554", - "amount": 100 + "placeCode": "MW31535", + "amount": 1953.0 }, { - "placeCode": "MW31555", - "amount": 100 + "placeCode": "MW31534", + "amount": 357.0 }, { - "placeCode": "MW31556", - "amount": 100 + "placeCode": "MW31547", + "amount": 59.0 } ] diff --git a/services/API-service/src/scripts/mock-helper.service.ts b/services/API-service/src/scripts/mock-helper.service.ts index 8098b407a..a3f3e4e6d 100644 --- a/services/API-service/src/scripts/mock-helper.service.ts +++ b/services/API-service/src/scripts/mock-helper.service.ts @@ -31,7 +31,7 @@ export class MockHelperService { return; } - for (const leadTime of [LeadTime.hour24, LeadTime.hour6]) { + for (const leadTime of [LeadTime.hour24, LeadTime.hour6, LeadTime.hour0]) { for (const assetType of Object.keys(LinesDataEnum)) { const payload = new UploadLinesExposureStatusDto(); payload.countryCodeISO3 = countryCodeISO3; @@ -132,18 +132,18 @@ export class MockHelperService { } // NOTE: this makes sure mock raster files are uploaded only once. If your intention is to have a different file, comment this out temporarily. - const subfolder = - DisasterTypeGeoServerMapper.getSubfolderForDisasterType(disasterType); - if ( - fs.existsSync( - `./geoserver-volume/raster-files/output/${subfolder}/${destFileName}`, - ) - ) { - console.log( - `File ${destFileName} already exists in output folder. Skipping.`, - ); - continue; - } + // const subfolder = + // DisasterTypeGeoServerMapper.getSubfolderForDisasterType(disasterType); + // if ( + // fs.existsSync( + // `./geoserver-volume/raster-files/output/${subfolder}/${destFileName}`, + // ) + // ) { + // console.log( + // `File ${destFileName} already exists in output folder. Skipping.`, + // ); + // continue; + // } // END NOTE let file; @@ -175,6 +175,8 @@ export class MockHelperService { ) { const directoryPath = './geoserver-volume/raster-files/mock-output/'; const leadTimeUnit = leadTime.replace(/\d+-/, ''); + const leadTimePart = + disasterType === DisasterType.FlashFloods ? leadTime : leadTimeUnit; if (!fs.existsSync(directoryPath)) { console.log(`Directory ${directoryPath} does not exist.`); @@ -194,7 +196,7 @@ export class MockHelperService { [DisasterType.HeavyRain, DisasterType.Drought].includes(disasterType) ? '-triggered.tif' : '.tif'; - const filename = `${layerStorePrefix}_${leadTimeUnit}_${countryCodeISO3}${suffix}`; + const filename = `${layerStorePrefix}_${leadTimePart}_${countryCodeISO3}${suffix}`; const fileExists = files.includes(filename); if (fileExists) { return filename; @@ -222,15 +224,17 @@ export class MockHelperService { ); // from the numbers, find the closest number to the leadTimeNumber let closestNumber = numbersFromClosestFiles[0]; - for (let i = 1; i < numbersFromClosestFiles.length; i++) { + let index: number; + for (let i = 0; i < numbersFromClosestFiles.length; i++) { if ( Math.abs(numbersFromClosestFiles[i] - leadTimeNumber) < Math.abs(closestNumber - leadTimeNumber) ) { closestNumber = numbersFromClosestFiles[i]; + index = i; } } - return null; + return closestFiles[index]; } }