
142
|
Chapter 3, Mapping Your World
#30 Plot a Great Circle on a Flat Map
HACK
The following commands, using pscoast and psxy from GMT, were used to
generate Figure 3-31:
$ pscoast -JM18c -R-170/190/-75/85 -Bg30/g15 -A5000 -G192/192/192 -K > \
mercator.ps
$ psxy points.txt -JM18c -R-170/190/-75/85 -W8 -O -K >> mercator.ps
$ psxy points.txt -JM18c -R-170/190/-75/85 -Sa.75c -G0/0/0 -O >> mercator.ps
The call to pscoast draws the graticule (i.e., grid lines) and the base map of
the continents. We recommend reviewing
[Hack #28] to understand exactly
how these particular pscoast options do their magic. The first call to psxy
actually draws the great-circle arc into the same file. We give psxy the same
projection parameters we did pscoast, along with a filename, points.txt. The
points.txt file simply contains the following:
-122,38
0,51
The geographically savvy reader will recognize these as the longitude and
latitude coordinates of San Francisco and London, respectively. The
-W8
option to psxy tells it to make the great-circle arc 8 pixels thick. Finally, we
call psxy one more time, with the same projection parameters and filename
containing our points, but this time we give the
-S option to request that
symbols be drawn at each point, instead of a line connecting them. In this
case, the
-Sa.75c option draws us a star .75 centimeters wide at each end
point, coloring each one black via the
-G option.
The shortest ...