home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / misc / volume9 / map_go / part01 next >
Text File  |  1989-11-26  |  23KB  |  653 lines

  1. Newsgroups: comp.sources.misc
  2. organization: Marine Research Institute, Reykjavik
  3. subject: v09i007: map program no. 1 of 2
  4. from: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc)
  5. Reply-To: gunnaro@hafro.is (Gunnar Orvarsson)
  6.  
  7. Posting-number: Volume 9, Issue 7
  8. Submitted-by: gunnaro@hafro.is (Gunnar Orvarsson)
  9. Archive-name: map_go/part01
  10.  
  11.             map program: no. 1 of 2
  12.                          This shell archive contains a reference manual
  13.                          for the program, and a README file where some
  14.                          changes are described.
  15.                          Unwrap this file ( no. 1) first.
  16.                        
  17.  
  18.  
  19. #---------------------------------- cut here ----------------------------------
  20. # This is a shell archive.  Remove anything before this line,
  21. # then unpack it by saving it in a file and typing "sh file".
  22. #
  23. # Wrapped by Gunnar Orvarsson <gunnaro@gst> on Mon Nov 20 15:52:10 1989
  24. #
  25. # This archive contains:
  26. #    Map    
  27. #
  28. # Error checking via wc(1) will be performed.
  29.  
  30. LANG=""; export LANG
  31.  
  32. echo mkdir - Map
  33. mkdir Map
  34.  
  35. echo x - Map/README
  36. cat >Map/README <<'@EOF'
  37.  
  38. Program:
  39.     MAP
  40.  
  41. Author:
  42.     Hughonnun s.f.
  43.  
  44. Purpose:
  45.     To draw a map with the options selected by the user.
  46.  
  47. Parameters:
  48.       The VENIX  operating  system supplies  this program with two
  49.       parameters:  (1) the  number of  arguments  specified on the 
  50.           command  line  when  this  program  was executed; and (2) an 
  51.           array  containing  a  copy  of  the  arguments specified.  A 
  52.           detailed description of this can be  found in chapter two of
  53.           'VENIX PROGRAMMING GUIDE'.
  54.  
  55. Description:
  56.       This   program   calls  a  variety  of  external  functions.
  57.       Some are always called, and some are  only  called  if   the
  58.       user  has specified  that  particular option.  An example is 
  59.           the 'tic' function, which is only called when the user wants 
  60.           to make ticmarks on the map's edges. 
  61.  
  62. Latest changes:
  63.     Map can now run in colour on bst.
  64.     Map can output in colour on hpgl printers.
  65.     Map can use diffrent line modes on hpgl printers and on X-servers.
  66.     ex: short-dashes, long-dashes etc. (see map manual).
  67.     The window command has been written for use with the plot filters.
  68.     The   predefined  station  type  symbols  described  in  the  'MAP
  69.     REFERENCE MANUAL'  (see -o station)  have  been altered. They are:
  70.         
  71.         Type    Symbol Description
  72.         ---    ------------------
  73.         1     An empty triangle.
  74.         2     A filled triangle.
  75.         3     A plus sign.
  76.         4    An empty square box.
  77.         5    A filled square box.
  78.         6    An empty circle.
  79.         7    An empty diamond.
  80.                 8    An x.
  81.  
  82. Examples:
  83.     See examples of using map in the directory Examples.  Various maps
  84.     are kept in the directory /usr/local/src/Kort.
  85.  
  86.  
  87. Usage:
  88.     A complete script description is provided  in  the  'MAP REFERENCE
  89.         MANUAL'.
  90.  
  91.     Map can be used in the following ways:
  92.  
  93.     Output on screen:
  94.             hafro> map <script> | plot -Tx [=widthxheight+x+y] 
  95.                           (default: 1140x860+40+40).  
  96.  
  97.         Uses xplot, a plot(1) filter for X11.
  98.  
  99.     Output on plotter:
  100.         hafro> map <script> | plot -Thpgl | rsh hafkul lpr -h -Pplt 
  101.         
  102.         Uses hpglplot, a plot(1) filter for hpgl.
  103.  
  104.     Output on printer:
  105.         hafro> map <script> | plot -Tgrap | lprenta8
  106.                 
  107.          Uses graplot, a plot(1) filter for graph output.
  108.                  
  109.                  
  110.         On HP-machines a filter using the Starbase library can be
  111.         used in the following way. The output is directed to the
  112.         screen.
  113.                  
  114.                 HP> map <script> | plothp -Tstar  
  115.  
  116. Before running:
  117.     setenv GTERM x
  118.     setenv DISPLAY <machine>:0
  119.  
  120.     Remember: -w 0.0 1.0 0.0 1.0 in the script-file.
  121.  
  122.         
  123. @EOF
  124. set `wc -lwc <Map/README`
  125. if test $1$2$3 != 863652553
  126. then
  127.     echo ERROR: wc results of Map/README are $* should be 86 365 2553
  128. fi
  129.  
  130. chmod 644 Map/README
  131.  
  132. echo x - Map/MAP.REF
  133. cat >Map/MAP.REF <<'@EOF'
  134. MAPPER                                           Reference Manual 
  135.  
  136.  
  137.  
  138.  
  139. Name:           region - select a geographical region
  140.  
  141. Usage:          -r <min_lat> <max_lat> <min_long> <max_long>
  142.  
  143. Description:    This option enables the user to select the
  144.                 geographical region to be drawn.  Furthermore,
  145.                 any subsequent data which does not fit within
  146.                 the given region, will be ignored.  the given
  147.                 region will be ignored.  However, lines which
  148.                 cross the region boundaries will drawn up to the
  149.                 boundaries. 
  150.  
  151.                 Each positional argument is supplied as
  152.                 "ddmmss", where "dd" signifies degrees, "mm"
  153.                 minutes, and "ss" seconds. 
  154.  
  155. Default:        The default for this parameter is from 60 to 68
  156.                 degrees latitude, and from 10 to 28 degrees
  157.                 longitude. 
  158.  
  159. Example(s):     map
  160.  
  161.                 map 
  162.                 -r 620000 680000 100000 280000
  163. .bp
  164. MAPPER                                           Reference Manual 
  165.  
  166.  
  167.  
  168. Name:           erase - erase the device screen before drawing
  169.  
  170. Usage:          -e
  171.  
  172. Description:    This parameter causes the device screen to be
  173.                 erased before drawning on it.  However, when
  174.                 using a hard copy device (such as the Hewlett
  175.                 Packard 7470A plotter) this parameter has no
  176.                 effect. 
  177.  
  178. Deault:         If this parameter is not present the device
  179.                 screen will not be erased before drawing on it. 
  180.  
  181. Example(s):     map -e
  182. .bp
  183. MAPPER                                           Reference Manual 
  184.  
  185.  
  186.  
  187. Name:           border - draw coastal lines on map
  188.  
  189. Usage:          -b <filename>
  190.  
  191. Descripton:     If the border parameter is selected, the program
  192.                 will draw the costal lines which fit within the
  193.                 geographical area specified by the region
  194.                 parameter.  The <filename> argument is
  195.                 required.  It indicates which file contains the
  196.                 coordinates describing the borders to be drawn. 
  197.  
  198. Default:        The default is not to draw any borders. 
  199.  
  200. Example(s):     map 
  201.                 -b island.d
  202.  
  203. File(s):        The datafile containing the coordinates of the
  204.                 border has the format: 'ddmmss ddmmss p'; the
  205.                 first two elements are latitudinal and
  206.                 longitudinal positions respectively ('dd'
  207.                 signifies degrees, 'mm' minutes, and 'ss'
  208.                 seconds); the third element in the file
  209.                 instructs the plotter whether to to hold the pen
  210.                 up (p = 0) or down (p = 1) while moving it to
  211.                 the given point. 
  212. .bp
  213. MAPPER                                           Reference Manual 
  214.  
  215.  
  216. Name:           label - label degrees/minutes/seconds
  217.  
  218. Usage:          -l <latitudinal_interval>
  219.                 <longitudinal_interval>
  220.  
  221. Description:    This parameter enables the user to label the
  222.                 latitudinal and longitudinal axes at the given
  223.                 intervals.  Each argument is on the form
  224.                 'ddmmss', where 'dd' signifies degrees, 'mm'
  225.                 minutes, and 'ss' seconds.  Latitudinal and
  226.                 longitudinal labels are always drawn by the left
  227.                 and top axes respectively. 
  228.  
  229.                 A label will always be prepared in one of three
  230.                 formats depending on what accuracy is needed. 
  231.                 The three formats are: (1) 'dd', (2) 'ddmm', and
  232.                 (3) 'ddmmss'. 
  233.  
  234. Default:        The default is to skip labels. 
  235.  
  236. Example(s):     map 
  237.                 -l 010000 020000
  238. .bp
  239. MAPPER                                           Reference Manual 
  240.  
  241.  
  242. Name:           tic - draw ticmarks on map boundaries
  243.  
  244. Usage:          -t <latitudinal_interval>
  245.                 <longitudinal_interval>
  246.  
  247. Description:    The tic parameter causes ticmarks to be drawn
  248.                 according to the interval arguments specified. 
  249.                 Each argument has the format 'ddmmss', where
  250.                 'dd' signifies degrees, 'mm' minutes, and 'ss'
  251.                 seconds. 
  252.  
  253. Default:        Ticmarks will be skipped if this parameter is
  254.                 not specified. 
  255.  
  256. Example(s):     map 
  257.                 -t 003000 010000
  258.  
  259.                 map 
  260.                 -l 010000 020000 
  261.                 -t 003000 010000
  262. .bp
  263. MAPPER                                           Reference Manual 
  264.  
  265.  
  266. Name:           comment - insert some text below the map
  267.  
  268. Usage:          -c "<comment_text>"
  269.  
  270. Description:    This option plotts the contents of the
  271.                 <comment_text> argument immediately below the
  272.                 map's bottom axis.  The comment must be enclosed
  273.                 by quotes.  If quotes are needed within the text
  274.                 itself, try using single quotes within the text
  275.                 and double quotes to enclose it, or vice versa. 
  276.  
  277.                 Multiple lines can be specified by inserting the
  278.                 hat character (^) where line breaks are
  279.                 desired.  The hat character will always be
  280.                 interpreted as a linebreak indicator; it cannot
  281.                 be a part of the comment itself. 
  282.  
  283. Default:        There is no default for this parameter; if there
  284.                 is no comment parameter specified, no space will
  285.                 be reserved for comments. 
  286.  
  287. Example(s):     map 
  288.                 -b island.d 
  289.                 -c "ISLAND"
  290.  
  291.                 map 
  292.                 -f 
  293.                 -c "an empty map with a frame^and two 'comment'
  294.                 lines"
  295. .bp
  296. MAPPER                                           Reference Manual 
  297.  
  298.  
  299. Name:           frame - draw a frame arround the map
  300.  
  301. Usage:          -f
  302.  
  303. Description:    The purpose of this parameter is to draw a frame
  304.                 arround the entire map, including labels and
  305.                 comment lines.  More specifically, it draws a
  306.                 frame arround the area defined by the window
  307.                 option. 
  308.  
  309. Examples:       map 
  310.                 -f
  311.  
  312.                 map 
  313.                 -w 0.0 1.4 0.0 1.0 
  314.                 -f
  315. .bp
  316. MAPPER                        Reference Manual
  317.  
  318.  
  319. Name:           window - select a window area on device screen
  320.  
  321. Usage:          -w <x_min> <x_max> <y_min> <y_max>
  322.  
  323. Description:    The window parameter allows the user to control
  324.                 the size and location of the map on the device
  325.                 screen.  The four arguments are given with
  326.                 respect to the largest square which will fit
  327.                 onto the screen.  The minimum and maximum values
  328.                 are 0.0 and 1.0 respectively.  Areas outside
  329.                 this square may be used by raising the
  330.                 corresponding maximum value above 1.0.
  331.  
  332. Default:        The default setting is 0.0 1.0 0.0 1.0.
  333.  
  334. Examples:       map 
  335.                 -w 0.0 1.0 0.0 1.0 
  336.                 -b island.d
  337.  
  338.                 map 
  339.                 -w 0.0 1.4 0.0 1.0 
  340.                 -b island.d
  341.  
  342. .bp
  343. MAPPER                                           Reference Manual 
  344.  
  345.  
  346. Name:           pattern - select a line style and colour
  347.  
  348. Usage:          -p{f|b|l|t|c|o} <sc>
  349.  
  350. Description:    The pattern parameter allows the user to select
  351.                 a specific line style and colour before
  352.                 drawing.  The letter following -p (one of
  353.                 'fbltco') indicates the parameter it applies to
  354.                 (i.e.  '-pl' means that one wants to select a
  355.                 different line style and color for label).  The
  356.                 <sc> argument consists of two digits: the first
  357.                 indicates the line style; the second digit the
  358.                 line colour.  The line style digit can take one
  359.                 of the following values:
  360.  
  361.                    0          solid line
  362.                    1          dotted line
  363.                    2          longdashed line
  364.                    3          shortdashed line
  365.                    4          dotdashed line
  366.  
  367.                 The colour argument, which is also a single
  368.                 digit, has a meaning which is rather device
  369.                 dependent.  Please refer to the relevant device
  370.                 documentation, or just try it - it won't hurt! 
  371.  
  372. Default:        The default line style is '0' (solid), and the
  373.                 default line colour is '0'. 
  374.  
  375. Example(s):     map 
  376.                 -b island.d 
  377.                 -pb 31 
  378.                 -l 010000 020000 
  379.                 -pl 03
  380. .bp
  381. MAPPER                                           Reference Manual 
  382.  
  383.  
  384. Name:           option - select a special option
  385.  
  386. Usage:          -o option_name "<option_arguments>"
  387.  
  388. Description:    When this parameter is specified, a program with
  389.                 the given name is executed.  The program will
  390.                 use the last -po parameter to select the line
  391.                 style and colour.  The following is a list of
  392.                 the options currently available:
  393.  
  394.                    Option      Function
  395.  
  396.                    course      draws a vessel's course
  397.                    site        plotts observation sites
  398.                    station     draws station symols
  399.                    value       plotts 'value labels'
  400.                    shade       shades squares by value
  401.  
  402. Example(s):     See the pertinent option documentation for
  403.                 details. 
  404.  
  405. .bp
  406. MAPPER                                           Reference Manual 
  407.  
  408.  
  409. Name:           course - draw a vessel's course
  410.  
  411. Usage:          -o course "< <filename>"
  412.  
  413. Description:    This function draws lines following a vessel's
  414.                 course.  The lines are drawn in the current line
  415.                 pattern, and use data in the file known as
  416.                 <filename>.  Note that only lines which fit
  417.                 within the current geographical region will be
  418.                 drawn. 
  419.  
  420. File(s):        Each course must have its own datafile
  421.                 containing the geographical coordinates of
  422.                 points where direction was/is changed.  Each
  423.                 coordinate is on the form 'ddmmss' where 'dd'
  424.                 signifies degrees, 'mm' minutes, and 'ss'
  425.                 seconds. 
  426.  
  427. Example(s):     map -o course "< course.dat"
  428.  
  429.                 map 
  430.                 -e 
  431.                 -f 
  432.                 -r 620000 640000 200000 280000 
  433.                 -l 003000 010000 
  434.                 -t 001500 003000 
  435.                 -po 31 
  436.                 -o course "< course.BS.jan84" 
  437.                 -po 01 
  438.                 -o course "< course.AF.jan84"
  439.  
  440. File(s):        Each entry in the datafile contains one
  441.                 latitudinal and one logitudinal position on the
  442.                 form 'ddmmss', where 'dd' signifies degrees,
  443.                 'mm' minutes, and 'ss' seconds. 
  444.  
  445. .bp
  446. MAPPER                                           Reference Manual 
  447.  
  448.  
  449. Name:           site - plotts observation/station sites on a map
  450.  
  451. Usage:          -o site "< <datafile>"
  452.  
  453. Description:    The site option reads through the datafile
  454.                 presented to it, and draws a small cross at the
  455.                 locations specified.  The program does not check
  456.                 for redundant points. 
  457.  
  458. Example(s):     map -o site "< site.AF.jul85"
  459.  
  460.                 map 
  461.                 -w 0.0 0.7 0.5 1.0 
  462.                 -r 620000 680000 100000 280000 
  463.                 -l 020000 050000 
  464.                 -t 010000 023000 
  465.                 -o site "< site.AF.jul85"
  466.  
  467. File(s):        Each entry in the datafile contains one
  468.                 latitudinal and one longitudinal position on the
  469.                 form 'ddmmss', where 'dd' signifies degrees,
  470.                 'mm' minutes, and 'ss' seconds. 
  471. .bp
  472. MAPPER                                           Reference Manual 
  473.  
  474.  
  475. Name:           value - draws a value label at a given location
  476.  
  477. Usage:          -o value "< <datafile>"
  478.  
  479. Description:    The value option enables the user to label
  480.                 certain datapoints with their associated 'value
  481.                 labels'.  A 'value label' is anything which
  482.                 follows the geographical position in the
  483.                 datafile. 
  484.  
  485. Example(s):     map -o value "< value.DROFN.mai83"
  486.  
  487.                 map 
  488.                 -e 
  489.                 -f 
  490.                 -r 620000 640000 200000 280000 
  491.                 -l 003000 010000 
  492.                 -t 001500 003000 
  493.                 -po 31 
  494.                 -o value "< value.DROFN.mai83"
  495.  
  496. File(s):        The datafile for this option has a latitudinal
  497.                 and a longitudinal position on the form
  498.                 'ddmmss', where 'dd' signifies degrees, 'mm'
  499.                 minutes, and 'ss' seconds.  Each line also
  500.                 contains an optional 'value label', which is
  501.                 anything following the positions and upto the
  502.                 end of the line. 
  503.  
  504. .bp
  505. MAPPER                                           Reference Manual 
  506.  
  507.  
  508. Name:           station - draws symbols at station locations
  509.  
  510. Usage:          -o station "< <input_file>"
  511.  
  512. Description:    The station option draws predefined symbols at
  513.                 the locations where the station was taken.  The
  514.                 coordinates of the stations are stored in the
  515.                 <input file> along with the corresponding
  516.                 station type.  There are currently seven
  517.                 predefined station type symbols; these are:
  518.  
  519.                   Type     Symbol Description
  520.  
  521.                    1       a diamond with the upper half filled
  522.                    2       a diamond with the lower half filled
  523.                    3       an x
  524.                    4       an empty square box
  525.                    5       a square box with an empty circle
  526.                    6       an empty circle
  527.                    7       a filled circle
  528.  
  529.                 Currently, the program does not check to see
  530.                 whether a symbol has already been placed at a
  531.                 given location, and will therefore write one
  532.                 symbol over another if told to. 
  533.  
  534. File(s):        The input file for this option contains three
  535.                 data elements for each station: (1) a
  536.                 latitudinal position, (2) a longitudinal
  537.                 position, and (3) a station type.  The first two
  538.                 data elements are on the 'ddmmss' form, where
  539.                 'dd' signifies degrees, 'mm' minutes, and 'ss'
  540.                 seconds.  The third element is an integer
  541.                 between 1 and 7.
  542.  
  543. Default:        If the station type is out of range, nothing
  544.                 will be drawn, and no error message will be
  545.                 issued. 
  546.  
  547. Example(s):     map 
  548.                 -e 
  549.                 -b island.d 
  550.                 -r 640000 660000 140000 240000 
  551.                 -l 010000 010000 
  552.                 -t 003000 003000 
  553.                 -o station "< station.AF.agust85"
  554.  
  555. .bp
  556. MAPPER                                           Reference Manual 
  557.  
  558. Name:           shade - darkens squares according to data
  559.  
  560. Usage:          -o shade "<brake_value> <vhrl> <shade_factor>
  561.  
  562.                           [<brake_value> <vhrl> <shade_factor>] ...
  563.                           < <filename>"
  564.  
  565. Description:    The shade option produces shaded square areas
  566.                 according to the arguments presented with the
  567.                 option, and the input data. 
  568.  
  569.                 The <break_value> argument is a double precision
  570.                 floating point number, which indicates at what
  571.                 point in the data a type of shading stops.  An
  572.                 area which has a data value less than or equal
  573.                 to the break value will be shaded according to
  574.                 the conditions specified by the next two
  575.                 arguments.  One should always supply one
  576.                 breakpoint which is at least equal to the
  577.                 largest data element in the input file. 
  578.                 However, if a data element is read which is
  579.                 larger than the highest break value, a message
  580.                 will be issued, and the data ignored. 
  581.  
  582.                 The argument <vhrl> is an indicator which
  583.                 specifies what kind of pattern will be used when
  584.                 shading the area.  The letters 'vhrl' stand for
  585.                 'vertical lines', 'horizontal lines', 'right
  586.                 sloping lines', and 'left sloping lines'
  587.                 respectively.  Each of the four is a single
  588.                 digit which can take the value of '0' or '1'. 
  589.                 If the value is '0', that particular type of
  590.                 line will not be used in shading the area,
  591.                 whereas a value of '1' means that it will be
  592.                 used.  Any combantion of the four is valid. 
  593.  
  594.                 The argument <shade_factor> is an integer which
  595.                 specifies how many lines are to be drawn if the
  596.                 square is the largest one possible on the device
  597.                 screen.  Values between 0 and 4-500 are
  598.                 resonable.  There is, however, no rule in
  599.                 applying this factor.  It does not seem to have
  600.                 a linear quality, so you could try a few
  601.                 variations in order to find the appropriate
  602.                 shades for your square.
  603. .bp
  604. MAPPER                                           Reference Manual 
  605.  
  606.  
  607. Example(s):     map 
  608.                 -e 
  609.                 -f 
  610.                 -b island.d
  611.                 -r 620000 680000 1000000 280000 
  612.                 -l 010000 020000 
  613.                 -t 003000 010000 
  614.                 -c "an example of shading" 
  615.                 -po 31 
  616.                 -o shade 
  617.                 " 0.0 0010 0 
  618.                   10.0 0010 50 
  619.                   100.0 0010 100 
  620.                   1000.0 0010 200 
  621.                   10000.0 0010 400 
  622.                 < togarar.d"
  623.  
  624. File(s):        The input file is on the PRELUDE format.  Each
  625.                 record contains five elements: (1) minimun
  626.                 latitude, (2) maximum latitude, (3) mininum
  627.                 longitude, (4) maximum longitude, and (5) a data
  628.                 value.  The first four elements have the form
  629.                 'ddmmss', where 'dd' signifies degrees, 'mm'
  630.                 minutes, and 'ss' seconds.  Together, the four
  631.                 elements specify a geographical square area. 
  632.                 The fifth element is a double precision floating
  633.                 point number which indicates the value for that
  634.                 particular square. 
  635.  
  636. @EOF
  637. set `wc -lwc <Map/MAP.REF`
  638. if test $1$2$3 != 502205618492
  639. then
  640.     echo ERROR: wc results of Map/MAP.REF are $* should be 502 2056 18492
  641. fi
  642.  
  643. chmod 777 Map/MAP.REF
  644.  
  645. chmod 777 Map
  646.  
  647. exit 0
  648.  
  649.  
  650.  
  651.  
  652.  
  653.