[GRASS-git] [OSGeo/grass-addons] a504f5: v.rast.move: Move points by values from raster map...

Vaclav Petras noreply at github.com
Tue Jul 18 17:53:15 PDT 2023

  Branch: refs/heads/grass8
  Home:   https://github.com/OSGeo/grass-addons
  Commit: a504f5e589841f272598df1c736e6db64c2f3a46
  Author: Vaclav Petras <wenzeslaus at gmail.com>
  Date:   2023-07-18 (Tue, 18 Jul 2023)

  Changed paths:
    A src/vector/v.rast.move/Makefile
    A src/vector/v.rast.move/examples.ipynb
    A src/vector/v.rast.move/tests/conftest.py
    A src/vector/v.rast.move/tests/test_v_rast_move.py
    A src/vector/v.rast.move/v.rast.move.html
    A src/vector/v.rast.move/v.rast.move.py
    A src/vector/v.rast.move/v_rast_move.png

  Log Message:
  v.rast.move: Move points by values from raster map (#877)

Move of vector features positions by X and Y values given in two raster maps. This can move linear features without breaking the visual connection as points falling into the same raster cell are shifted by the same value.

The name is v.rast.move because it moves vector using raster values (operates on vectors but the big deal is that it is using raster to do the moving). Alternative name would be v.rast.displacement. Original name was v.move.points.

The one example included now shows the principle, moves in X direction both ways depending on the raster values. My use case is randomizing a set of lines (connected and not connected).

Unlike v.perturb which moves points randomly, this works on lines and keeps the values at a given cell. Unlike v.transform combined with raster values in attribute columns, this operates on individual points in the line, not on the whole line.

Copies first category, assumes layer 1. Drops attributes. 

Handles null values and extent mismatch. Warns about the nulls by default. Warns when integers are used (different null check is needed but not implemented).

More information about the grass-commit mailing list