d.rast.edit(1)
π d.rast.edit β the glow-up page
okay so bestie, welcome to d.rast.edit(1), straight out of the GRASS GIS User's Manual β¨ this is the one where you literally draw on your raster map with a mouse and change the numbers. iconic behavior fr.
πΈ NAME
d.rast.edit β edits cell values in a raster map. that's it, that's the whole vibe π
π KEYWORDS
display, editing, raster
β¨ SYNOPSIS
d.rast.edit
d.rast.edit --help
d.rast.edit input=name output=name [aspect=name] [width=integer]
[height=integer] [size=integer] [rows=integer] [cols=integer]
[--overwrite] [--help] [--verbose] [--quiet] [--ui]
π© Flags
--overwriteβ let the output files just steamroll over whatever files already exist, no cap--helpβ prints the usage summary so you can stop guessing--verboseβ verbose module output, it tells you everything--quietβ quiet module output, it tells you nothing--uiβ force launching the GUI dialog π₯οΈ
π Parameters
input=name[required] β name of the input raster map, mandatory bestieoutput=name[required] β name for the output raster map, also mandatoryaspect=nameβ name of the input aspect raster mapwidth=integerβ width of the display canvas. Default:640height=integerβ height of the display canvas. Default:480size=integerβ minimum size of each cell. Default:12rows=integerβ maximum number of rows to load. Default:100cols=integerβ maximum number of columns to load. Default:100
π DESCRIPTION
so d.rast.edit lets you interactively edit cell category values in a raster map layer, and it shows you that map layer on the graphics monitor, and you poke at it with a mouse cursor. that's the whole premise. it's giving arts and crafts but for GIS π¨
π Overview window
there's an overview window that shows the entire map, and a red box on it marks the current editing region. the edit window is where the actual cells inside that selected area show up. want to edit somewhere else? click a new spot on the overview window and the editing area moves there. slay π«Ά
π±οΈ Raster cell editing
cell editing happens with the mouse cursor β you point at the cell(s) on the displayed raster map that you want to edit.
to change a cell's value, drop the new value into the "New value" box at the bottom left of the edit window. and if you put a "*" in there, that means a NULL value should be used. bye bye data π
Important bestie: the new value in the "New value" box must be confirmed with ENTER, otherwise it's not active yet. the way i cannot stress this enough π
πΎ Saving the edited map
to save your edited map, the "File" menu has an entry called Save. and to leave d.rast.edit entirely, use Exit in the menu. that's the whole exit strategy.
β¬οΈ Map pan with arrow keys
you can shift the map around using the arrow keys on the keyboard. very demure, very mindful π§
π NOTES
there is no "undo" command, and there's also no way to exit edit mode without saving changes to the output map. so like... be sure. seriously. no takebacks.
any MASK that's in place will be respected when writing the new raster map layer β and yes, that includes any edits you made to the MASKed areas too.
π Geographic Region Concerns
d.rast.edit reads the region definition for the raster map layer you're editing from its internal cell header file. the new, edited copy of the raster layer gets created with the same resolution and region dimensions.
the primary bane of d.rast.edit (its words, not mine, and honestly same) is large map layers with lots of rows and columns and/or slow computers β because the program has to read and write raster map layers row by row for the full size of the map layer, as dictated by its region size and resolution. and heads up: the current region settings of north, south, east, and west will not limit the size of the edited copy of the map layer, because by use of the overview selection those values may change several times during the editing session. so it's not a shortcut, it's just how it is π
π₯ EXAMPLE
editing raster values in a LiDAR DEM, North Carolina sample data:
g.region raster=elev_lid792_1m -p
# pan to area of interest and edit raster cells (I used "102" as value to modify cells
# Use: File > Save to save
# then: File > Exit
d.rast.edit input=elev_lid792_1m output=elev_lid792_1m_modified
# comparison of raster statistics
# original stats, note the min value
r.univar -g elev_lid792_1m
# modified map stats, note the min value
r.univar -g elev_lid792_1m_modified
Figure: Editing of pixels in an elevation raster map using d.rast.edit π
π§ TODO
d.rast.editshould not create a new raster map layer if the user makes no cell edits while running the program and leaves it without saving. correct behavior, honestly.- it would be nice to incorporate a scrollable version of
d.legendβ like, so you could see a label legend for files with many categories on a standard size sub-frame. and it would be even nicer to be able to select the category values from a graphical legend when editing cell values, which would save a trip to the text frame to type in the new value. efficiency queen π - perhaps method(s) for multiple or mass cell edits would be useful. this could be done by providing modes in which the user may:
- edit a block of cells to a given value by drawing a box;
- be able to choose a given value which is automatically used as the new value on each cell chosen until a different value is desired.
- there is no user-interrupt handling. this could leave files in
.tmpor (rarely) result in half-baked raster maps. the original file would survive unscathed by an interrupt at most any point in execution. so like...
Beware of exiting the program by means other than using exit on the Main Menu. do not do it. i'm begging π
π SEE ALSO
d.rast.arrowd.rast.numwxGUI.rdigit
π«Ά AUTHORS
Tcl/Tk (2007) and wxPython versions (2008): Glynn Clements
Replaces Xdriver version in C by Chris Rewerts, April 1991, Agricultural Engineering, Purdue University
π¦ SOURCE CODE
Available at: d.rast.edit source code (history)
Accessed: Saturday Jan 17 05:41:51 2026
Main index | Display index | Topics index | Keywords index | Graphical index | Full index
okay and that's the whole page bestie π it's d.rast.edit(1) from the GRASS GIS User's Manual, GRASS 8.4.2, accessed Saturday Jan 17 05:41:51 2026, Β© 2003-2025 GRASS Development Team, GRASS GIS 8.4.2 Reference Manual. go edit some cells, but pls remember to press ENTER π
π¦ where this page comes from
- fedora 44: grass 8.4.2-4.fc44 Β· 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