浏览代码

t.rast.mapcalc: transfer semantic label (#2219)

* t.rast.mapcalc: transfer semantic label, update manual
Markus Metz 3 年之前
父节点
当前提交
b02f902d7d
共有 2 个文件被更改,包括 7 次插入0 次删除
  1. 5 0
      python/grass/temporal/mapcalc.py
  2. 2 0
      temporal/t.rast.mapcalc/t.rast.mapcalc.html

+ 5 - 0
python/grass/temporal/mapcalc.py

@@ -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

+ 2 - 0
temporal/t.rast.mapcalc/t.rast.mapcalc.html

@@ -122,6 +122,8 @@ r.mapcalc expression="c_5 = if(7 == 5 || 7 == 6, (a7 + b7), (a7 * b7))"
 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>