d.grid(1grass)

d.grid1grass

Overlays a user-specified grid in the active display frame on the graphics monitor.

Usage

d.grid

d.grid --help

d.grid [-agwcdfnbt] size=value [origin=east,north] [direction=string] [width=float] [color=name] [border_color=name] [text_color=name] [bgcolor=name] [fontsize=integer] [--help] [--verbose] [--quiet] [--ui]

Keywords

display, cartography, graticule, grid

Overview

d.grid overlays a grid of user-defined size and color in the active display frame on the graphics monitor. The grid can be created as a standard rectangular grid or a geographic grid.

If the user provides a -g flag a geographic (projected) grid will be drawn. With the -g flag the size argument accepts both decimal degrees and colon separated ddd:mm:ss coordinates (eg. 00:30:00 for half of a degree). A geographic grid cannot be drawn for a latitude/longitude or XY projection.

Colors may be standard named GRASS colors (red, green, aqua, etc.) or a numerical R:G:B triplet, where component values range from 0-255. Grid color can be set with option color. Options text_color and bgcolor set the color of the text and its background.

The grid drawing may be turned off by using the -n flag.
The border drawing may be turned off by using the -b flag.
The coordinate text may be turned off by using the -t flag.

To draw grid lines at different intervals, e.g. at high latitudes, you can run the module twice, once with direction=east-west at one interval size, and again with direction=north-south at another interval size.

Examples

To draw a red geographic grid with 30 minute grid spacing, run one of the following commands:

d.grid -g size=00:30:00 color=red

or

d.grid -g size=0.5 color=255:0:0

Figure: Showing a geographic grid in red line color To draw a blue standard rectangular grid at a 500 (meter) spacing run the following:

d.grid size=500 color=blue

Figure: Showing a rectangular grid in blue line color

Source code

Available at: d.grid source code (history)

Accessed: Monday Feb 24 17:50:25 2025

Main index | Display index | Topics index | Keywords index | Graphical index | Full index

© 2003-2025 GRASS Development Team, GRASS GIS 8.4.1 Reference Manual

Releases

10 releases since Debian 4.0 (Etch); the text changed 9 times.

  1. 4.0
  2. 5.0
  3. 6.0
  4. 7
  5. 8
  6. 9
  7. 10
  8. 11
  9. 12
  10. 13

Authors

James Westervelt, U.S. Army Construction Engineering Research Laboratory
Geogrid support: Bob Covill
Border support: Markus Neteler
Text and RGB support: Hamish Bowman
Background color implemented as part of GSoC 2016 by Adam Laza, CTU in Prague

From grass-doc 8.4.1-1 in Debian 13 (Trixie). Parsed by carta from the page's man source.