d.rast.arrow(1grass)
β¨ d.rast.arrow β NAME β¨
okay so bestie, welcome to d.rast.arrow, a page from the GRASS User's Manual (d.rast.arrow(1grass), iykyk) π
This one draws arrows representing cell aspect direction for a raster map that's holding aspect data. That's the whole vibe. Directional slay. π§β¨
π·οΈ KEYWORDS β¨
display, map annotations, raster, arrow
π SYNOPSIS πΈ
d.rast.arrow
d.rast.arrow --help
d.rast.arrow [-a] map=name [type=string] [color=name]
[grid_color=name] [null_color=name] [unknown_color=name]
[skip=integer] [magnitude_map=string] [scale=float] [--help]
[--verbose] [--quiet] [--ui]
π© Flags π©
-aβ Align grids with raster cells β¨--helpβ Print usage summary π«Ά--verboseβ Verbose module output π--quietβ Quiet module output π€«--uiβ Force launching GUI dialog π
ποΈ Parameters ποΈ
map=name[required] β Name of raster aspect map to be displayed. this is the main character btw, cannot skip it πtype=stringβ Type of existing raster aspect map. Options:grass,compass,drainage,agnps,answers,terraflowDefault:grassπ±color=nameβ Color for drawing arrows. Either a standard color name orR:G:Btriplet. Default:greenπgrid_color=nameβ Color for drawing drawing grid. Either a standard color name,R:G:Btriplet, or"none". Default:grayπ«οΈnull_color=nameβ Color for drawing null values (Xsymbol). Either a standard color name,R:G:Btriplet, or"none". Default:blackπ€unknown_color=nameβ Color for showing unknown information (?symbol). Either a standard color name,R:G:Btriplet, or"none". Default:redβ€οΈskip=integerβ Draw arrow every Nth grid cell. Default:1π’magnitude_map=stringβ Raster map containing values used for arrow length πscale=floatβ Scale factor for arrows (magnitude map). Default:1.0βοΈ
π DESCRIPTION π
ngl, d.rast.arrow is designed to help users better visualize surface water flow direction, as indicated in an aspect raster map layer. it's giving hydrology but make it fashion π§β¨
There are two ways to specify the aspect layer the program is to use, and both are valid, no gatekeeping here:
- display the aspect map layer on the graphics monitor before running
d.rast.arrow(the classic pre-game move) - set the
mapparameter to the name of the desired aspect map β this lets the arrows be drawn over any other maps already displayed on the graphics monitor, which is lowkey the more powerful option π
d.rast.arrow will draw an arrow over each displayed cell to indicate in which direction the cell slopes. If the aspect layer has a category value denoting locations of "unknown" aspect, d.rast.arrow draws a question mark over the displayed cells of that category. Cells containing null data will be marked with an "X". you can disable drawing of null data and unknown aspect values by setting its color to "none" β very "I don't want to see it, so I won't" energy π
When you specify the magnitude_map option, arrow lengths denoting magnitude will be extracted from the cell values of the specified map. In this case the tail of the arrow will be centered on the source cell. You may adjust the overall scale using the scale option. d.rast.arrow will ignore NULL and negative magnitudes, and will warn you if the debug level is set at 5 or higher. Be aware. β οΈ If your application uses negative values for magnitude, you can use r.mapcalc to prepare the magnitude map to suit your needs (absolute value, inverted direction and so on). periodt.
π NOTES π
By default, arrows are drawn at the size of a cell and cannot be seen if the raster map is relatively close in scale. so if you're squinting, that's why bestie π You can use the skip option to draw arrows every n-th cell in both directions if you are working with relatively high resolutions. It may be useful to disable the grid in this case, which is accomplished by setting its color to "none". declutter the vibe, always π
For GRASS and Compass type aspect maps, the cell values of the aspect map will determine the corresponding direction in 360 degrees. ANSWERS type aspect maps will be plotted in multiples of 15 degrees counterclockwise from east, and AGNPS and Drainage type aspect maps will be displayed in D8 representation, i.e. the eight multiples of 45 degrees. Cell values are 1 to 8 clockwise from north for AGNPS and 1 to 8 counterclockwise from north east for Drainage. See r.watershed for more details about the Drainage aspect. Terraflow (same as ArcGIS) type aspect map will use a power-of-two encoding clockwise from 1 for east to 128 for north east. See r.terraflow for more details about the Terraflow encoding. not me memorizing all these encodings π
GRASS aspect maps are measured using Cartesian conventions, i.e. in degrees counterclockwise from east. e.g.:
90 North
180 West
270 South
0,360 East
They can be created from a raster elevation map with r.slope.aspect. β¨
Compass type aspect maps are measured in degrees clockwise from north. π§
This module uses oceanographic conventions, i.e. arrows point downslope or direction "to", as opposed to atmospheric conventions (direction "from"). so if you're coming from a meteorology background, flip that mental model, bestie π
π EXAMPLE π
Convert U,V velocity component maps into magnitude,direction maps for use with d.rast.arrow:
r.mapcalc "magnitude = sqrt(U_map^2 + V_map^2)"
r.mapcalc "direction = atan(U_map, V_map)"
d.rast.arrow map=direction type=grass magnitude_map=magnitude skip=3 grid=none
Sea wind speed (magnitude) and direction shown in the Tasmanian Sea ππ¨
π SEE ALSO π
d.frame, d.rast, d.rast.edit, d.rast.num, g.region, r.slope.aspect, r.watershed, r.terraflow
go read those too, they're all part of the same friend group π«Ά
π AUTHORS π
Original author Chris Rewerts Agricultural Engineering, Purdue University
Magnitude and 360 arrow code Hamish Bowman Department of Marine Science, University of Otago, New Zealand
Align grids with raster cells and Drainage aspect type Huidae Cho
π SOURCE CODE π
Available at: d.rast.arrow source code (history)
Latest change: Thursday Feb 20 12:48:50 2025 in commit: 1633be4dc57dd1819a0f6ccd8ea4bc2b8bbec864
Main index | Display index | Topics index | Keywords index | Graphical index | Full index
and that's the whole thing, bestie, no cap π Β© 2003-2026 GRASS Development Team, GRASS 8.5.0 Reference Manual β yeah, the copyright and the version and all that, they're right here at the bottom where they belong, slay πβ¨
π¦ where this page comes from
- alpine 3.24: grass-gis-doc 8.5.0-r1 Β· GPL-2.0-or-later
- ubuntu stonking: grass-doc 8.5.0-1ubuntu1 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms