VEuPathDB / web-monorepo

A monorepo that contains all frontend code for VEuPathDB websites
Apache License 2.0
2 stars 0 forks source link

Map - new feature - user-control of geohash level #449

Open bobular opened 1 year ago

bobular commented 1 year ago

At the moment the Leaflet zoom level is converted via a pre-defined mapping to geohash level.

It would be nice to offer the user some control over this - I was thinking a +2 +1 0 -1 -2 (or perhaps just +1 0 -1) adjustment that the user could apply via a new UI element.

I think that's basically it. But if anyone can think of any unintended consequences, please comment.

The difficult part will be the UI design. How to distinguish two similar sets of controls, one for map zoom, the other for aggregation level.

Should this be when we start thinking about offering a choice of geohash or GADM polygon aggregation?

bobular commented 1 year ago

Thoughts on GADM aggregation:

What maximum admin level to go to? Don't want to go to levels where most countries have no data. But when it starts getting patchy, we can fill in the, say, admin5 level with admin4 data.

We should use the GADM IDs in special gadm_0 gadm_1 gadm_2 ... gadm_X variables that are marked as geoaggregation and hidden from users. Would require a reload after tweaking the gadm/PostGIS code and adding the new variables.

To start with we would continue to display regular markers in the center-of-mass location of the data, as we do with geohashes. But with PostGIS, the client may have rapid access to polygon data, so "choropleth markers" are a possibility (and for symmetry, in geohash mode, we could display shaded rectangles).

danicahelb commented 10 months ago

it would be nice to aggregate to the country level (ie, one marker per country) for individual studies where there are study sites in multiple countries. For these individual studies, it would be expected that most countries would NOT have data so the issue Bob raised above would not matter

bobular commented 10 months ago

geohash_0 (containing the empty string '' would be nice to have). Easiest route is to add it to the database and make sure all the code (back and front end) doesn't treat it as a false value. Some other things might break though - grid lines would have to be disabled.

This would be a reload-everything change.

geohash_0 has other uses, see https://github.com/VEuPathDB/web-monorepo/issues/417 (not sure if it's obvious what that's about, so here's an explanation: there are some marker configuration requests (for continuous vars IIRC) that make a global marker request at geohash_1 and then do a reduce to find the sum or min/max or something - if this could be done at geohash_0 we could avoid that)

bobular commented 6 months ago

Making a new ticket for aggregating by administrative region, will edit the title and reference this ticket in the new one.