cGPSmapper Manual
Map Project
http://cgpsmapper.com/
45 of 100
Fortunately the Polish file format has a solution called 'Dictionary' which allows you to
switch map objects of the same type on or off for each level.
[DICTIONARY]
is an
optional section and follows after the
[IMG ID]
section.
4.5.2
Concepts and Terminology
[Dictionary] uses strings of 0's and 1's where the position of each digit in the string
corresponds to a specific map object type and thus controls the display of that object type.
Programmers refer to this as a bit mask. (A bit is a binary digit. In binary there are only two
digits, 0 and 1. In a bit mask 0 normally represents 'false' or 'off' and 1 represents 'true' or
'on').
In
PFM
each map object type has a code.
Refer to section 9.3 - on page 77 - for a list of
object types with codes in hexadecimal and decimal.
You do not have to be familiar with hexadecimal; the decimal equivalent works just as
well. (In hexadecimal there are 16 digits, 0 to 9 plus a to f).
In the [Dictionary] 'bit mask' each bit (digit) refers to the object type code corresponding to
the bit position, counting from the left of the string. E.g. the first bit refers to map object
type 1, the second bit refers to map object type 2 and bit 20 refers to object type 20 and so
on.
The
PFM
allows for a 'bit mask' to be defined for each map level.
The format is
Level#RGN
nn
=
<bit mask> where
#
indicates the level,
nn
the object class
(10, 20, 40 or 80) and
<bit mask>
is a string of 0's and 1's.
If you set the first bit in the 'bit mask' to 0, no objects of type 1 will display on the
corresponding level, and if you set the first bit to 1 all objects of type 1 defined for the
specific level will display. This is explained much better by an example, see 4.5.3 below
Note that you still need to specify
EndLevel=#
or
Data
#
=
for each object to extend the
object to the required level
#
. The dictionary 'bit mask' only filters out objects on layers
they are defined on. However when using dictionary, you can set
EndLevel=
to your
highest map level for all objects and control which type of objects display at which map
levels with the dictionary 'bit mask'.
Since all object are by default displayed on the most detailed map level, level 0, it is not
necessary to define a dictionary 'bit mask' for level 0.
The [Dictionary] tag is optional, but very useful to filter map objects per type per level.
4.5.3
Using Dictionary
The following is an extract from a
PFM
file defining a Dictionary 'bit mask' for polyline
[RGN40] objects. In this example major (thick) and principal (medium) highways (types 1,
2 & 3) will be displayed on levels 0 to 3, arterial roads (types 4 & 5) will be displayed on
levels 0, 1 and 2 and residential streets (type 6) will be displayed on levels 0 and 1. No
other polyline objects will be displayed. Level 4 is the last level of this map and cannot
contain map objects.