Skip to content

Commit b02f902

Browse files
authored
t.rast.mapcalc: transfer semantic label (#2219)
* t.rast.mapcalc: transfer semantic label, update manual
1 parent 79ff42d commit b02f902

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

python/grass/temporal/mapcalc.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,11 @@ def dataset_mapcalculator(
288288
start, end, unit = sample_map_list[i].get_relative_time()
289289
new_map.set_relative_time(start, end, unit)
290290

291+
# Set the semantic label
292+
semantic_label = sample_map_list[i].metadata.get_semantic_label()
293+
if semantic_label is not None:
294+
new_map.set_semantic_label(semantic_label)
295+
291296
# Parse the temporal expressions
292297
expr = _operator_parser(expr, sample_map_list[0], sample_map_list[i])
293298
# Add the output map name

temporal/t.rast.mapcalc/t.rast.mapcalc.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,8 @@ <h2>NOTES</h2>
122122
r.mapcalc expression="c_6 = if(8 == 5 || 8 == 6, (a8 + b8), (a8 * b8))"
123123
</pre></div>
124124
<p>
125+
Semantic labels present in the sample dataset A will be transferred to
126+
the output dataset.
125127

126128
<h2>EXAMPLES</h2>
127129

0 commit comments

Comments
 (0)