LinuxCommandLibrary

gvmap

Generate image map from Graphviz layout

TLDR

Generate a clustered map layout from a DOT format graph

$ gvmap [graph.gv] -o [output.xdot]
copy

Generate a map using existing cluster subgraphs from the input
$ gvmap -D [graph.gv]
copy

Include graph edges in the [o]utput map
$ gvmap -e [graph.gv] -o [output.xdot]
copy

Specify a [c]olor scheme (1: pastel, 2: blue-yellow, 3: white-red, etc.)
$ gvmap -c [1|2|3|...] [graph.gv] -o [output.xdot]
copy

Set the maximum number of [C]lusters (by default 0, meaning there is no limit)
$ gvmap -C [10] [graph.gv] -o [output.xdot]
copy

Only draw cluster 2 (by default, all clusters are drawn)
$ gvmap -highlight=[2] [graph.gv] -o [output.xdot]
copy

SYNOPSIS

gvmap [-V] [-v] [-?] [-ooutfile] [-Tformat] [-Gattr=value] ... [-Nattr=value] ... [-Eattr=value] ... [files]

PARAMETERS

-?, -h, --help
    Print usage information and exit

-V
    Print version information and exit

-v
    Verbose output mode

-o outfile
    Write output to outfile (default stdout)

-T format
    Set output format (e.g., dot, plain, canon; default dot)

-Gattr=value
    Set graph attribute attr to value (e.g., -Gprojection=merc)

-Nattr=value
    Set default node attribute attr to value (e.g., lat, long)

-Eattr=value
    Set default edge attribute attr to value

-K engine
    Use layout engine engine (ignored for gvmap; fixed to map layout)

-O
    Automatically generate output filenames from input

DESCRIPTION

The gvmap command is a layout engine in the Graphviz suite designed for rendering undirected graphs embedded on a sphere, such as the Earth, using various map projections. It requires each node to have lat (latitude) and long (longitude) attributes specified as floating-point degrees. Edges are drawn as great circle arcs between nodes.

gvmap reads input graphs in DOT language format and computes node positions in a planar projection suitable for output. It supports multiple projections like orthographic (ortho), Mercator (merc), Hammer (hammer), and others. Users can customize the map bounds, dimensions, and resolution via graph attributes. The output is typically DOT format with updated pos attributes for nodes, ready for rendering with tools like dot or neato.

This engine is ideal for visualizing geographic networks, such as flight routes, telecom links, or seismic data on world maps. It handles large graphs efficiently but assumes accurate lat/long inputs.

CAVEATS

Nodes must have lat and long attributes in decimal degrees (-90 to 90, -180 to 180). Experimental engine; may not handle poles well. Undirected graphs only.

KEY GRAPH ATTRIBUTES

projection: flat|albers|azeq|azim|stereo|ortho|merc|lcc|hammer (default ortho).
bounds: "W S E N" (degrees; default world).
width, height: Output image size (inches; default 8.5x11).

EXAMPLE USAGE

echo 'graph G { a [lat=40.7,long=-74.0]; b [lat=34.0,long=-118.2]; a--b; }' | gvmap -Tplain -Gprojection=merc
Outputs node positions for Mercator projection.

HISTORY

Developed as part of Graphviz at AT&T Labs Research in the late 1990s-2000s. gvmap added around Graphviz 2.0 era for geographic visualization. Maintained in open-source Graphviz releases since 2004.

SEE ALSO

dot(1), neato(1), circo(1), twopi(1), fdp(1), sfdp(1), nop(1)

Copied to clipboard