Implementation of subset-aware function layers #1568
rafdouglas
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
If a function layer exposes an empty Linked with #1558 |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
UNDP - SDGi – GeoHub
Internal note
Proposal: implementation of
subset-aware function layers
March 16 th , 2023
Background
Currently we imported ~250 vector files into GeoHub.
Internally, PostgreSQL-side, these files are accessed as views which connect the flat data with geographical
admin0
features.This step was important to assess the data we have and get a first visualization.
However, some shortcomings emerged, namely:
Examples
Indicator 10.5.1:
Indicator 4.6.1:
1 file
6 available "time series":
Proposed implementation
The proposal would be therefore to create a set of subsettable functions to dynamically join geometry-less data with
admin0
features. Advantages:The concepts would be:
Dbf(s) →python code→
sdgxx.admin0
One PostgreSQL function per sdg code / indicator / series
Register & expose each PostgreSQL function as a vector layer (
{z}/{x}/{y}.pbf
)Subsets for [time series] / sex group / sex age / urban / others (these will become WHEREs in PostgreSQL)
Pull-down menu or time slider to select the year (field format:
value_{yyyy}
)The (partially) new feature would therefore be the presence of subsets.
Subset options will be exposed by the postgreSQL function via pg_tileserv's endpoints as JSON (similarly to what we have today for the Subnational Dynamic HDI function):
https://pgtileserv.undpgeohub.org/admin.dynamic_subnational_hdi/
{z}/{x}/{y}.pbf?params=
{"le_incr":{"value":11},"eys_incr":{"value":22},"mys_incr":{"value":33},"gni_incr":{"value":44}}
will become:
https://pgtileserv.undpgeohub.org/admin.dynamic_subnational_hdi/
{z}/{x}/{y}.pbf?params=
{"``values``":
{"le_incr":{"value":11},"eys_incr":{"value":22},"mys_incr":{"value":33},"gni_incr":{"value":44}},
"``subsets``":
{"sex_group":{"value":"Female","options":["Female","Male","Total"]},
"age_group":{"value":"18-24 years","options":["0-12 years","12-18 years","18-24 years","older than 24 years","total"]},
"location":{"value":"urban","options":["urban","rural","total"]}}}
Please note that the current "params" dictionary argument would become
params→values
, and the subsets would be udnerparams→subsets.
Optional/future subset could be:
Beta Was this translation helpful? Give feedback.
All reactions