[comp.sources.misc] v09i007: map program no. 1 of 2

allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) (11/27/89)

Posting-number: Volume 9, Issue 7
Submitted-by: gunnaro@hafro.is (Gunnar Orvarsson)
Archive-name: map_go/part01

            map program: no. 1 of 2
                         This shell archive contains a reference manual
                         for the program, and a README file where some
                         changes are described.
                         Unwrap this file ( no. 1) first.
                       


#---------------------------------- cut here ----------------------------------
# This is a shell archive.  Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by Gunnar Orvarsson <gunnaro@gst> on Mon Nov 20 15:52:10 1989
#
# This archive contains:
#	Map	
#
# Error checking via wc(1) will be performed.

LANG=""; export LANG

echo mkdir - Map
mkdir Map

echo x - Map/README
cat >Map/README <<'@EOF'

Program:
	MAP

Author:
	Hughonnun s.f.

Purpose:
	To draw a map with the options selected by the user.

Parameters:
	  The VENIX  operating  system supplies  this program with two
	  parameters:  (1) the  number of  arguments  specified on the 
          command  line  when  this  program  was executed; and (2) an 
          array  containing  a  copy  of  the  arguments specified.  A 
          detailed description of this can be  found in chapter two of
          'VENIX PROGRAMMING GUIDE'.

Description:
	  This   program   calls  a  variety  of  external  functions.
	  Some are always called, and some are  only  called  if   the
	  user  has specified  that  particular option.  An example is 
          the 'tic' function, which is only called when the user wants 
          to make ticmarks on the map's edges. 

Latest changes:
	Map can now run in colour on bst.
	Map can output in colour on hpgl printers.
	Map can use diffrent line modes on hpgl printers and on X-servers.
	ex: short-dashes, long-dashes etc. (see map manual).
	The window command has been written for use with the plot filters.
	The   predefined  station  type  symbols  described  in  the  'MAP
	REFERENCE MANUAL'  (see -o station)  have  been altered. They are:
		
		Type	Symbol Description
		---	------------------
		1 	An empty triangle.
		2 	A filled triangle.
		3 	A plus sign.
		4	An empty square box.
		5	A filled square box.
		6	An empty circle.
		7	An empty diamond.
                8	An x.

Examples:
	See examples of using map in the directory Examples.  Various maps
	are kept in the directory /usr/local/src/Kort.


Usage:
	A complete script description is provided  in  the  'MAP REFERENCE
        MANUAL'.

	Map can be used in the following ways:

	Output on screen:
        	hafro> map <script> | plot -Tx [=widthxheight+x+y] 
               		   (default: 1140x860+40+40).  

		Uses xplot, a plot(1) filter for X11.

	Output on plotter:
		hafro> map <script> | plot -Thpgl | rsh hafkul lpr -h -Pplt 
		
		Uses hpglplot, a plot(1) filter for hpgl.

	Output on printer:
		hafro> map <script> | plot -Tgrap | lprenta8
                
	 	Uses graplot, a plot(1) filter for graph output.
                 
                 
        On HP-machines a filter using the Starbase library can be
        used in the following way. The output is directed to the
        screen.
                 
                HP> map <script> | plothp -Tstar  

Before running:
	setenv GTERM x
	setenv DISPLAY <machine>:0

	Remember: -w 0.0 1.0 0.0 1.0 in the script-file.

		
@EOF
set `wc -lwc <Map/README`
if test $1$2$3 != 863652553
then
	echo ERROR: wc results of Map/README are $* should be 86 365 2553
fi

chmod 644 Map/README

echo x - Map/MAP.REF
cat >Map/MAP.REF <<'@EOF'
MAPPER                                           Reference Manual 




Name:           region - select a geographical region

Usage:          -r <min_lat> <max_lat> <min_long> <max_long>

Description:    This option enables the user to select the
                geographical region to be drawn.  Furthermore,
                any subsequent data which does not fit within
                the given region, will be ignored.  the given
                region will be ignored.  However, lines which
                cross the region boundaries will drawn up to the
                boundaries. 

                Each positional argument is supplied as
                "ddmmss", where "dd" signifies degrees, "mm"
                minutes, and "ss" seconds. 

Default:        The default for this parameter is from 60 to 68
                degrees latitude, and from 10 to 28 degrees
                longitude. 

Example(s):     map

                map 
                -r 620000 680000 100000 280000
.bp
MAPPER                                           Reference Manual 



Name:           erase - erase the device screen before drawing

Usage:          -e

Description:    This parameter causes the device screen to be
                erased before drawning on it.  However, when
                using a hard copy device (such as the Hewlett
                Packard 7470A plotter) this parameter has no
                effect. 

Deault:         If this parameter is not present the device
                screen will not be erased before drawing on it. 

Example(s):     map -e
.bp
MAPPER                                           Reference Manual 



Name:           border - draw coastal lines on map

Usage:          -b <filename>

Descripton:     If the border parameter is selected, the program
                will draw the costal lines which fit within the
                geographical area specified by the region
                parameter.  The <filename> argument is
                required.  It indicates which file contains the
                coordinates describing the borders to be drawn. 

Default:        The default is not to draw any borders. 

Example(s):     map 
                -b island.d

File(s):        The datafile containing the coordinates of the
                border has the format: 'ddmmss ddmmss p'; the
                first two elements are latitudinal and
                longitudinal positions respectively ('dd'
                signifies degrees, 'mm' minutes, and 'ss'
                seconds); the third element in the file
                instructs the plotter whether to to hold the pen
                up (p = 0) or down (p = 1) while moving it to
                the given point. 
.bp
MAPPER                                           Reference Manual 


Name:           label - label degrees/minutes/seconds

Usage:          -l <latitudinal_interval>
                <longitudinal_interval>

Description:    This parameter enables the user to label the
                latitudinal and longitudinal axes at the given
                intervals.  Each argument is on the form
                'ddmmss', where 'dd' signifies degrees, 'mm'
                minutes, and 'ss' seconds.  Latitudinal and
                longitudinal labels are always drawn by the left
                and top axes respectively. 

                A label will always be prepared in one of three
                formats depending on what accuracy is needed. 
                The three formats are: (1) 'dd', (2) 'ddmm', and
                (3) 'ddmmss'. 

Default:        The default is to skip labels. 

Example(s):     map 
                -l 010000 020000
.bp
MAPPER                                           Reference Manual 


Name:           tic - draw ticmarks on map boundaries

Usage:          -t <latitudinal_interval>
                <longitudinal_interval>

Description:    The tic parameter causes ticmarks to be drawn
                according to the interval arguments specified. 
                Each argument has the format 'ddmmss', where
                'dd' signifies degrees, 'mm' minutes, and 'ss'
                seconds. 

Default:        Ticmarks will be skipped if this parameter is
                not specified. 

Example(s):     map 
                -t 003000 010000

                map 
                -l 010000 020000 
                -t 003000 010000
.bp
MAPPER                                           Reference Manual 


Name:           comment - insert some text below the map

Usage:          -c "<comment_text>"

Description:    This option plotts the contents of the
                <comment_text> argument immediately below the
                map's bottom axis.  The comment must be enclosed
                by quotes.  If quotes are needed within the text
                itself, try using single quotes within the text
                and double quotes to enclose it, or vice versa. 

                Multiple lines can be specified by inserting the
                hat character (^) where line breaks are
                desired.  The hat character will always be
                interpreted as a linebreak indicator; it cannot
                be a part of the comment itself. 

Default:        There is no default for this parameter; if there
                is no comment parameter specified, no space will
                be reserved for comments. 

Example(s):     map 
                -b island.d 
                -c "ISLAND"

                map 
                -f 
                -c "an empty map with a frame^and two 'comment'
                lines"
.bp
MAPPER                                           Reference Manual 


Name:           frame - draw a frame arround the map

Usage:          -f

Description:    The purpose of this parameter is to draw a frame
                arround the entire map, including labels and
                comment lines.  More specifically, it draws a
                frame arround the area defined by the window
                option. 

Examples:       map 
                -f

                map 
                -w 0.0 1.4 0.0 1.0 
                -f
.bp
MAPPER						Reference Manual


Name:           window - select a window area on device screen

Usage:          -w <x_min> <x_max> <y_min> <y_max>

Description:    The window parameter allows the user to control
                the size and location of the map on the device
                screen.  The four arguments are given with
                respect to the largest square which will fit
                onto the screen.  The minimum and maximum values
                are 0.0 and 1.0 respectively.  Areas outside
                this square may be used by raising the
                corresponding maximum value above 1.0.

Default:        The default setting is 0.0 1.0 0.0 1.0.

Examples:       map 
                -w 0.0 1.0 0.0 1.0 
                -b island.d

                map 
                -w 0.0 1.4 0.0 1.0 
                -b island.d

.bp
MAPPER                                           Reference Manual 


Name:           pattern - select a line style and colour

Usage:          -p{f|b|l|t|c|o} <sc>

Description:    The pattern parameter allows the user to select
                a specific line style and colour before
                drawing.  The letter following -p (one of
                'fbltco') indicates the parameter it applies to
                (i.e.  '-pl' means that one wants to select a
                different line style and color for label).  The
                <sc> argument consists of two digits: the first
                indicates the line style; the second digit the
                line colour.  The line style digit can take one
                of the following values:

                   0          solid line
                   1          dotted line
                   2          longdashed line
                   3          shortdashed line
                   4          dotdashed line

                The colour argument, which is also a single
                digit, has a meaning which is rather device
                dependent.  Please refer to the relevant device
                documentation, or just try it - it won't hurt! 

Default:        The default line style is '0' (solid), and the
                default line colour is '0'. 

Example(s):     map 
                -b island.d 
                -pb 31 
                -l 010000 020000 
                -pl 03
.bp
MAPPER                                           Reference Manual 


Name:           option - select a special option

Usage:          -o option_name "<option_arguments>"

Description:    When this parameter is specified, a program with
                the given name is executed.  The program will
                use the last -po parameter to select the line
                style and colour.  The following is a list of
                the options currently available:

                   Option      Function

                   course      draws a vessel's course
                   site        plotts observation sites
                   station     draws station symols
                   value       plotts 'value labels'
                   shade       shades squares by value

Example(s):     See the pertinent option documentation for
                details. 

.bp
MAPPER                                           Reference Manual 


Name:           course - draw a vessel's course

Usage:          -o course "< <filename>"

Description:    This function draws lines following a vessel's
                course.  The lines are drawn in the current line
                pattern, and use data in the file known as
                <filename>.  Note that only lines which fit
                within the current geographical region will be
                drawn. 

File(s):        Each course must have its own datafile
                containing the geographical coordinates of
                points where direction was/is changed.  Each
                coordinate is on the form 'ddmmss' where 'dd'
                signifies degrees, 'mm' minutes, and 'ss'
                seconds. 

Example(s):     map -o course "< course.dat"

                map 
                -e 
                -f 
                -r 620000 640000 200000 280000 
                -l 003000 010000 
                -t 001500 003000 
                -po 31 
                -o course "< course.BS.jan84" 
                -po 01 
                -o course "< course.AF.jan84"

File(s):        Each entry in the datafile contains one
                latitudinal and one logitudinal position on the
                form 'ddmmss', where 'dd' signifies degrees,
                'mm' minutes, and 'ss' seconds. 

.bp
MAPPER                                           Reference Manual 


Name:           site - plotts observation/station sites on a map

Usage:          -o site "< <datafile>"

Description:    The site option reads through the datafile
                presented to it, and draws a small cross at the
                locations specified.  The program does not check
                for redundant points. 

Example(s):     map -o site "< site.AF.jul85"

                map 
                -w 0.0 0.7 0.5 1.0 
                -r 620000 680000 100000 280000 
                -l 020000 050000 
                -t 010000 023000 
                -o site "< site.AF.jul85"

File(s):        Each entry in the datafile contains one
                latitudinal and one longitudinal position on the
                form 'ddmmss', where 'dd' signifies degrees,
                'mm' minutes, and 'ss' seconds. 
.bp
MAPPER                                           Reference Manual 


Name:           value - draws a value label at a given location

Usage:          -o value "< <datafile>"

Description:    The value option enables the user to label
                certain datapoints with their associated 'value
                labels'.  A 'value label' is anything which
                follows the geographical position in the
                datafile. 

Example(s):     map -o value "< value.DROFN.mai83"

                map 
                -e 
                -f 
                -r 620000 640000 200000 280000 
                -l 003000 010000 
                -t 001500 003000 
                -po 31 
                -o value "< value.DROFN.mai83"

File(s):        The datafile for this option has a latitudinal
                and a longitudinal position on the form
                'ddmmss', where 'dd' signifies degrees, 'mm'
                minutes, and 'ss' seconds.  Each line also
                contains an optional 'value label', which is
                anything following the positions and upto the
                end of the line. 

.bp
MAPPER                                           Reference Manual 


Name:           station - draws symbols at station locations

Usage:          -o station "< <input_file>"

Description:    The station option draws predefined symbols at
                the locations where the station was taken.  The
                coordinates of the stations are stored in the
                <input file> along with the corresponding
                station type.  There are currently seven
                predefined station type symbols; these are:

                  Type     Symbol Description

                   1       a diamond with the upper half filled
                   2       a diamond with the lower half filled
                   3       an x
                   4       an empty square box
                   5       a square box with an empty circle
                   6       an empty circle
                   7       a filled circle

                Currently, the program does not check to see
                whether a symbol has already been placed at a
                given location, and will therefore write one
                symbol over another if told to. 

File(s):        The input file for this option contains three
                data elements for each station: (1) a
                latitudinal position, (2) a longitudinal
                position, and (3) a station type.  The first two
                data elements are on the 'ddmmss' form, where
                'dd' signifies degrees, 'mm' minutes, and 'ss'
                seconds.  The third element is an integer
                between 1 and 7.

Default:        If the station type is out of range, nothing
                will be drawn, and no error message will be
                issued. 

Example(s):     map 
                -e 
                -b island.d 
                -r 640000 660000 140000 240000 
                -l 010000 010000 
                -t 003000 003000 
                -o station "< station.AF.agust85"

.bp
MAPPER                                           Reference Manual 

Name:           shade - darkens squares according to data

Usage:          -o shade "<brake_value> <vhrl> <shade_factor>

                          [<brake_value> <vhrl> <shade_factor>] ...
                          < <filename>"

Description:    The shade option produces shaded square areas
                according to the arguments presented with the
                option, and the input data. 

                The <break_value> argument is a double precision
                floating point number, which indicates at what
                point in the data a type of shading stops.  An
                area which has a data value less than or equal
                to the break value will be shaded according to
                the conditions specified by the next two
                arguments.  One should always supply one
                breakpoint which is at least equal to the
                largest data element in the input file. 
                However, if a data element is read which is
                larger than the highest break value, a message
                will be issued, and the data ignored. 

                The argument <vhrl> is an indicator which
                specifies what kind of pattern will be used when
                shading the area.  The letters 'vhrl' stand for
                'vertical lines', 'horizontal lines', 'right
                sloping lines', and 'left sloping lines'
                respectively.  Each of the four is a single
                digit which can take the value of '0' or '1'. 
                If the value is '0', that particular type of
                line will not be used in shading the area,
                whereas a value of '1' means that it will be
                used.  Any combantion of the four is valid. 

                The argument <shade_factor> is an integer which
                specifies how many lines are to be drawn if the
                square is the largest one possible on the device
                screen.  Values between 0 and 4-500 are
                resonable.  There is, however, no rule in
                applying this factor.  It does not seem to have
                a linear quality, so you could try a few
                variations in order to find the appropriate
                shades for your square.
.bp
MAPPER                                           Reference Manual 


Example(s):     map 
                -e 
                -f 
                -b island.d
                -r 620000 680000 1000000 280000 
                -l 010000 020000 
                -t 003000 010000 
                -c "an example of shading" 
                -po 31 
                -o shade 
                " 0.0 0010 0 
                  10.0 0010 50 
                  100.0 0010 100 
                  1000.0 0010 200 
                  10000.0 0010 400 
                < togarar.d"

File(s):        The input file is on the PRELUDE format.  Each
                record contains five elements: (1) minimun
                latitude, (2) maximum latitude, (3) mininum
                longitude, (4) maximum longitude, and (5) a data
                value.  The first four elements have the form
                'ddmmss', where 'dd' signifies degrees, 'mm'
                minutes, and 'ss' seconds.  Together, the four
                elements specify a geographical square area. 
                The fifth element is a double precision floating
                point number which indicates the value for that
                particular square. 

@EOF
set `wc -lwc <Map/MAP.REF`
if test $1$2$3 != 502205618492
then
	echo ERROR: wc results of Map/MAP.REF are $* should be 502 2056 18492
fi

chmod 777 Map/MAP.REF

chmod 777 Map

exit 0