t.rast.mapcalc: transfer semantic label#2219
Conversation
|
User documentation has been updated accordingly. |
|
Did jou consider to add a |
I tend to agree, dunno how complex it might be to implement though. But this remark would also be true for t.rast.algebra when creating a new strds representing a different variable from that of the inputs |
|
For NDVI, we at mundialis already have t.rast.ndvi where you can set the output semantic label such as "red_nir" or "blue_green", whichever bands you choose as input. Adding a |
IMHO, transferring one of the semantic labels to an output that can potentially combine several input strds into something different is not a good default option. I rather let it as it was (no semantic label) instead of getting output semantic labels that won't reflect what the output is, or at least give the user the chance to choose. The option in mundialis module sounds in line with this, if I'm getting it right. |
|
Just a stupid idea: In case of ndvi, the module knows exactly what it does, it performs ndvi computation on specific bands. Hence the automagically generated semantic labels can reflect this. Lets imagine a syntax that can be used to create the semantic label like this:
In case of ndvi computed from nir and red bands (semantic labels are 'red' and 'nir') this may be:
For a mapcalc operation, this may be complicated, since the meaning is in the algebraic expression. However,
Using the ndvi module this may add up to:
Just an idea of an ex-developer. |
|
@huhabla Interesting idea to sort of put the history into a semantic label, but IMHO much to complicated and most probably causing some SQL headache. The history is available with IMHO, these semantic labels should be kept fairly simple, with the main purpose to select particular raster maps in a STRDS by their label. In this sense it would be sufficient to have labels such as For good reason, |
|
This PR transfers semantic information from input to output. Without this semantic information, it might not be possible to interpret the results and relate output to input. |
* t.rast.mapcalc: transfer semantic label, update manual
* t.rast.mapcalc: transfer semantic label, update manual
* t.rast.mapcalc: transfer semantic label, update manual
* t.rast.mapcalc: transfer semantic label, update manual
More often than not, transferring the semantic label in
t.rast.mapcalcfrom the first input (also used as sampling reference for the time stamp) makes sense. If the semantic label gets lost, an unusable STRDS might be created.An example is application of a multiplication factor to a STRDS with Landsat or Sentinel bands where semantic labels must be preserved.