GFDRR / thinkhazard

ThinkHazard!
http://thinkhazard.org/
GNU General Public License v3.0
32 stars 19 forks source link

A5 - Map toggle view #689

Closed pgiraud closed 7 years ago

pgiraud commented 7 years ago

Toggle between color-coded admin breakdown and hazard (raw) maps.

fjacon commented 7 years ago

We have to discuss the design for this feature. For the moment, the best way for a user is to go directly to geonode. The link is actually available from data source below the map.

stufraser1 commented 7 years ago

Preferred design: Tab or button to enable user to 'swap' from the default view of hazard levels on map (as currently used), to a map in the same place with hazard data raster shown overlaid with admin boundaries, using the same map window and extent. Legend below map to show the legend and style from Geonode.

Only one hazard map can be shown on this map. Selection of on RP where several are used in hazard classification is based on the RP usually shown by the peril experts: EQ: [475, 500] (whichever is used for medium hazard) RF, UF, CF: 100 CY: VO: preprocessed layer LS: susceptibilty map DR: 50 TS: Pre-processed for now, but [500] hopefully in the future when we have probabilistic maps EH: To be agreed with the consortium developing WF: To be agreed with the consortium developing

pgiraud commented 7 years ago

@stufraser1 I wanted to share a prototype of what this could look like. http://wb-thinkhazard.dev.sig.cloud.camptocamp.net/toggle_view/report/18114-indonesia-kalimantan-selatan-kota-baru/FL

screenshot from 2017-02-20 15 37 32 screenshot from 2017-02-20 15 37 01

This demo is limited to Indonesia and the River Flood hazard type. Map layer and legend are static. Can you please give us your feedback on the usability?

Then, there's one issue we need to address. There are some rare cases where there are several possible data sources for the same division for a given hazard type. In this case, the button "data source" could be replaced by something looking like the following. screenshot from 2017-02-20 15 33 57

What do you think?

stufraser1 commented 7 years ago

This looks good. A few requests:

stufraser1 commented 7 years ago

Please reduce the space taken up by hazard level legend and move data source link up towards the map. Given that the hazard data legend goes from top to bottom, and we will hopefully have the data source on the right hand side of that, please can we also place the hazard level legened in that vertical arrangement (high at top, down to very low at bottom) in one column. If the legend and link are in the same place on both hazard level and data map it will look and operate better for user. Thanks

tonio commented 7 years ago

Following mockup shows how we could implement a widget to choose the layer shown as a data source, by selecting the corresponding RP.

The button in the map toggles between hazard level & data source, then you could choose alternative RP to be shown in the map.

screenshot from 2017-04-10 09-37-03

stufraser1 commented 7 years ago

Yes I like this.

fvanderbiest commented 7 years ago

Notes for implementation by @tonio...

You should read https://github.com/GFDRR/thinkhazard/blob/master/thinkhazard/models.py first.

The Output object is a result of the processing steps, and links a HazardSet (a group of 3 layers sharing a common id in geonode) with an AdministrativeDivision and a HazardLevel (eg: "very high earthquake risk").

For the given AdministrativeDivision & HazardLevel of the page, you should be able to identify the HazardSet responsible for the hazardlevel classification.

An HazardSet is aware of its layers (through https://github.com/GFDRR/thinkhazard/blob/master/thinkhazard/models.py#L635-L637). There's one layer per RP.

TH harvests http://www.geonode-gfdrrlab.org/api/layers/ and creates Layer objects in the db.

Let's take Layer Metadata with id = 1043 as an example. It has hazard_period: "975" & hazard_set: "EQ-ALS-GEM"

The corresponding geoserver layer name can be inferred from the detail_url or download_url fields :

=> layer als07_975yr is served by http://www.geonode-gfdrrlab.org/geoserver/hazard/ows This is the information you need to display the corresponding layer in the UI !

As a result, our Layer model has to be improved to access the layer name, eg:

    def layername(self):
        return self.detail_url.split(':').pop()
tonio commented 7 years ago

I put a demo of the feature here. Preselected RP is the one used to calculate level. Link is done with the corresponding geoserver layer.

stufraser1 commented 7 years ago

This looks great. I would be happy with this, but two small adjustments to text would make it perfect, I think:

1) Intensity unit for flood shows as 'm' but we need a descriptor - e.g., 'depth m' or 'windspeed km/h'. As this label is derived from intensity unit in layer metadata, should we update the intensity unit in metadata to read 'depth m', for example, or at the points where unit is tranlsated from metadata field (meters) to abbreviated unit (m). This shouldn't affect all hazards, as the metadata field is more descriptice elsewhere: landslide susceptibility index, fire line intensity...

2) When users show the data source, the white space increases substantially with a large area empty beneath the legend. Can this empty space be minimised?

fjacon commented 7 years ago

Point 2 has been fixed a while ago.

stufraser1 commented 7 years ago
  1. not necessary at this stage. Closing