[GRASS-git] [OSGeo/grass] fd0ea5: r.geomorphon: separate input from output (#1052)

Denis Ovsienko noreply at github.com
Tue Nov 17 01:43:04 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/OSGeo/grass
  Commit: fd0ea53d56b0f5c8a82ddd49a9e8abfc1be25c6a
      https://github.com/OSGeo/grass/commit/fd0ea53d56b0f5c8a82ddd49a9e8abfc1be25c6a
  Author: Denis Ovsienko <denis at ovsienko.info>
  Date:   2020-11-17 (Tue, 17 Nov 2020)

  Changed paths:
    M raster/r.geomorphon/main.c

  Log Message:
  -----------
  r.geomorphon: separate input from output (#1052)

* r.geomorphon: Use o_forms where it belongs

The for loops that iterate over opt_output[] started from hard-coded 1
(o_forms), which is the first output, but not the first element in the
array. Use the enumeration constant to iterate properly regardless of
the amount of any preceding items in the array. Remove a comment that no
longer applies.

* r.geomorphon: Lose IO.required

All the output rasters were hard-coded as not required regardless of
what was in the array, and the only input raster is a standard option
that is required by default, so just remove the field from the
structure.

* r.geomorphon: Separate input and output rasters

The input raster element did not belong to the array because it used
only two structure fields to store string constants that were excess for
a standard option anyway; it also created a place for an off-by-one
error in every loop over the array. Remove the element from the array,
merge the single-use type into the only declaration that needs it and
constify some fields. Rename io_size to o_size, remove i_dem, UNKNOWN
and a stale comment.




More information about the grass-commit mailing list