clarity-h2020 / emikat

http://www.emikat.at/?lang=en
1 stars 0 forks source link

Support Impact Scenarios [RA/IA API] #9

Closed p-a-s-c-a-l closed 4 years ago

p-a-s-c-a-l commented 5 years ago

This is related to the implementation of Impact/Risk assessment model with EMIKAT. We need an API for triggering the calculation of a new impact scenario and for accessing the results. Adaptation Scenarios are addressed later!

Triggering can be done by the Scenario Selection UI as discussed here.

Accessing the results is already possible as described in this issue. We currently use them in the Table Component, the Map Component and the MCDA Tool.

The respective RA/IA Data Package Resource has to be updated accordingly and example request / response URLs (including WMS URLs for RA/IA maps) have to be added to the Wiki.

p-a-s-c-a-l commented 5 years ago

Example REST API URL

https://service.emikat.at/EmiKatTst/api/scenarios/2846/feature/view.2812/table/data

Questions:

Example WMS API URL

https://service.emikat.at/geoserver/clarity/wms?service=WMS&version=1.1.0&request=GetMap&layers=clarity:view.2813&styles=DamageLevel1Q&bbox=4650500.0,1942000.0,4713000.0,1995500.0&width=768&height=657&srs=EPSG:3035&format=image%2Fgif&cql_filter=HAZARD_EVENT_ID=1

Questions:

humerh commented 5 years ago

You need only replace the $emikat_id (for our example 2846). The term "view.2813" or "clarity:view.2813" is an anonomized notation of a specific report. (report_Id). This report_id does not change, if you change the study (or EmiKat-Scenario).

p-a-s-c-a-l commented 5 years ago

You need only replace the $emikat_id (for our example 2846).

Yes, but there's no $emikat_id in the WMS url.

humerh commented 5 years ago

There willl be the need to include also the $emikat_id in the WMS url.

We will update the definition of WMS-Call for Impact Layers also as a consequence of the big changes in model calculation. Then I will provide a new link.

p-a-s-c-a-l commented 5 years ago

The new Impact model is now implemented:

As WMS-Layers:

https://service.emikat.at/geoserver/clarity/wms?service=WMS&version=1.1.0&request=GetMap&layers=clarity%3Aview.2975&bbox=4672000.0%2C1979500.0%2C4687500.0%2C1988000.0&width=768&height=421&srs=EPSG%3A3035&format=image%2Fgif&CQL_FILTER=PROJECT_REF=1%20and%20PERIOD=%27Baseline%27%20AND%20RCP=%27Baseline%27%20AND%20FREQUENCE=%27Rare%27%20AND%20SZ_ID=2846&styles=DAMAGEQUANTITY

In this link you can adapt the follwing parameters:

PROJECT_REF=1 ... (for future selection of an alternate ADAPTATION variants) PERIOD='Baseline' ... (Alternatives are: '20110101-20401231', '20410101-20701231' and '20710101-21001231') RCP='Baseline' ... (Alternatives are: 'rcp26', 'rcp45' and 'rcp85') FREQUENCE='Rare' ... (Alternatives are: 'Occassional' or 'Frequent')

SZ_ID=2846 has to be set to the current $emikatID

The color schemas (STYLE colors) are currently fixed but not optimized !!!!

As JSON: https://service.emikat.at/EmiKatTst/api/scenarios/2846/feature/view.2975/table/data?rownum=10000&filter=PROJECT_REF%3D1&filter=PERIOD%3D'Baseline'&filter=RCP%3D'Baseline'&filter=FREQUENCE%3D'Rare'&filter=SZ_ID%3D2846

As CSV: https://service.emikat.at/EmiKatTst/api/scenarios/2846/feature/view.2975/table/csv?rownum=10000&filter=PROJECT_REF%3D1&filter=PERIOD%3D'Baseline'&filter=RCP%3D'Baseline'&filter=FREQUENCE%3D'Rare'&filter=SZ_ID%3D2846

or as GeoJSON https://service.emikat.at/EmiKatTst/api/scenarios/2846/feature/view.2975/table/geojson?rownum=10000&filter=PROJECT_REF%3D1&filter=PERIOD%3D'Baseline'&filter=RCP%3D'Baseline'&filter=FREQUENCE%3D'Rare'&filter=SZ_ID%3D2846

p-a-s-c-a-l commented 4 years ago

@humerh Can you please check what's wrong with this request?

Either the server is extremely slow or there is another problem, e.g. with from query parameters.

p-a-s-c-a-l commented 4 years ago

In order to re-enable the Scenario Analysis Application, we need a new view with the sums for the whole study area. We need furtherore the possibility to omit some or all filters to be able to compare across events, scenarios and / or time periods.

humerh commented 4 years ago

To get the total number of affected people:

https://service.emikat.at/EmiKatTst/api/scenarios/2846/feature/view.2994/table/data

You can filter this query also by the usual filter flags:

p-a-s-c-a-l commented 4 years ago

Thanks! Could you also include the original damage probability? I know this can be calculated on client side, but I prefer to work with the original values calculated by the model.

humerh commented 4 years ago

How should I do this? I cannot sum up the propabilities, and they are different for each cell. You can only do it again after building the sum:

Propability_StudyArea = EXPOSEDQUANTITY_StudyArea / DAMAGEQUANTITY_StudyArea.

DenoBeno commented 4 years ago

As discussed earlier today: is the per GRID_ID value of any use for the csis users?

In my opinion, the table view should sum over all grid cells and then show min/max/mean or mean/deviation values - for the whole project area.

Per grid data is only useful in combination with a map.

p-a-s-c-a-l commented 4 years ago

We had this already working.

Once the results have been validated and the data model has stabilised, we can update the table component. I propose to wait for the specification of the flood impact result, so we don't have to redo this again for floods.

p-a-s-c-a-l commented 4 years ago

RA/IA API available and working.