This set of files may be used to construct a geographical database
of the entire world for use with the maps library in S.  The files
are:

	README		this file
	make.extra	some extra makefile lines	
	Lmake.diff	a one-line change to Lmake.c
	small.line	a sqashed version of the full ascii polyline file
	sub.gdb		a shell script to create a sub-geographical database
	thinner.c	a program to create thinned versions of the database
	unsqash.c	a program to convert small.line to world.line
	world.gon	the polygon file
	world.name	the polygon name file

Here's what to do, assuming you have unpacked these files into some
directory $FOO:

	(login as the S system administrator)
	cd $SHOME/library/maps
	cp $FOO/small.line $FOO/world.gon $FOO/world.name data
	cp $FOO/unsquash.c .
	(make the one-line change to Lmake.c, as given in $FOO/Lmake.diff;
	 don't make this change if you have later than the April 1992
	 release of S)
	make Lmake Gmake
	cat $FOO/make.extra >> makefile
	make world

The last step will create the intermediate file data/world.line,
which is about 40 megabytes in size, so be forewarned!  The final
data/world.L file is about 15 megabytes in size.  These, together
with the two copies of the small.line file, total 65 megabytes of
space that you will need to complete this process.  After you have
cleaned up (get rid of the files in $FOO, and do "make clean") your
disk will only be 15 megabytes poorer.  Before you do the cleanup,
however, read the next paragraph.

This world database has about two million (latitude,longitude) pairs
in it.  As such, if you try to make a full world map with map('world')
you will probably crash S and maybe your computer too.  Smaller maps,
such as map('world','canada') should work fine.  We have included a C program,
thinner.c, that will create a thinned version of the full database,
which might be appropriate for world maps.  It takes one argument --
the delta tolerance for the thinning algorithm.  For example, a value
of 0.002 is about right for a world map on a 300 dpi laser printer.
So you could do:

	cp $FOO/thinner.c .
	make thinner
	thinner 0.002 < data/world.line > data/world.thin.line
	Lmake 6 s b data/world.thin.line data/world.thin.L
	rm data/world.thin.line
	ln data/world.G data/world.thin.G
	ln data/world.N data/world.thin.N

Now map('world.thin') should work fine, both on a screen and on a printer.

The shell script sub.gdb is a program that will go into the ascii version
of a map database and extract information to construct a sub-database.  It
takes as its two arguments the names of the old and new databases and reads
on its standard input a list of region numbers.

By the way, there is an interesting dataset that can be used in
conjunction with the world map to make some neat pictures.  The dataset
contains average elevation in meters for each of the 259200 1/2x1/2
degree patches on the surface of the earth.  It's available by
anonymous ftp from hanauma.stanford.edu; the file is in the pub
directory and is called earth_topo_720x360.Z.  When uncompressed this
file is a set of binary single precision IEEE floating point numbers.
The file records all the data on one parallel of latitude contiguously
starting from the prime meridian and working east, and it proceeds from
north to south along parallels of latitude.

Reasonable feedback to us is welcome.  Good luck!

==============================================
Richard A. Becker	rab@research.att.com
Allan R. Wilks		allan@research.att.com
==============================================
