Skip to content

d.geodesic

Displays a geodesic line, tracing the shortest distance between two geographic points along a great circle, in a longitude/latitude data set.

d.geodesic coordinates=lon1,lat1,lon2,lat2 [line_color=name] [text_color=name] [units=string] [--verbose] [--quiet] [--qq] [--ui]

Example:

d.geodesic coordinates=lon1,lat1,lon2,lat2

grass.script.run_command("d.geodesic", coordinates, line_color="black", text_color=None, units="meters", verbose=False, quiet=False, superquiet=False)

Example:

gs.run_command("d.geodesic", coordinates=lon1,lat1,lon2,lat2)

Parameters

coordinates=lon1,lat1,lon2,lat2 [required]
    Starting and ending coordinates
line_color=name
    Line color
    Either a standard color name or R:G:B triplet
    Default: black
text_color=name
    Text color
    Either a standard color name or R:G:B triplet
units=string
    Units
    Units
    Allowed values: meters, kilometers, feet, miles
    Default: meters
--help
    Print usage summary
--verbose
    Verbose module output
--quiet
    Quiet module output
--qq
    Very quiet module output
--ui
    Force launching GUI dialog

coordinates : tuple[float, float, float, float] | list[float] | str, required
    Starting and ending coordinates
    Used as: input, coords, lon1,lat1,lon2,lat2
line_color : str, optional
    Line color
    Either a standard color name or R:G:B triplet
    Used as: input, color, name
    Default: black
text_color : str, optional
    Text color
    Either a standard color name or R:G:B triplet
    Used as: input, color, name
units : str, optional
    Units
    Units
    Allowed values: meters, kilometers, feet, miles
    Default: meters
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

d.geodesic displays a geodesic line in the active frame on the user's graphics monitor. This is also known as the great circle line and traces the shortest distance between two user-specified points on the curved surface of a longitude/latitude data set. The two coordinate locations named must fall within the boundaries of the user's current geographic region.

OPTIONS

By default black line color and red text color will be used.

By indicating the starting and ending coordinates of the geodesic, the line and its length (by default in meters) are displayed to the graphical output. If the text color is set to none, the great circle distance is not displayed.

EXAMPLE

A geodesic line if shown over the political map of the world (demolocation dataset):

g.region vector=country_boundaries -p
d.mon wx0
d.vect country_boundaries type=area
# show additionally a 20 degree grid
d.grid 20

d.geodesic coordinates=55:58W,33:18S,26:43E,60:37N \
  line_color=yellow text_color=red units=kilometers

Geodesic line (great circle line)
Geodesic line (great circle line)

NOTES

This program works only with longitude/latitude coordinate system.

SEE ALSO

d.rhumbline, d.grid, m.measure

AUTHOR

Michael Shapiro, U.S. Army Construction Engineering Research Laboratory

SOURCE CODE

Available at: d.geodesic source code (history)
Latest change: Wednesday Feb 12 23:02:46 2025 in commit 9c11460