[GRASS-git] [OSGeo/grass] e0ce15: g.region: Add more detail into error messages (#1140)
Vaclav Petras
noreply at github.com
Sat Dec 5 20:26:51 PST 2020
Branch: refs/heads/master
Home: https://github.com/OSGeo/grass
Commit: e0ce1558e6d4bda6b9d189a308941cc67222e366
https://github.com/OSGeo/grass/commit/e0ce1558e6d4bda6b9d189a308941cc67222e366
Author: Vaclav Petras <wenzeslaus at gmail.com>
Date: 2020-12-05 (Sat, 05 Dec 2020)
Changed paths:
M lib/gis/adj_cellhd.c
Log Message:
-----------
g.region: Add more detail into error messages (#1140)
Messages such as 'Illegal col value' might be sufficient for a simple g.region call,
but g.region is called at many different places indirectly and underlying G_adjust_Cell_head/G_adjust_Cell_head3
are called outside of g.region, so just 'col' in the message does not make much sense anymore.
Additionally, tell the resolution value when row/col are zero or smaller.
This helps in the GUI or with g.region vector when extent is set separately from resolution and
default resolution in lat-lon can be much larger than the requested extent.
(Adjusting the resolution value in this case would go far beyond changing messages and
may go beyond what should happen.)
* This uses general terms (number of columns) instead of g.region options (col value).
G_adjust_Cell_head/G_adjust_Cell_head3 are a library functions after all.
* Uses g (shortest representation) used elsewhere instead of f for extent and resolution.
* Uses colon-value syntax for messages where possible (message text: value).
* Explains why the error was triggered or shows the offending value.
* There is some code duplication between G_adjust_Cell_head and G_adjust_Cell_head3 (as before).
More information about the grass-commit
mailing list