[GRASS-git] [OSGeo/grass] a76e8a: r.geomorphon: Implement a new "one-off" mode (#1157)

Denis Ovsienko noreply at github.com
Fri Jan 29 21:15:54 PST 2021


  Branch: refs/heads/master
  Home:   https://github.com/OSGeo/grass
  Commit: a76e8a167b8ecaca699a9c6c8751fbd4d4e66d8d
      https://github.com/OSGeo/grass/commit/a76e8a167b8ecaca699a9c6c8751fbd4d4e66d8d
  Author: Denis Ovsienko <denis at ovsienko.info>
  Date:   2021-01-30 (Sat, 30 Jan 2021)

  Changed paths:
    M raster/r.geomorphon/geom.c
    M raster/r.geomorphon/local_proto.h
    M raster/r.geomorphon/main.c
    M raster/r.geomorphon/pattern.c
    A raster/r.geomorphon/profile.c
    M raster/r.geomorphon/r.geomorphon.html

  Log Message:
  -----------
  r.geomorphon: Implement a new "one-off" mode (#1157)

The only way to use the r.geomorhon has been to produce one or more raster
outputs from one raster input. Implement the scientific idea of Dàibhidh
Grannd (English Language and Linguistics, School of Critical Studies,
University of Glasgow) and add a new "one-off" mode.

In this mode r.geomorphon computes a single geomorphon for the given
coordinates and outputs assorted
computation-related data in a machine-readable format.
The machine-readable data has one of three
formats depending on the profileformat= option (JSON, YAML, XML).

In geom.c add a comment to explain what extends() returns, split
determine_ternary() into two functions and add a few new functions to
compute additional results.

In local_proto.h among other things extend the PATTERN typedef with
members for easting and northing of every cardinal point.

Add a new profile.c file with a number of functions to implement a
generic container for nested lightweight objects and to serialize the
contents in a text format of choice.
Most of the new code in profile.c is generic enough to be useful in other modules.
I did not go as far as making it a part of the library, but if you wish to do it later,
it should not be difficult.

In pattern.c add conditional blocks to calc_pattern() to save the right
temporary values into the new typedef members and the container after
deciding on the delta value (-1/0/1) and before they disappear.

In main.c add new G_parser() props and associated parsing/validation
code. Add a few small helper functions to translate numbers to text.
Modify the non-multires section to run through the raster buffer dry
when in the one-off mode until it reaches the point of interest, then
perform the computation and output the profile data using functions from
profile.c if and as requested.




More information about the grass-commit mailing list