Skip to content

r3.info

Outputs basic information about a user-specified 3D raster map layer.

r3.info [-grh] map=name [format=name] [--verbose] [--quiet] [--qq] [--ui]

Example:

r3.info map=name

grass.script.parse_command("r3.info", map, format=None, flags=None, verbose=None, quiet=None, superquiet=None)

Example:

gs.parse_command("r3.info", map="name", format="json")

grass.tools.Tools.r3_info(map, format=None, flags=None, verbose=None, quiet=None, superquiet=None)

Example:

tools = Tools()
tools.r3_info(map="name", format="json")

This grass.tools API is experimental in version 8.5 and expected to be stable in version 8.6.

Parameters

map=name [required]
    Name of 3D raster map
format=name
    Output format
    Allowed values: plain, shell, json
    plain: Plain text output
    shell: shell script style output
    json: JSON (JavaScript Object Notation)
-g
    Print raster3d array information
-r
    Print range
-h
    Print raster3d history
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

map : str, required
    Name of 3D raster map
    Used as: input, raster_3d, name
format : str, optional
    Output format
    Used as: name
    Allowed values: plain, shell, json
    plain: Plain text output
    shell: shell script style output
    json: JSON (JavaScript Object Notation)
flags : str, optional
    Allowed values: g, r, h
    g
        Print raster3d array information
    r
        Print range
    h
        Print raster3d history
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

map : str, required
    Name of 3D raster map
    Used as: input, raster_3d, name
format : str, optional
    Output format
    Used as: name
    Allowed values: plain, shell, json
    plain: Plain text output
    shell: shell script style output
    json: JSON (JavaScript Object Notation)
flags : str, optional
    Allowed values: g, r, h
    g
        Print raster3d array information
    r
        Print range
    h
        Print raster3d history
verbose : bool, optional
    Verbose module output
    Default: None
quiet : bool, optional
    Quiet module output
    Default: None
superquiet : bool, optional
    Very quiet module output
    Default: None

Returns:

result : grass.tools.support.ToolResult | None
If the tool produces text as standard output, a ToolResult object will be returned. Otherwise, None will be returned.

DESCRIPTION

r3.info reports metadata and range of 3D voxel maps.

NOTES

For backward compatibility, using the -g, -r flags without specifying a format currently defaults to the shell format. In the next major release, this behavior may change to default to the plain format to better support interactive use. To ensure consistent behavior in scripts, explicitly specify the shell or json format.

EXAMPLES

Get full report

Below is the full report produced by r3.info for the raster3d map "volume", created using r3.mapcalc expression="volume = row() + col() + depth()":

r3.info volume

Possible output:

+----------------------------------------------------------------------------+
| Map:      volume                         Date: Mon Jul 21 23:14:24 2025    |
| Mapset:   PERMANENT                      Login of Creator: nishantbansal   |
| Project: nc_spm_08_grass7                                                  |
| DataBase: /grassdata                                                       |
| Title:    volume                                                           |
| Units:    none                                                             |
| Vertical unit: units                                                       |
| Timestamp: none                                                            |
|----------------------------------------------------------------------------|
|                                                                            |
|   Type of Map:  raster_3d            Number of Categories: 0               |
|   Data Type:    DCELL                                                      |
|   Rows:         100                                                        |
|   Columns:      200                                                        |
|   Depths:       50                                                         |
|   Total Cells:  1000000                                                    |
|   Total size:           147591 Bytes                                       |
|   Number of tiles:      294                                                |
|   Mean tile size:       502 Bytes                                          |
|   Tile size in memory:  31320 Bytes                                        |
|   Number of tiles in x, y and  z:   7, 7, 6                                |
|   Dimension of a tile in x, y, z:   29, 15, 9                              |
|                                                                            |
|        Projection: Lambert Conformal Conic (zone 0)                        |
|            N:        200    S:        100   Res:     1                     |
|            E:        400    W:        200   Res:     1                     |
|            T:        500    B:        450   Res:     1                     |
|   Range of data:   min =          3 max =        350                       |
|                                                                            |
|   Data Source:                                                             |
|                                                                            |
|                                                                            |
|                                                                            |
|   Data Description:                                                        |
|    generated by r3.mapcalc                                                 |
|                                                                            |
|   Comments:                                                                |
|    r3.mapcalc expression="volume = row() + col() + depth()" region="cur\   |
|    rent"                                                                   |
|                                                                            |
+----------------------------------------------------------------------------+
import grass.script as gs

data = gs.parse_command("r3.info", map="volume", format="json")
print(data["title"])

Possible output:

volume

The whole JSON may look like this:

{
    "map": "volume",
    "date": "Mon Jul 21 23:14:24 2025",
    "mapset": "PERMANENT",
    "creator": "nishantbansal",
    "project": "nc_spm_08_grass7",
    "database": "/grassdata",
    "title": "volume",
    "units": "none",
    "vertical_units": "units",
    "timestamp": null,
    "maptype": "raster_3d",
    "ncats": 0,
    "datatype": "DCELL",
    "rows": 100,
    "cols": 200,
    "depths": 50,
    "cells": 1000000,
    "size": 147591,
    "ntiles": 294,
    "meansize": 502,
    "tilesize": 31320,
    "tilenumx": 7,
    "tilenumy": 7,
    "tilenumz": 6,
    "tiledimx": 29,
    "tiledimy": 15,
    "tiledimz": 9,
    "north": 200,
    "south": 100,
    "nsres": 1,
    "east": 400,
    "west": 200,
    "ewres": 1,
    "top": 500,
    "bottom": 450,
    "tbres": 1,
    "min": 3,
    "max": 350,
    "source1": "",
    "source2": "",
    "description": "generated by r3.mapcalc",
    "comments": "r3.mapcalc expression=\"volume = row() + col() + depth()\" region=\"current\""
}

Alternatively, the output from r3.info may be limited to a subset of the available information by passing various flags to the module:

Get raster3d array information

r3.info volume -g format=shell

Possible output:

north=200
south=100
east=400
west=200
bottom=450
top=500
nsres=1
ewres=1
tbres=1
rows=100
cols=200
depths=50
datatype="DCELL"
timestamp="none"
units="none"
vertical_units="units"
tilenumx=7
tilenumy=7
tilenumz=6
tiledimx=29
tiledimy=15
tiledimz=9
import grass.script as gs

data = gs.parse_command("r3.info", map="volume", flags="g", format="json")
print(data)

Possible output:

{'north': 200, 'south': 100, 'east': 400, 'west': 200, 'bottom': 450, 'top': 500, 'nsres': 1, 'ewres': 1, 'tbres': 1, 'rows': 100, 'cols': 200, 'depths': 50, 'datatype': 'DCELL', 'timestamp': None, 'units': 'none', 'vertical_units': 'units', 'tilenumx': 7, 'tilenumy': 7, 'tilenumz': 6, 'tiledimx': 29, 'tiledimy': 15, 'tiledimz': 9}

Get the map data range

r3.info -r volume format=shell

Possible output:

min=3.000000
max=350.000000
import grass.script as gs

data = gs.parse_command("r3.info", map="volume", flags="r", format="json")
print(data)

Possible output:

{'min': 3, 'max': 350}

SEE ALSO

r.info

AUTHORS

Roman Waupotitsch, Michael Shapiro, Helena Mitasova, Bill Brown, Lubos Mitas, Jaro Hofierka

SOURCE CODE

Available at: r3.info source code (history)
Latest change: Monday Jul 28 12:49:02 2025 in commit bc5cb70