Skip to content

Commit

Permalink
t.rast.mapcalc: transfer semantic label (#2219)
Browse files Browse the repository at this point in the history
* t.rast.mapcalc: transfer semantic label, update manual
  • Loading branch information
metzm committed Feb 20, 2022
1 parent 79ff42d commit b02f902
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions python/grass/temporal/mapcalc.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,11 @@ def dataset_mapcalculator(
start, end, unit = sample_map_list[i].get_relative_time()
new_map.set_relative_time(start, end, unit)

# Set the semantic label
semantic_label = sample_map_list[i].metadata.get_semantic_label()
if semantic_label is not None:
new_map.set_semantic_label(semantic_label)

# Parse the temporal expressions
expr = _operator_parser(expr, sample_map_list[0], sample_map_list[i])
# Add the output map name
Expand Down
2 changes: 2 additions & 0 deletions temporal/t.rast.mapcalc/t.rast.mapcalc.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ <h2>NOTES</h2>
r.mapcalc expression="c_6 = if(8 == 5 || 8 == 6, (a8 + b8), (a8 * b8))"
</pre></div>
<p>
Semantic labels present in the sample dataset A will be transferred to
the output dataset.

<h2>EXAMPLES</h2>

Expand Down

0 comments on commit b02f902

Please sign in to comment.