Polyline Plotting
Introduction
Polylines provide the ability to draw arbitrary polylines
(polylines if not closed, polygons if closed)
over a geographic area. These can be shaded or not, and various
attribute parameters are available to specify their appearance.
The data for polylines can come directly from arrays stored in memory
or from text files of specified format. The action routine
PLINE draws the polygons.
Example uses of polylines include:
Highlighting an area of interest on a map.
Colour-coding different catchement areas with shaded polygons.
Shading precomputed data on an irregular grid.
Magics++
Polyline plotting was introduces with Magics++ version 2.0.
Is polyline plotting not very similiar to mapgen boundary plotting? What are the differences?
Polyline Plotting
Plotting of polylines is in some ways similar to the plotting
of contours (see ).
See
and
for details, but there are various parameters both for specifying
the line plotting and the shading attributes. All polylines drawn with
a single call to PLINE will share the same
line attributes; however, they may be shaded differently if desired.
Because this is a little more complicated, it is dealt with in more
detail now.
Polyline Shading Bands
When polygons are shaded, they are done so according to their
corresponding value. An internal table is set up which maps ranges
of values to colours; each range is called a band.
This table may be set up in a number of ways,
and is bounded by the parameters
POLYLINE_SHADE_MIN_LEVEL and
POLYLINE_SHADE_MAX_LEVEL; polygons with
values outside this range will not be shaded.
To plot one level only, users should simply set the parameters
POLYLINE_MAX_LEVEL and
POLYLINE_MIN_LEVEL to the level required.
There are three ways of specifying how the colour table
should be generated, set with the parameter
POLYLINE_SHADE_LEVEL_SELECTION_TYPE which can
have one of the following values: COUNT, INTERVAL
or LEVEL_LIST, described in more detail below.
Polyline Shading Levels Specified by 'COUNT'
The number of shading levels may be set by the user by setting the
parameter POLYLINE_SHADE_LEVEL_SELECTION_TYPE to
'COUNT' (default) and
POLYLINE_LEVEL_COUNT to the number of levels to be
shaded. Magics will then calculate the
size of the interval and the user's plot will consist of the number of
levels specified with a regular shading interval. This is the default
method and the default number of levels is 10. The exact number of
levels plotted may not be
POLYLINE_LEVEL_COUNT as PLINE
will always use the value stored in
POLYLINE_REFERENCE_LEVEL as a starting point and
will try to pick reasonable values for the interval.
Polyline Shading Levels Selected by 'INTERVAL'
If the parameter
POLYLINE_SHADE_LEVEL_SELECTION_TYPE is set to
'INTERVAL', Magics will shade
polygons at regularly spaced intervals using the value of
POLYLINE_REFERENCE_LEVEL as a base and the value
in POLYLINE_INTERVAL as the interval between
levels.
Polyline Shading Levels Selected by 'LEVEL_LIST'
Users may supply a list of the polygon shading levels to be plotted by
setting the parameter
POLYLINE_SHADE_LEVEL_SELECTION_TYPE to
'LEVEL_LIST' and passing an array of level values.
The passing of the array of values is achieved by calling the routine
PSET1R thus
CALL PSET1R('POLYLINE_LEVEL_LIST',ARRAY,N)
where 'ARRAY' is the name of the array and
'N' is the number of values in the array. This method
enables users to shade polygons with irregular intervals.
Polyline Shading Colours
Users may control the colour of the shading by setting the
parameters POLYLINE_SHADE_MAX_LEVEL_COLOUR and
POLYLINE_SHADE_MIN_LEVEL_COLOUR to the required
values, default values being BLUE and RED
respectively.
Colour shading is performed in such a way that, starting with
POLYLINE_SHADE_MIN_LEVEL_COLOUR, the colour of
each subsequent shading band will vary from the preceding band by a
factor that depends on the number of bands to be shaded.
The colour of the last band to be shaded will be
POLYLINE_SHADE_MAX_LEVEL_COLOUR and the shading
colour of the intermediate bands will be calculated internally by
modifying the hue, saturation or intensity. These may or may not be
discreet colours, e.g. red, blue etc, depending on the number of bands
to be shaded.
Normally, the colour shading sequence will progress in an
anti-clockwise direction, e.g. red, yellow, green, cyan, blue. The
parameter POLYLINE_SHADE_COLOUR_DIRECTION may be
set to 'CLOCKWISE' to alter the sequence, i.e. blue, cyan,
green, yellow, red. The colour sequence is circular so that it is
possible, for example, to shade from green to yellow in an
anti-clockwise direction or from red to green in a clockwise
direction.
Black and white are not included in the normal sequence of shading
colours but are treated in a special manner. If
POLYLINE_SHADE_MIN_LEVEL_COLOUR is set to white
and POLYLINE_SHADE_MAX_LEVEL_COLOUR is set to one
of the sequencing colours, e.g. red, the shading colour sequence will
start with white and subsequent colours will be increasingly red, the
last colour in the sequence being pure red. The reverse, i.e. shading
from red to white, is performed in the same way, starting with red and
ending with white.
Shading between black and any other sequencing colour is treated
similarly. Grey scaling can be achieved by shading from black to white
or from white to black.
Polyline Shade Colour Methods
There are two methods for determining the colours to be used in
polyline shading. The parameter
POLYLINE_SHADE_COLOUR_METHOD should be used to
define which method is required. Valid values are LIST and
CALCULATE (default). In the default method
(CALCULATE), the colour of bands is calculated
automatically from the
values in POLYLINE_SHADE_MIN_LEVEL,
POLYLINE_SHADE_MAX_LEVEL,
POLYLINE_SHADE_MIN_LEVEL_COLOUR and
POLYLINE_SHADE_MAX_LEVEL_COLOUR.
For manual control, the method LIST allows the user
to pass an array of colours to be used in the shading,
for example,
CALL PSET1C('POLYLINE_SHADE_COLOUR_LIST',CLIST,N)
CLIST is an array of type character and length
N containing a list of colours to be used in
shading. The colour in CLIST will be used in a cyclic way:
CLIST(I), CLIST(I+1) will be used to shade the
I th , I+1 th shading bands etc.
MagML Templates for Polyline Plotting
Program Examples
The following examples demonstrate the use of polylines.
The first example shows a set of catchement areas whose boundaries
are defined in a text file. Another text file provides values for
each of these areas.