Encoding PE Flag Values and X,Y Coordinates

 

Flag values and X,Y coordinates are encoded into a base 64 (default)

 

or base 32 equivalent (7-bit mode).

 

 

The following steps give a generic algorithm for encoding a number.

 

Assume x is the number to be encoded. Use steps 1 and 2 only if

 

you are encoding fractional data; otherwise, begin with step 3.

 

 

Note

When converting numbers to base 32 or 64 (step 4 in the following

 

instructions), note that highest order digits are always in the high

 

range, all other digits are in the low range. Therefore, if there is

 

only one digit in a number, it is in the high range.

 

Table 20-24 Procedure to encode a number

 

 

STEPS

EXAMPLE

 

1. Fraction adjustment. If you are

x = 82.83

 

using fractional data, this step converts

 

 

the number of decimal places in your

 

 

data to the number of binary fractional

 

 

bits. Assume "n" is the number of

 

 

fractional binary bits specified by the

 

 

fractional data flag.

 

 

a. Multiply the number of decimal

2 × 3.33 = 6.66

 

places contained in the data by 3.33.

 

 

b. Round that number up to the next

 

 

integer to get integer n.

 

 

n = round (decimal places ×

n = 7

 

3.33)

 

 

x = x × 2n

x = 82.83 × 2 7 =

 

 

10,525.42

EN

PE, Polyline Encoded 20-37

Page 497
Image 497
HP 5961-0509 manual Or base 32 equivalent 7-bit mode, You are encoding fractional data otherwise, begin with step