m.nviz.image
Creates a 3D rendering of GIS data.
Renders surfaces (raster data), 2D/3D vector data, and volumes (3D raster data) in 3D.
m.nviz.image [-anb] [elevation_map=name [,name,...]] [elevation_value=value [,value,...]] [color_map=name [,name,...]] [color=name [,name,...]] [mask_map=name [,name,...]] [transparency_map=name [,name,...]] [transparency_value=value [,value,...]] [shininess_map=name [,name,...]] [shininess_value=value [,value,...]] [emission_map=name [,name,...]] [emission_value=value [,value,...]] [mode=string [,string,...]] [resolution_fine=value [,value,...]] [resolution_coarse=value [,value,...]] [style=string [,string,...]] [shading=string [,string,...]] [wire_color=name [,name,...]] [surface_position=x,y,z [,x,y,z,...]] [vline=name [,name,...]] [vline_layer=string [,string,...]] [vline_width=value [,value,...]] [vline_width_column=name [,name,...]] [vline_color=name [,name,...]] [vline_color_column=name [,name,...]] [vline_mode=string [,string,...]] [vline_height=value [,value,...]] [vline_position=x,y,z [,x,y,z,...]] [vpoint=name [,name,...]] [vpoint_layer=string [,string,...]] [vpoint_size=value [,value,...]] [vpoint_size_column=name [,name,...]] [vpoint_width=value [,value,...]] [vpoint_width_column=name [,name,...]] [vpoint_color=name [,name,...]] [vpoint_color_column=name [,name,...]] [vpoint_marker=string [,string,...]] [vpoint_marker_column=name [,name,...]] [vpoint_mode=string [,string,...]] [vpoint_position=x,y,z [,x,y,z,...]] [volume=name [,name,...]] [volume_mode=string [,string,...]] [volume_shading=string [,string,...]] [volume_position=x,y,z [,x,y,z,...]] [volume_resolution=value [,value,...]] [isosurf_level=volume:value [,volume:value,...]] [isosurf_color_map=name [,name,...]] [isosurf_color_value=name [,name,...]] [isosurf_transparency_map=name [,name,...]] [isosurf_transparency_value=value [,value,...]] [isosurf_shininess_map=name [,name,...]] [isosurf_shininess_value=value [,value,...]] [slice=volume:axis [,volume:axis,...]] [slice_position=x1,x2,y1,y2,z1,z2 [,x1,x2,y1,y2,z1,z2,...]] [slice_transparency=value [,value,...]] [bgcolor=name] [position=x,y] [height=value] [perspective=value] [twist=value] [zexag=value] [focus=x,y,z] [light_position=x,y,z] [light_color=name] [light_brightness=integer] [light_ambient=integer] [fringe=string [,string,...]] [fringe_color=name] [fringe_elevation=integer] [cplane=value [,value,...]] [cplane_position=x,y,z [,x,y,z,...]] [cplane_rotation=value [,value,...]] [cplane_tilt=value [,value,...]] [cplane_shading=string] [arrow_position=x,y] [arrow_size=value] [arrow_color=name] output=name format=string size=width,height [--overwrite] [--verbose] [--quiet] [--qq] [--ui]
Example:
m.nviz.image output=name format=ppm size=640,480
grass.script.run_command("m.nviz.image", elevation_map=None, elevation_value=None, color_map=None, color=None, mask_map=None, transparency_map=None, transparency_value=None, shininess_map=None, shininess_value=None, emission_map=None, emission_value=None, mode="fine", resolution_fine=6, resolution_coarse=9, style="surface", shading="gouraud", wire_color="136:136:136", surface_position="0,0,0", vline=None, vline_layer="1", vline_width=2, vline_width_column=None, vline_color="blue", vline_color_column=None, vline_mode="surface", vline_height=0, vline_position="0,0,0", vpoint=None, vpoint_layer="1", vpoint_size=100, vpoint_size_column=None, vpoint_width=2, vpoint_width_column=None, vpoint_color="blue", vpoint_color_column=None, vpoint_marker="sphere", vpoint_marker_column=None, vpoint_mode="3D", vpoint_position="0,0,0", volume=None, volume_mode="isosurface", volume_shading="gouraud", volume_position="0,0,0", volume_resolution=3, isosurf_level=None, isosurf_color_map=None, isosurf_color_value=None, isosurf_transparency_map=None, isosurf_transparency_value=None, isosurf_shininess_map=None, isosurf_shininess_value=None, slice=None, slice_position="0,1,0,1,0,1", slice_transparency=0, bgcolor="white", position="0.84,0.16", height=None, perspective=40, twist=0, zexag=None, focus=None, light_position="0.68,-0.68,0.80", light_color="white", light_brightness=80, light_ambient=20, fringe=None, fringe_color="grey", fringe_elevation=55, cplane=None, cplane_position="0,0,0", cplane_rotation=0, cplane_tilt=0, cplane_shading="clear", arrow_position=None, arrow_size=None, arrow_color="black", output, format="ppm", size="640,480", flags=None, overwrite=False, verbose=False, quiet=False, superquiet=False)
Example:
gs.run_command("m.nviz.image", output="name", format="ppm", size=640,480)
Parameters
elevation_map=name [,name,...]
Name of raster map(s) for elevation
elevation_value=value [,value,...]
Constant elevation value(s) to use instead of a raster DEM
color_map=name [,name,...]
Name of raster map(s) for color
color=name [,name,...]
Color value(s)
Either a standard color name or R:G:B triplet
mask_map=name [,name,...]
Name of raster map(s) for mask
transparency_map=name [,name,...]
Name of raster map(s) for transparency
transparency_value=value [,value,...]
Transparency value(s)
Allowed values: 0-255
shininess_map=name [,name,...]
Name of raster map(s) for shininess
shininess_value=value [,value,...]
Shininess value(s)
Allowed values: 0-255
emission_map=name [,name,...]
Name of raster map(s) for emission
emission_value=value [,value,...]
Emission value(s)
Allowed values: 0-255
mode=string [,string,...]
Draw mode
Allowed values: coarse, fine, both
Default: fine
resolution_fine=value [,value,...]
Fine resolution
Default: 6
resolution_coarse=value [,value,...]
Coarse resolution
Default: 9
style=string [,string,...]
Draw style
Allowed values: wire, surface
Default: surface
shading=string [,string,...]
Shading
Allowed values: flat, gouraud
Default: gouraud
wire_color=name [,name,...]
Wire color
Either a standard color name or R:G:B triplet
Default: 136:136:136
surface_position=x,y,z [,x,y,z,...]
Surface position
Default: 0,0,0
vline=name [,name,...]
Name of vector map
Name of line vector overlay map(s)
vline_layer=string [,string,...]
Layer number or name
Layer number or name for thematic mapping
Default: 1
vline_width=value [,value,...]
Vector line width
Allowed values: 1-100
Default: 2
vline_width_column=name [,name,...]
Name of width definition column
Name of attribute column
vline_color=name [,name,...]
Vector line color
Either a standard color name or R:G:B triplet
Default: blue
vline_color_column=name [,name,...]
Name of color definition column
Name of attribute column
vline_mode=string [,string,...]
Vector line display mode
Allowed values: surface, flat
Default: surface
surface: drape on raster surface
flat: draw at constant elevation
vline_height=value [,value,...]
Vector line height
Allowed values: 0-1000
Default: 0
vline_position=x,y,z [,x,y,z,...]
Vector lines position
Default: 0,0,0
vpoint=name [,name,...]
Name of vector map
Name of point vector overlay map(s)
vpoint_layer=string [,string,...]
Layer number or name
Layer number or name for thematic mapping
Default: 1
vpoint_size=value [,value,...]
Icon size (map units)
Allowed values: 0-1000
Default: 100
vpoint_size_column=name [,name,...]
Name of size definition column
Name of attribute column
vpoint_width=value [,value,...]
Icon width
Allowed values: 1-1000
Default: 2
vpoint_width_column=name [,name,...]
Name of width definition column
Name of attribute column
vpoint_color=name [,name,...]
Icon color
Either a standard color name or R:G:B triplet
Default: blue
vpoint_color_column=name [,name,...]
Name of color definition column
Name of attribute column
vpoint_marker=string [,string,...]
Icon marker
Allowed values: x, box, sphere, cube, diamond, dec_tree, con_tree, aster, gyro, histogram
Default: sphere
vpoint_marker_column=name [,name,...]
Name of marker definition column
Name of attribute column
vpoint_mode=string [,string,...]
3D vector point display mode
Allowed values: surface, 3D
Default: 3D
surface: drape on raster surface
3D: place at 3D point's z-elevation
vpoint_position=x,y,z [,x,y,z,...]
Vector points position
Default: 0,0,0
volume=name [,name,...]
Name of 3D raster map(s)
volume_mode=string [,string,...]
Volume draw mode
Allowed values: isosurface, slice
Default: isosurface
volume_shading=string [,string,...]
Volume shading
Allowed values: flat, gouraud
Default: gouraud
volume_position=x,y,z [,x,y,z,...]
Volume position
Default: 0,0,0
volume_resolution=value [,value,...]
Volume resolution
Default: 3
isosurf_level=volume:value [,volume:value,...]
Isosurface level
isosurf_color_map=name [,name,...]
Name of volume for isosurface color
isosurf_color_value=name [,name,...]
Isosurface color
Either a standard color name or R:G:B triplet
isosurf_transparency_map=name [,name,...]
Name of 3D raster map(s) for isosurface transparency
isosurf_transparency_value=value [,value,...]
Transparency value(s)for isosurfaces
Allowed values: 0-255
isosurf_shininess_map=name [,name,...]
Name of 3D raster map(s) for shininess
isosurf_shininess_value=value [,value,...]
Shininess value(s) for isosurfaces
Allowed values: 0-255
slice=volume:axis [,volume:axis,...]
Volume slice parallel to given axis (x, y, z)
slice_position=x1,x2,y1,y2,z1,z2 [,x1,x2,y1,y2,z1,z2,...]
Volume slice position
Default: 0,1,0,1,0,1
slice_transparency=value [,value,...]
Volume slice transparency
Allowed values: 0-255
Default: 0
bgcolor=name
Background color
Either a standard color name or R:G:B triplet
Default: white
position=x,y
Viewpoint position (x,y model coordinates)
Allowed values: 0.0-1.0
Default: 0.84,0.16
height=value
Viewpoint height (in map units)
perspective=value
Viewpoint field of view (in degrees)
Allowed values: 1-180
Default: 40
twist=value
Viewpoint twist angle (in degrees)
Allowed values: -180-180
Default: 0
zexag=value
Vertical exaggeration
focus=x,y,z
Focus to point on surface (from SW corner in map units)
light_position=x,y,z
Light position (x,y,z model coordinates)
Default: 0.68,-0.68,0.80
light_color=name
Light color
Either a standard color name or R:G:B triplet
Default: white
light_brightness=integer
Light brightness
Allowed values: 0-100
Default: 80
light_ambient=integer
Light ambient
Allowed values: 0-100
Default: 20
fringe=string [,string,...]
Fringe edges
Allowed values: nw, ne, sw, se
nw: North-West edge
ne: North-East edge
sw: South-West edge
se: South-East edge
fringe_color=name
Fringe color
Either a standard color name or R:G:B triplet
Default: grey
fringe_elevation=integer
Fringe elevation
Default: 55
cplane=value [,value,...]
Cutting plane index (0-5)
cplane_position=x,y,z [,x,y,z,...]
Cutting plane x,y,z coordinates
Default: 0,0,0
cplane_rotation=value [,value,...]
Cutting plane rotation along the vertical axis
Allowed values: 0-360
Default: 0
cplane_tilt=value [,value,...]
Cutting plane tilt
Allowed values: 0-360
Default: 0
cplane_shading=string
Cutting plane color (between two surfaces)
Allowed values: clear, top, bottom, blend, shaded
Default: clear
arrow_position=x,y
Place north arrow at given position (in screen coordinates from bottom left corner)
arrow_size=value
North arrow size (in map units)
arrow_color=name
North arrow color
Either a standard color name or R:G:B triplet
Default: black
output=name [required]
Name for output image file (without extension)
format=string [required]
Graphics file format
Allowed values: ppm, tif
Default: ppm
size=width,height [required]
Size (width, height) of output image
Default: 640,480
-a
Use draw mode for all loaded surfaces
-n
Toggles normal direction of all isosurfaces (changes light effect)
-b
Draw volume box
--overwrite
Allow output files to overwrite existing files
--help
Print usage summary
--verbose
Verbose module output
--quiet
Quiet module output
--qq
Very quiet module output
--ui
Force launching GUI dialog
elevation_map : str | list[str], optional
Name of raster map(s) for elevation
Used as: input, raster, name
elevation_value : int | list[int] | str, optional
Constant elevation value(s) to use instead of a raster DEM
Used as: value
color_map : str | list[str], optional
Name of raster map(s) for color
Used as: input, raster, name
color : str | list[str], optional
Color value(s)
Either a standard color name or R:G:B triplet
Used as: input, color, name
mask_map : str | list[str], optional
Name of raster map(s) for mask
Used as: input, raster, name
transparency_map : str | list[str], optional
Name of raster map(s) for transparency
Used as: input, raster, name
transparency_value : int | list[int] | str, optional
Transparency value(s)
Used as: value
Allowed values: 0-255
shininess_map : str | list[str], optional
Name of raster map(s) for shininess
Used as: input, raster, name
shininess_value : int | list[int] | str, optional
Shininess value(s)
Used as: value
Allowed values: 0-255
emission_map : str | list[str], optional
Name of raster map(s) for emission
Used as: input, raster, name
emission_value : int | list[int] | str, optional
Emission value(s)
Used as: value
Allowed values: 0-255
mode : str | list[str], optional
Draw mode
Used as: string
Allowed values: coarse, fine, both
Default: fine
resolution_fine : int | list[int] | str, optional
Fine resolution
Used as: value
Default: 6
resolution_coarse : int | list[int] | str, optional
Coarse resolution
Used as: value
Default: 9
style : str | list[str], optional
Draw style
Used as: string
Allowed values: wire, surface
Default: surface
shading : str | list[str], optional
Shading
Used as: string
Allowed values: flat, gouraud
Default: gouraud
wire_color : str | list[str], optional
Wire color
Either a standard color name or R:G:B triplet
Used as: input, color, name
Default: 136:136:136
surface_position : list[tuple[int, int, int]] | tuple[int, int, int] | list[int] | str, optional
Surface position
Used as: x,y,z
Default: 0,0,0
vline : str | list[str], optional
Name of vector map
Name of line vector overlay map(s)
Used as: input, vector, name
vline_layer : str | list[str], optional
Layer number or name
Layer number or name for thematic mapping
Used as: input, layer
Default: 1
vline_width : int | list[int] | str, optional
Vector line width
Used as: value
Allowed values: 1-100
Default: 2
vline_width_column : str | list[str], optional
Name of width definition column
Name of attribute column
Used as: input, dbcolumn, name
vline_color : str | list[str], optional
Vector line color
Either a standard color name or R:G:B triplet
Used as: input, color, name
Default: blue
vline_color_column : str | list[str], optional
Name of color definition column
Name of attribute column
Used as: input, dbcolumn, name
vline_mode : str | list[str], optional
Vector line display mode
Used as: string
Allowed values: surface, flat
surface: drape on raster surface
flat: draw at constant elevation
Default: surface
vline_height : int | list[int] | str, optional
Vector line height
Used as: value
Allowed values: 0-1000
Default: 0
vline_position : list[tuple[int, int, int]] | tuple[int, int, int] | list[int] | str, optional
Vector lines position
Used as: x,y,z
Default: 0,0,0
vpoint : str | list[str], optional
Name of vector map
Name of point vector overlay map(s)
Used as: input, vector, name
vpoint_layer : str | list[str], optional
Layer number or name
Layer number or name for thematic mapping
Used as: input, layer
Default: 1
vpoint_size : float | list[float] | str, optional
Icon size (map units)
Used as: value
Allowed values: 0-1000
Default: 100
vpoint_size_column : str | list[str], optional
Name of size definition column
Name of attribute column
Used as: input, dbcolumn, name
vpoint_width : int | list[int] | str, optional
Icon width
Used as: value
Allowed values: 1-1000
Default: 2
vpoint_width_column : str | list[str], optional
Name of width definition column
Name of attribute column
Used as: input, dbcolumn, name
vpoint_color : str | list[str], optional
Icon color
Either a standard color name or R:G:B triplet
Used as: input, color, name
Default: blue
vpoint_color_column : str | list[str], optional
Name of color definition column
Name of attribute column
Used as: input, dbcolumn, name
vpoint_marker : str | list[str], optional
Icon marker
Used as: string
Allowed values: x, box, sphere, cube, diamond, dec_tree, con_tree, aster, gyro, histogram
Default: sphere
vpoint_marker_column : str | list[str], optional
Name of marker definition column
Name of attribute column
Used as: input, dbcolumn, name
vpoint_mode : str | list[str], optional
3D vector point display mode
Used as: string
Allowed values: surface, 3D
surface: drape on raster surface
3D: place at 3D point's z-elevation
Default: 3D
vpoint_position : list[tuple[float, float, float]] | tuple[float, float, float] | list[float] | str, optional
Vector points position
Used as: x,y,z
Default: 0,0,0
volume : str | list[str], optional
Name of 3D raster map(s)
Used as: input, raster_3d, name
volume_mode : str | list[str], optional
Volume draw mode
Used as: string
Allowed values: isosurface, slice
Default: isosurface
volume_shading : str | list[str], optional
Volume shading
Used as: string
Allowed values: flat, gouraud
Default: gouraud
volume_position : list[tuple[int, int, int]] | tuple[int, int, int] | list[int] | str, optional
Volume position
Used as: x,y,z
Default: 0,0,0
volume_resolution : int | list[int] | str, optional
Volume resolution
Used as: value
Default: 3
isosurf_level : str | list[str], optional
Isosurface level
Used as: volume:value
isosurf_color_map : str | list[str], optional
Name of volume for isosurface color
Used as: input, raster_3d, name
isosurf_color_value : str | list[str], optional
Isosurface color
Either a standard color name or R:G:B triplet
Used as: input, color, name
isosurf_transparency_map : str | list[str], optional
Name of 3D raster map(s) for isosurface transparency
Used as: input, raster_3d, name
isosurf_transparency_value : int | list[int] | str, optional
Transparency value(s)for isosurfaces
Used as: value
Allowed values: 0-255
isosurf_shininess_map : str | list[str], optional
Name of 3D raster map(s) for shininess
Used as: input, raster_3d, name
isosurf_shininess_value : int | list[int] | str, optional
Shininess value(s) for isosurfaces
Used as: value
Allowed values: 0-255
slice : str | list[str], optional
Volume slice parallel to given axis (x, y, z)
Used as: volume:axis
slice_position : list[tuple[float, float, float, float, float, float]] | tuple[float, float, float, float, float, float] | list[float] | str, optional
Volume slice position
Used as: x1,x2,y1,y2,z1,z2
Default: 0,1,0,1,0,1
slice_transparency : int | list[int] | str, optional
Volume slice transparency
Used as: value
Allowed values: 0-255
Default: 0
bgcolor : str, optional
Background color
Either a standard color name or R:G:B triplet
Used as: input, color, name
Default: white
position : tuple[float, float] | list[float] | str, optional
Viewpoint position (x,y model coordinates)
Used as: x,y
Allowed values: 0.0-1.0
Default: 0.84,0.16
height : int, optional
Viewpoint height (in map units)
Used as: value
perspective : int, optional
Viewpoint field of view (in degrees)
Used as: value
Allowed values: 1-180
Default: 40
twist : int, optional
Viewpoint twist angle (in degrees)
Used as: value
Allowed values: -180-180
Default: 0
zexag : float, optional
Vertical exaggeration
Used as: value
focus : tuple[float, float, float] | list[float] | str, optional
Focus to point on surface (from SW corner in map units)
Used as: x,y,z
light_position : tuple[float, float, float] | list[float] | str, optional
Light position (x,y,z model coordinates)
Used as: x,y,z
Default: 0.68,-0.68,0.80
light_color : str, optional
Light color
Either a standard color name or R:G:B triplet
Used as: input, color, name
Default: white
light_brightness : int, optional
Light brightness
Allowed values: 0-100
Default: 80
light_ambient : int, optional
Light ambient
Allowed values: 0-100
Default: 20
fringe : str | list[str], optional
Fringe edges
Allowed values: nw, ne, sw, se
nw: North-West edge
ne: North-East edge
sw: South-West edge
se: South-East edge
fringe_color : str, optional
Fringe color
Either a standard color name or R:G:B triplet
Used as: input, color, name
Default: grey
fringe_elevation : int, optional
Fringe elevation
Default: 55
cplane : int | list[int] | str, optional
Cutting plane index (0-5)
Used as: value
cplane_position : list[tuple[float, float, float]] | tuple[float, float, float] | list[float] | str, optional
Cutting plane x,y,z coordinates
Used as: x,y,z
Default: 0,0,0
cplane_rotation : float | list[float] | str, optional
Cutting plane rotation along the vertical axis
Used as: value
Allowed values: 0-360
Default: 0
cplane_tilt : float | list[float] | str, optional
Cutting plane tilt
Used as: value
Allowed values: 0-360
Default: 0
cplane_shading : str, optional
Cutting plane color (between two surfaces)
Used as: string
Allowed values: clear, top, bottom, blend, shaded
Default: clear
arrow_position : tuple[int, int] | list[int] | str, optional
Place north arrow at given position (in screen coordinates from bottom left corner)
Used as: x,y
arrow_size : float, optional
North arrow size (in map units)
Used as: value
arrow_color : str, optional
North arrow color
Either a standard color name or R:G:B triplet
Used as: input, color, name
Default: black
output : str, required
Name for output image file (without extension)
Used as: output, file, name
format : str, required
Graphics file format
Allowed values: ppm, tif
Default: ppm
size : tuple[int, int] | list[int] | str, required
Size (width, height) of output image
Used as: width,height
Default: 640,480
flags : str, optional
Allowed values: a, n, b
a
Use draw mode for all loaded surfaces
n
Toggles normal direction of all isosurfaces (changes light effect)
b
Draw volume box
overwrite: bool, optional
Allow output files to overwrite existing files
Default: False
verbose: bool, optional
Verbose module output
Default: False
quiet: bool, optional
Quiet module output
Default: False
superquiet: bool, optional
Very quiet module output
Default: False
DESCRIPTION
m.nviz.image allows users to realistically render multiple surfaces (raster data) in a 3D space, optionally using thematic coloring, draping 2D vector data over the surfaces, displaying 3D vector data in the space, and visualization of volume data (3D raster data) from the command line.
EXAMPLE
Render elevation map in a 3D space.
g.region raster=elevation
m.nviz.image elevation_map=elevation output=elev perspective=15
SEE ALSO
AUTHORS
Martin Landa, Google Summer of
Code 2008 (mentor:
Michael Barton) and Google Summer of Code
2010 (mentor: Helena
Mitasova)
Anna Kratochvilova, Google Summer of Code
2011 (mentor: Martin
Landa)
SOURCE CODE
Available at: m.nviz.image source code
(history)
Latest change: Tuesday Feb 25 19:01:58 2025 in commit 34b6764