The ways of combining two layers #2881
Closed
JinIgarashi
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am not sure what is the actual context of this feature. I think this can be explained by @iferencik
The term of
combination
of two layers may vary. If the question is to show a dataset only within user interested area (show electricity access data only for the poorest area, for instance), this can be implemented in multiple ways.1. create a new dataset by computing two layers values
for example, if both two layers are raster datasets, new dataset can be computed by two rasters' band values (Map algebra). This can be very powerful feature to combine two raster datasets into one, but how we are going to computer new value (new indicator or well known indicator) from two layers should be careful to design. The result of new dataset might be confusing users if that new indicator is not designed well.
However, computing well known indicator from various raster dataset can work well with this approach. For example, the case of computer Human Development Index (HDI) layer from four raster layers of life expectancy, expected year of schooling, mean year of scooling and GNI.
2. crop a dataset by using the area which is filtered by certain indicators
Another implementation idea of combining two layers is to simply crop a dataset by using another dataset's area. This can be implemented in different way depending on whether the dataset is vector or raster.
i) mask raster dataset (a) by another raster dataset (b) filtered by an indicator
Let's say (a) is a raster data for electricity access, (b) is a raster data for multidimensional poverty index (MPI). We can filter (a) by (b) indicator as follows.
To implement this, we may need another endpoints in titiler to consume two raster datasets to compute one dataset. For example, the endpoint can be like below (a rough idea).
GET
/api/cogs/composite?targetUrl={url of (a)}&indicatorUrl={url of (b)}&targetBand={band index of (a)}&indicatorBand={band index of (b)}&expression={expression}
- query params
- targetUrl: URL of COG dataset which is going to be filtered
- indicatorUrl: URL of COG dataset which has an indicator to filter (a) data
- targetBand: specify a band index of (a) data to be used
- indicatorBand: specify a band index of (b) data to be used
- expression: define a math expression to compute new raster band value
ii) crop raster/ filter vector dataset (a) by vector polygon area (c) filtered by an indicator (attribute)
I believe most of useful indicators which can be used for analytical works are generally able to be associated to an admin unit (country level, subnational level, etc). Currently, we don't have a good vector admin datasets with these indicators. However, the filtering a dataset by a certain vector polygon area can be much more straightforward compared to the former case if we have these indicators as vector dataset. The steps can be as follows.
Beta Was this translation helpful? Give feedback.
All reactions