Skip to content

Commit

Permalink
v.to.rast: Change use=val to use=value (#3110)
Browse files Browse the repository at this point in the history
The use parameter (option) had value 'val' while the parameter which is using that is called value. This makes it consistent, so use=value and value=1, not use=val and value=1. Both can be shortened, so even use=val and val=1 are still valid parameters.

This changes code which is using v.to.rast.

This does not change the other possible values (options), namely attr, cat, and dir.
  • Loading branch information
wenzeslaus authored Nov 8, 2023
1 parent 7c64bcf commit 698a47e
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion gui/wxpython/rlisetup/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ def convertFeature(vect, outrast, cat, origrast, layer="1", overwrite=False):
input=tmp_vect,
type="area",
layer=layer,
use="val",
use="value",
value=cat,
output=outrast,
overwrite=overwrite,
Expand Down
4 changes: 3 additions & 1 deletion gui/wxpython/rlisetup/sampling_frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,9 @@ def writeArea(self, coords, rasterName):
"r.to.vect", input=tmpraster, output=tmpvector, type="area", overwrite=True
)

RunCommand("v.to.rast", input=tmpvector, output=rasterName, value=1, use="val")
RunCommand(
"v.to.rast", input=tmpvector, output=rasterName, value=1, use="value"
)
wx.EndBusyCursor()
grass.use_temp_region()
grass.run_command("g.region", vector=tmpvector)
Expand Down
4 changes: 2 additions & 2 deletions scripts/r.mask/r.mask.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,8 @@ def main():
input=to_rast_input,
layer=layer,
output="MASK",
use="val",
val="1",
use="value",
value="1",
type="area",
cats=cats,
where=where,
Expand Down
6 changes: 3 additions & 3 deletions vector/v.to.rast/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,10 @@ int main(int argc, char *argv[])
use_opt->type = TYPE_STRING;
use_opt->required = YES;
use_opt->multiple = NO;
use_opt->options = "attr,cat,val,z,dir";
use_opt->options = "attr,cat,value,z,dir";
use_opt->description = _("Source of raster values");
desc = NULL;
G_asprintf(&desc, "attr;%s;cat;%s;val;%s;z;%s;dir;%s",
G_asprintf(&desc, "attr;%s;cat;%s;value;%s;z;%s;dir;%s",
_("read values from attribute table"), _("use category values"),
_("use value specified by value option"),
_("use z coordinate (points or contours only)"),
Expand Down Expand Up @@ -104,7 +104,7 @@ int main(int argc, char *argv[])
val_opt->required = NO;
val_opt->multiple = NO;
val_opt->answer = "1";
val_opt->description = _("Raster value (for use=val)");
val_opt->description = _("Raster value (for use=value)");

memory = G_define_standard_option(G_OPT_MEMORYMB);

Expand Down
4 changes: 2 additions & 2 deletions vector/v.to.rast/v.to.rast.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ <h2>NOTES</h2>
<li>
<em>cat</em> - read values from category
<li>
<em>val</em> - use value specified by <em><b>value</b></em> option
<em>value</em> - use value specified by <em><b>value</b></em> option
<li>
<em>z</em> - use z coordinate (points or contours only)
<li>
Expand Down Expand Up @@ -65,7 +65,7 @@ <h2>NOTES</h2>
<p>
Boundaries (usually without categories) can be rasterized with
<div class="code"><pre>
v.to.rast type=boundary layer=-1 use=val
v.to.rast type=boundary layer=-1 use=value
</pre></div>

<h2>EXAMPLES</h2>
Expand Down

0 comments on commit 698a47e

Please sign in to comment.